Unified Redis + Modules build workflow#14959
Conversation
Replace the BUILD_WITH_MODULES=yes flag with automatic module detection. When module sources are present (cloned via update-modules.sh), `make` builds them alongside core. `make core` always builds Redis only. Key changes: - modules.json: manifest of module repos, pinned refs, and metadata - utils/modules/update-modules.sh: clone/update modules, generate redis-full.conf (flattened, no include directives) - Makefile: auto-detect modules, add `core`, `run`, `run-full`, `update-modules`, and `test-all` targets - modules/common.mk: simplified — source management is now external (via update-modules.sh), not baked into make - redis-full.conf: removed from tracking — now generated dynamically from redis.conf + per-module module.conf files - 01_create_tarball.sh: --with-modules flag to create monolithic source tarballs including all module sources Made-with: Cursor
🤖 Augment PR SummarySummary: This PR unifies the Redis core + modules build workflow by auto-detecting cloned module sources instead of relying on Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
| # Auto-detect which modules have been cloned (have a src/ directory) | ||
| MODULE_NAMES := redisjson redistimeseries redisbloom redisearch | ||
| AVAILABLE_MODULES := $(foreach m,$(MODULE_NAMES),$(if $(wildcard modules/$(m)/src/Makefile),$(m))) | ||
| HAS_MODULES := $(if $(AVAILABLE_MODULES),yes,no) |
There was a problem hiding this comment.
Makefile:8-9 — HAS_MODULES is computed at parse time, so a single invocation like make update-modules all (or make update-modules run) won’t build modules that were cloned during update-modules in that same run. This can lead to surprising behavior where modules are present by the time recipes execute but still skipped.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| endif | ||
|
|
||
| # Never build modules on 32-bit | ||
| ifeq ($(MAKECMDGOALS),32bit) |
There was a problem hiding this comment.
| for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@; done | ||
| set -e; for dir in src; do $(MAKE) -C $$dir $@; done | ||
| ifeq ($(HAS_MODULES),yes) | ||
| -$(MAKE) -C modules $@ 2>/dev/null || true |
There was a problem hiding this comment.
Makefile:39 — The .DEFAULT forwarding suppresses module sub-make failures (2>/dev/null || true), which can hide real module build/test errors and make top-level make <target> appear successful even when modules failed.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| while [ $# -gt 0 ]; do | ||
| case "$1" in | ||
| --skip-deps) SKIP_DEPS=1; shift ;; | ||
| --only) ONLY_MODULE="$2"; shift 2 ;; |
There was a problem hiding this comment.
utils/modules/update-modules.sh:33 — --only assumes $2 exists; running update-modules.sh --only without a value will currently terminate via set -u/shift 2 with a confusing error instead of a clear usage message.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| PROCESSED=0 | ||
|
|
||
| for MODULE_NAME in ${MODULES}; do | ||
| if [ -n "${ONLY_MODULE}" ] && [ "${MODULE_NAME}" != "${ONLY_MODULE}" ]; then |
There was a problem hiding this comment.
utils/modules/update-modules.sh:59-62 — If --only <name> doesn’t match any manifest entry, the script processes zero modules but still generates redis-full.conf and exits 0, which can look like success for a typoed module name.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| git clone --recursive --depth 1 --branch $(MODULE_VERSION) $(MODULE_REPO) $(SRC_DIR) | ||
| touch $@ | ||
| # Source is managed by utils/modules/update-modules.sh. | ||
| # get_source verifies the source tree exists and initializes submodules if |
There was a problem hiding this comment.
modules/common.mk:30-32 — The comment says get_source “initializes submodules”, but the rule currently only checks for the directory and doesn’t run any submodule initialization; this mismatch may mislead users debugging missing submodule content.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| exit 1 | ||
| fi | ||
|
|
||
| MODULES=$(python3 -c " |
There was a problem hiding this comment.
utils/releasetools/01_create_tarball.sh:52 — In --with-modules mode the script invokes python3 but doesn’t verify it exists; with set -eu this fails with a terse “python3: not found” rather than a targeted error message.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| (cd "$(SRC_DIR)" && cargo fetch); \ | ||
| touch .cargo_fetched; \ | ||
| fi; \ | ||
| fi |
There was a problem hiding this comment.
.cargo_fetched marker created even when cargo fetch fails
High Severity
In the cargo_fetch recipe, all commands run in a single shell if block without set -e or && chaining. If (cd "$(SRC_DIR)" && cargo fetch) fails, the shell continues and executes touch .cargo_fetched anyway. This falsely marks cargo dependencies as fetched, so subsequent builds skip the fetch and fail with confusing Rust compilation errors. The old code had cargo fetch and touch on separate Makefile recipe lines, where Make would abort after a failed line and never run touch.


Replace the BUILD_WITH_MODULES=yes flag with automatic module detection. When module sources are present (cloned via update-modules.sh),
makebuilds them alongside core.make corealways builds Redis only.Key changes:
core,run,run-full,update-modules, andtest-alltargetsMade-with: Cursor
Note
Medium Risk
Touches top-level build orchestration and release tarball generation; mistakes could break builds, packaging, or module loading across platforms.
Overview
Unifies Redis core + module build workflow by auto-detecting which module sources are present under
modules/*/srcand building them alongside core by default, with an explicitmake corepath to build Redis without modules.Adds a
modules.jsonmanifest and a newutils/modules/update-modules.shhelper to clone/update pinned module sources and generate a flattenedredis-full.conffor running Redis with modules; the previously committedredis-full.confis removed and is now generated/ignored.Updates module makefiles to only build cloned modules and shifts source management out of
modules/common.mk(now validates presence and passesARCH, with a Rustcargo fetchstep forredisjson); release tooling gains01_create_tarball.sh --with-modulesto produce a self-contained tarball including module sources and a module-enabledredis.conf.Written by Cursor Bugbot for commit 5e3ff12. This will update automatically on new commits. Configure here.