Skip to content

Enable LTO for RediSearch module when Redis is builed with modules#57

Merged
AngelYanev merged 4 commits into
unstablefrom
enable-lto-redisearch
May 21, 2026
Merged

Enable LTO for RediSearch module when Redis is builed with modules#57
AngelYanev merged 4 commits into
unstablefrom
enable-lto-redisearch

Conversation

@AngelYanev
Copy link
Copy Markdown
Contributor

@AngelYanev AngelYanev commented May 7, 2026

Note

Medium Risk
Moderate risk because it changes the RPM build toolchain and LTO behavior, which can affect build reliability and binary compatibility across distros/architectures.

Overview
Enables RediSearch LTO for module builds where supported. The build action now selects gcc-toolset-14 as a fallback and conditionally sets LTO=1 only when /opt/llvm is present (otherwise forces LTO=0).

Updates the Rocky 10 builder image to provide the required LLVM toolchain. Dockerfile.rockylinux10 installs a new install_llvm.sh script that downloads upstream LLVM 21 into /opt/llvm, adds version-suffixed tool aliases expected by RediSearch, and prepends /opt/llvm/bin to PATH.

Reviewed by Cursor Bugbot for commit 8920c19. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 7, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@AngelYanev AngelYanev force-pushed the enable-lto-redisearch branch from 48f2e1c to 2978f9a Compare May 11, 2026 13:45
Comment thread .github/actions/build-package/action.yml
@AngelYanev AngelYanev force-pushed the enable-lto-redisearch branch from e0a7a1c to 2978f9a Compare May 14, 2026 08:56
RediSearch enables LTO by default in unstable and requires a clang whose
LLVM major matches rustc's (currently LLVM 21 from rustc 1.94). The LLVM
project does not publish a dnf repository for RHEL/Rocky, so we install
the official LLVM 21 tarball into /opt/llvm and add it to PATH.

Restricted to Rocky 10. The upstream LLVM 21 binaries require
GLIBCXX_3.4.30+ which is only available on Rocky 10's system libstdc++;
Rocky 8 and 9 ship 3.4.25 and 3.4.28 respectively. Making LTO work
there would require bundling a newer libstdc++ alongside the produced
redisearch.so on every customer machine, which is out of scope for now.
Rocky 8/9 continue to build with LTO=0.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2978f9a. Configure here.

Comment thread .github/actions/build-package/action.yml Outdated
@AngelYanev AngelYanev force-pushed the enable-lto-redisearch branch from 2978f9a to b405dcc Compare May 14, 2026 09:50
@AngelYanev AngelYanev force-pushed the enable-lto-redisearch branch 2 times, most recently from ebcd2f4 to a7c3c05 Compare May 14, 2026 11:44
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 14, 2026

❌ Jit Scanner failed - Our team is investigating

Jit Scanner failed - Our team has been notified and is working to resolve the issue. Please contact support if you have any questions.


💡 Need to bypass this check? Comment @sera bypass to override.

@AngelYanev AngelYanev force-pushed the enable-lto-redisearch branch from a7c3c05 to a71ef62 Compare May 14, 2026 12:39
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 14, 2026

❌ Jit Scanner failed - Our team is investigating

Jit Scanner failed - Our team has been notified and is working to resolve the issue. Please contact support if you have any questions.


💡 Need to bypass this check? Comment @sera bypass to override.

@AngelYanev AngelYanev force-pushed the enable-lto-redisearch branch from a71ef62 to d417f3e Compare May 20, 2026 13:02
@AngelYanev AngelYanev force-pushed the enable-lto-redisearch branch from d417f3e to e8e0e68 Compare May 20, 2026 13:04
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 20, 2026

❌ Jit Scanner failed - Our team is investigating

Jit Scanner failed - Our team has been notified and is working to resolve the issue. Please contact support if you have any questions.


💡 Need to bypass this check? Comment @sera bypass to override.

@AngelYanev AngelYanev merged commit f0eef62 into unstable May 21, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants