Enable LTO for RediSearch module when Redis is builed with modules#57
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
48f2e1c to
2978f9a
Compare
e0a7a1c to
2978f9a
Compare
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>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
2978f9a to
b405dcc
Compare
ebcd2f4 to
a7c3c05
Compare
❌ Jit Scanner failed - Our team is investigatingJit 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 |
a7c3c05 to
a71ef62
Compare
❌ Jit Scanner failed - Our team is investigatingJit 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 |
a71ef62 to
d417f3e
Compare
d417f3e to
e8e0e68
Compare
❌ Jit Scanner failed - Our team is investigatingJit 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 |

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-14as a fallback and conditionally setsLTO=1only when/opt/llvmis present (otherwise forcesLTO=0).Updates the Rocky 10 builder image to provide the required LLVM toolchain.
Dockerfile.rockylinux10installs a newinstall_llvm.shscript that downloads upstream LLVM 21 into/opt/llvm, adds version-suffixed tool aliases expected by RediSearch, and prepends/opt/llvm/bintoPATH.Reviewed by Cursor Bugbot for commit 8920c19. Bugbot is set up for automated code reviews on this repo. Configure here.