Skip to content

Update build-from-source docs for 8.10+ and fix build.sh flag handling - #15454

Merged
YaacovHazan merged 15 commits into
redis:unstablefrom
TalBarYakar:tal.ba/fix/modules-modernization_gaps
Jul 14, 2026
Merged

YaacovHazan merged 15 commits into
redis:unstablefrom
TalBarYakar:tal.ba/fix/modules-modernization_gaps

Conversation

@TalBarYakar

@TalBarYakar TalBarYakar commented Jul 12, 2026 •

Copy link
Copy Markdown
Collaborator

Followup #15253

Updates build-from-source documentation for Redis 8.10+: release flows use redis-full.tar.gz, start the server with redis.conf (module config baked into release tarballs), and document explicit Rust 1.94 and LLVM 21 / lld where RediSearch LTO needs them—instead of relying on INSTALL_RUST_TOOLCHAIN=yes and make modules-update in those paths. Ubuntu 20.04 instructions switch to GCC 11 (PPA) for C++20 libstdc++; Alma/Rocky sections add lld/llvm, python3 alternatives on 8.10, and drop make modules-update on Alma 10.

scripts/build.sh now runs modules install-rust when INSTALL_RUST_TOOLCHAIN=yes, so make build matches the modules Makefile behavior. The obsolete handle-werrors target has been removed from the modules Makefile (matching #15257): it is no longer required and was causing build errors, so DISABLE_WERRORS no longer strips -Werror via this path.


Note

Low Risk
Changes are limited to documentation and optional build-script/Makefile behavior; no Redis server or module runtime logic is modified.

Overview
Build-from-source docs for Redis 8.10+ are rewritten across OS-specific README sections: sources come from redis-full.tar.gz, servers start with redis.conf (module settings baked into release tarballs), and INSTALL_RUST_TOOLCHAIN=yes / make modules-update are dropped from those release flows in favor of pinned Rust 1.94.0 and LLVM 21 / lld where RediSearch C/Rust LTO needs them. Ubuntu 20.04 moves to GCC 11 via PPA; Alma/Rocky sections add lld/llvm, python3 alternatives on 8.10, and drop make modules-update on Alma 10.

The top-level config blurb now contrasts release tarball redis.conf vs git checkout redis-full.conf, with a link to 8.8 docs for older versions.

scripts/build.sh runs make -C modules install-rust when INSTALL_RUST_TOOLCHAIN=yes, so make build provisions Rust the same way the modules Makefile already could.

modules/Makefile drops the handle-werrors target (and DISABLE_WERRORS no longer strips -Werror on module sources). modules/README.md adds 8.10+ tarball guidance pointing at the main README.

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

Comment thread scripts/build.sh Resolved
Comment thread scripts/build.sh Resolved
@gabsow

gabsow commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Ran every Linux section of the updated build instructions end-to-end in fresh Docker containers (aarch64), using the redis-full.tar.gz from the 8.10.0 pre-release on the fork in place of the redis/redis download URL (steps otherwise verbatim, <version> = 8.10.0). macOS was not tested.

Section Images tested make all Run step (redis-full.conf)
Ubuntu 20.04 ubuntu:20.04 ❌ RediSearch (LLVM 10 vs 21) not reached
Ubuntu 22.04 ubuntu:22.04 ❌ RediSearch (LLVM 14 vs 21) not reached
Ubuntu 24.04 ubuntu:24.04 ❌ RediSearch (LLVM 18 vs 21) not reached
Ubuntu 26.04 ubuntu:26.04 ✅ ❌ file not in tarball
Debian 12 / 13 debian:bookworm-slim, debian:trixie-slim ❌ RediSearch (LLVM 14/19 vs 21) not reached
Alma/Rocky 8.10 almalinux:8.10-minimal, rockylinux/rockylinux:8.10 ❌ RediSearch + RedisJSON + RedisTimeSeries not reached
Alma/Rocky 9.7 almalinux:9.7, rockylinux/rockylinux:9.7-minimal ❌ RediSearch not reached
Alma/Rocky 10.1 almalinux:10.1-minimal, rockylinux/rockylinux:10.1 ✅ ❌ file not in tarball
Alpine 3.23 alpine:3.23 ✅ ✅ (only because of make modules-update, see 4)

RedisBloom/RedisJSON/RedisTimeSeries built fine everywhere except the EL8 python3 issue below; where the build succeeded, ./src/redis-server redis.conf starts with all 5 modules loaded.

1. RediSearch fails on Ubuntu 20.04/22.04/24.04 and Debian 12/13 — LTO LLVM mismatch

INSTALL_RUST_TOOLCHAIN=yes installs Rust 1.94.0 (LLVM 21), and the bundle enables RediSearch's cross-language LTO by default (build_env: LTO=1 in modules.yaml). The distro clang on these OSes is LLVM 10/14/18/19, so the build aborts:

Error: LLVM version mismatch between rustc and clang
Rust uses LLVM 21 (from: rustc --version --verbose)
Clang uses LLVM 14 (from: clang --version)

Only the Ubuntu 26.04, Alma/Rocky 10.1, and Alpine sections currently end up with clang/LLVM 21. Verified fix: adding export LTO=0 to the build step (as the macOS section already does) gives a full green build on Ubuntu 22.04 — the same should apply to the other four sections (clang-21 isn't packaged on these releases).

2. Alma/Rocky 8.10 and 9.7 — lld and llvm missing; 8.10 also lacks a usable python3

On EL8/EL9 the clang package is actually clang 21.1.8 now, so the LTO version check passes — but the dnf list installs neither lld (the LTO build links with -fuse-ld=lld) nor llvm (the build archives with llvm-ar/llvm-ranlib), exactly the two extras the 10.1 section's note already explains:

clang-21: error: invalid linker name in argument '-fuse-ld=lld'

and with only lld added, it then fails at Linking C static library libuv.a / libfmt.a with Error running link command: No such file or directory (no llvm-ar).

On 8.10 additionally, the instructions install python3.11, which doesn't provide an unversioned /usr/bin/python3 (and a dependency can register a pip-less python3.12 there). RedisJSON/RedisTimeSeries need a python3 for which python3 -m pip --version works, else:

deps/readies/mk/main:49: *** Cannot find python3 interpreter.

Verified fixes (full green build + server runs):

  • 9.7: add lld llvm to the dnf install list.
  • 8.10: add lld llvm, plus:
    alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1000000
    alternatives --set python3 /usr/bin/python3.11

3. Every "Run Redis" step references redis-full.conf, which doesn't exist in the release tarball

The tarball intentionally ships no redis-full.conf — make tarball bakes the module config into redis.conf (the intro note in this PR says as much). So on every OS the documented final step fails:

# Fatal error, can't open config file '/usr/src/redis-8.10.0/redis-full.conf': No such file or directory

./src/redis-server redis.conf works and loads all modules. The per-OS run steps should say redis.conf (or the tarball should ship/generate redis-full.conf).

4. Alpine section still runs make modules-update, discarding the bundled sources

On a tarball tree modules/*/src has no .git, so modules-update does rm -rf on each bundled module and re-clones from upstream GitHub:

==> Cloning redisearch @ tag v8.9.82 from https://github.com/redisearch/redisearch into modules/redisearch/src

That contradicts modules/README.md ("do not run make modules-update" from a tarball), requires network+git, and rebuilds from fresh clones instead of the shipped, pinned sources. It's also the only reason Alpine's run step works: modules-update regenerates redis-full.conf. Since the tarball already bundles RedisJSON's source, the make modules-update line can be dropped — the sed patch on modules/redisjson/src/Makefile applies fine to the shipped file (and the run step then needs redis.conf like the other sections).


Test harness: fresh containers, two concurrent builds, each section's commands run as a single script; full logs available on request.

@gabsow

gabsow commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Following the end-to-end test results above, here are the concrete README edits needed so each "Build from source" section actually succeeds. All are verified by the runs above (aarch64 containers, redis-full.tar.gz from the 8.10.0 pre-release).

A. Run step — every OS: redis-full.conf → redis.conf

The release tarball intentionally ships no redis-full.conf (make tarball bakes the module loadmodule lines into redis.conf). So every section's final step:

./src/redis-server redis-full.conf   # ❌ No such file or directory

should be:

./src/redis-server redis.conf        # ✅ starts with all 5 modules loaded

(Alternative if you'd rather keep the doc as-is: have make tarball generate/ship redis-full.conf — but the one-word doc fix is simpler.)

B. RediSearch LTO — Ubuntu 20.04 / 22.04 / 24.04, Debian 12 / 13: build with LTO=0

INSTALL_RUST_TOOLCHAIN=yes gives Rust 1.94 (LLVM 21) and the bundle enables RediSearch cross-language LTO by default, but the distro clang on these releases is LLVM 10/14/18/19 → the build aborts with LLVM version mismatch between rustc and clang. clang-21 isn't packaged on these, so add LTO=0 to the make step (exactly as the macOS section already does):

make -j "$(nproc)" all LTO=0
  • Ubuntu 26.04, Alma/Rocky 10.1, Alpine 3.23 already end up with clang/LLVM 21 — leave them at the LTO=1 default.
  • Debian 12 (GCC 12) may then hit VectorSimilarity's -Werror avx512 false-positive; if so, this PR's new DISABLE_WERRORS=yes covers it: make all LTO=0 DISABLE_WERRORS=yes.

C. Alma/Rocky 8.10 and 9.7: add lld llvm to the dnf list

EL8/EL9 now ship clang 21 (LTO version-check passes), but the dnf list installs neither lld (LTO links with -fuse-ld=lld) nor llvm (build archives with llvm-ar/llvm-ranlib) — the same two extras the 10.1 note already calls out:

clang-21: error: invalid linker name in argument '-fuse-ld=lld'
# then, with only lld: Linking C static library libuv.a → Error running link command

Add lld llvm to the dnf install line on both.

EL8 (8.10) additionally — make python3.11 the default python3 (readies needs a pip-capable python3, else Cannot find python3 interpreter):

alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1000000
alternatives --set python3 /usr/bin/python3.11

D. Alpine: drop the make modules-update line

On a tarball tree modules/*/src has no .git, so make modules-update rm -rfs each bundled module and re-clones from GitHub (needs network+git, rebuilds from fresh clones, and contradicts modules/README.md's "do not run make modules-update from a tarball"). The tarball already ships the pinned sources, so remove that line — then the run step uses redis.conf per (A).


With A–D applied, all Linux sections build green and ./src/redis-server redis.conf comes up with all five modules loaded (macOS not tested here). This mirrors the bootstrap-flow fixes already merged upstream (RediSearch #10373 added lld/llvm-ar for EL, RedisTimeSeries #2089 the alpine venv) — the manual instructions just need the equivalent per-OS steps spelled out.

@gabsow

gabsow commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Correction to (B) above — LTO=0 isn't the right fix. We already made LTO=1 build on all these OSes (that's what RediSearch #10373 does); the manual instructions just need to install the same toolchain make bootstrap installs (install_llvm.sh) instead of the distro clang. Keeping LTO=1 matches the released redis-full.tar.gz artifacts, so a from-source build behaves like the shipped binaries.

(B, revised) Ubuntu 20.04 / 22.04 / 24.04, Debian 12 / 13: install clang-21, keep LTO=1

The failure is only that the distro clang is LLVM 10–19 while rustc 1.94 is LLVM 21. Those releases don't package clang-21, but apt.llvm.org does — add this to the dependency step (mirrors install_llvm.sh's apt path):

wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh
sudo bash /tmp/llvm.sh 21
sudo apt-get install -y clang-21 lld-21 llvm-21 libclang-21-dev

Then make -j "$(nproc)" all (LTO=1 default) works — build.sh finds clang-21/lld-21 and CMake's IPO finds llvm-ar-21. Verified on ubuntu:22.04: apt.llvm.org installs clang/lld/llvm all at 21.1.8 (== rustc's LLVM 21), and these exact OSes already build LTO=1 green in the modules nightly because make bootstrap does this same apt.llvm.org install.

No LTO=0 needed on any Linux section. (Only macOS keeps LTO=0, since LTO isn't supported there.)

(A), (C), (D) stand as written — note (C)'s EL8/EL9 already ship clang 21.1.8 natively, so they only need lld llvm added (no apt.llvm.org), which is already what I wrote.

So the net per-OS shape is: install the matching LLVM 21 toolchain (apt.llvm.org on Ubuntu/Debian; lld llvm on EL) → make all at the LTO=1 default → run with redis.conf. That keeps the manual build identical to the bootstrap/release path.

…e tarball

- Run step on every OS: redis-full.conf -> redis.conf. Release tarballs bake
  the module config into redis.conf and ship no redis-full.conf; the
  configuration-files note now explains the tarball/checkout split.
- Ubuntu 20.04/22.04/24.04, Debian 12/13: add an 'Install the LLVM 21
  toolchain' step (apt.llvm.org). INSTALL_RUST_TOOLCHAIN=yes installs
  Rust 1.94 (LLVM 21) and RediSearch's default cross-language LTO needs a
  matching clang/lld, which these releases do not package.
- AlmaLinux/Rocky 8.10 and 9.7: add lld + llvm to the dnf list (clang there
  is already LLVM 21); on 8.10 make python3.11 the default python3 so the
  module builds find a pip-capable python3.
- Alpine: drop 'make modules-update' — the tarball bundles the pinned module
  sources and modules/README.md says not to run it from a tarball.

Verified in fresh per-OS Docker containers (aarch64); details on redis#15454.

Co-Authored-By: Claude Fable 5 <[email protected]>
gabsow and others added 4 commits July 13, 2026 19:27
… flag

Every Linux section gains an 'Install the Rust toolchain' step after the
extract step (make -C modules install-rust INSTALL_RUST_TOOLCHAIN=yes — the
pinned, checksum-verified recipe), and the Build step drops the
INSTALL_RUST_TOOLCHAIN=yes export. Toolchain provisioning now reads as an
explicit prerequisite, consistent with the LLVM 21 step and the macOS
section's standalone Rust install; cross-references updated accordingly.

Co-Authored-By: Claude Fable 5 <[email protected]>
Replace 'make -C modules install-rust' with the underlying installer
commands (wget the official standalone tarball, install.sh, cleanup),
matching the macOS section's style. Per-OS variants: -gnu vs -musl
(Alpine), sudo only in sections that use it.

Co-Authored-By: Claude Fable 5 <[email protected]>
clang compiles RediSearch's C++ against the newest installed GCC's
libstdc++, and VectorSimilarity uses C++20 library features
(std::bit_cast, chrono calendar types) that libstdc++ 10 lacks:

  error: no template named 'bit_cast' in namespace 'std'
  error: no member named 'year_month_day' in namespace 'std::chrono'

Install gcc-11/g++-11 from ppa:ubuntu-toolchain-r/test (the same source
RediSearch's own focal bootstrap uses) and point the gcc alternatives at
11. Verified end-to-end in a fresh ubuntu:20.04 container.

Co-Authored-By: Claude Fable 5 <[email protected]>
README: fix per-OS build-from-source instructions for the full-release tarball
Comment thread modules/Makefile Resolved
@TalBarYakar TalBarYakar changed the title change readme and make INSTALL_RUST work modernize build-from-source instructions for 8.10+; fix build.sh toolchain/werror flags Jul 13, 2026
@gabsow

gabsow commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Re-ran the full per-OS validation against the current head (a06c8c8) — i.e. the README text now on this PR, executed verbatim as a script per OS section in fresh Docker containers (aarch64). Success criterion: full build and redis-server up with bf/search/ReJSON/timeseries in MODULE LIST.

With the Search/TS that are about to be released — all green

Built with redisearch and redistimeseries pinned to upstream master (post RediSearch#10372 / RedisTimeSeries#2089 — the refs the new tags will be cut from), everything else per this PR's instructions:

Section Image Result
Ubuntu 20.04 ubuntu:20.04 ✅
Ubuntu 22.04 ubuntu:22.04 ✅
Ubuntu 24.04 ubuntu:24.04 ✅
Ubuntu 26.04 ubuntu:26.04 ✅
Debian 12 debian:bookworm-slim ✅
Debian 13 debian:trixie-slim ✅
Alma/Rocky 8.10 rockylinux:8.10 ✅
Alma/Rocky 9.7 almalinux:9.7 ✅
Alma/Rocky 10.1 almalinux:10.1-minimal ✅
Alpine 3.23 alpine:3.23 ✅
macOS — not tested (no Docker); unchanged apart from the run-step fix

So once the retag lands and the release tarball pins the new tags, these instructions are good as written.

Against the existing 8.10.0 pre-release tarball

The five sections whose toolchain already matches build the current asset green verbatim: Ubuntu 26.04, Alma/Rocky 8.10 / 9.7 / 10.1, Alpine.

Ubuntu 20.04/22.04/24.04 and Debian 12/13 fail with it only because the pinned RediSearch v8.9.82 probes the unversioned clang/ld.lld/llvm-ar names, while apt.llvm.org exposes versioned names in /usr/bin. Verified fix (all five sections green against the current asset): add one line to the build step, same pattern the Alpine section already uses —

export PATH="/usr/lib/llvm-21/bin:$PATH"

(apt.llvm.org ships the unversioned tools there.) Optional for this PR since the release will carry the new tags — happy to push it if you want the instructions to also cover the current asset.

Full logs available; harness: one fresh container per section, two concurrent builds, MODULE LIST asserted after server start.

Comment thread README.md Outdated
mkdir -p /usr/src
cd /usr/src
# Redis 8.10 and above — full release that bundles the modules (<tag>, e.g. redis-docker-10):
wget -O redis-<version>.tar.gz https://github.com/redis/redis/releases/download/<tag>/redis-full.tar.gz

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use version insted of tag on this string

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread README.md Outdated
```sh
cd /usr/src
# Redis 8.10 and above — full release that bundles the modules (<tag>, e.g. redis-docker-10):
wget -O redis-<version>.tar.gz https://github.com/redis/redis/releases/download/<tag>/redis-full.tar.gz

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

'''<tag> --> <version>'''

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

Comment thread scripts/build.sh Resolved
Comment thread README.md Resolved
Comment thread README.md Outdated
cd /usr/src
wget -O redis-<version>.tar.gz https://github.com/redis/redis/archive/refs/tags/<version>.tar.gz
# <version>, e.g. 8.10.0 — full release that bundles the modules:
wget -O redis-full.tar.gz https://github.com/redis/redis/releases/download/<version>/redis-full.tar.gz

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

use as befor redis-.tar.gz

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed — local file now saved as redis-.tar.gz (via -O); release asset URL stays redis-full.tar.gz. Applied to all sections.

Comment thread README.md Outdated
tar xvf redis-<version>.tar.gz
rm redis-<version>.tar.gz
tar xvf redis-full.tar.gz
rm redis-full.tar.gz

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can be like befor redis-.tar.gz

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed — local file now saved as redis-.tar.gz (via -O); release asset URL stays redis-full.tar.gz. Applied to all sections.

Comment thread README.md Resolved
Comment thread scripts/build.sh Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 0381830. Configure here.

Comment thread scripts/build.sh Resolved
@sundb sundb changed the title modernize build-from-source instructions for 8.10+; fix build.sh toolchain/werror flags Update build-from-source docs for 8.10+ and fix build.sh flag handling Jul 14, 2026
Comment thread scripts/build.sh Resolved
@YaacovHazan
YaacovHazan merged commit e5e1eaa into redis:unstable Jul 14, 2026
16 checks passed
Comment thread README.md
apt-get update
apt-get install -y sudo
sudo apt-get install -y --no-install-recommends ca-certificates wget dpkg-dev gcc g++ libc6-dev libssl-dev make git python3 python3-pip python3-venv python3-dev unzip rsync clang automake autoconf gcc-10 g++-10 libtool
sudo apt-get install -y --no-install-recommends ca-certificates wget dpkg-dev gcc g++ libc6-dev libssl-dev make git python3 python3-pip python3-venv python3-dev unzip rsync clang automake autoconf libtool

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We do not support focal builds at least since 8.8 (maybe earlier), I think this section could be deleted to not create a false expectations.

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.

5 participants