Skip to content

Unified Redis + Modules build workflow#14959

Open
gabsow wants to merge 1 commit intoredis:unstablefrom
gabsow:redis+Modules-Workflow
Open

Unified Redis + Modules build workflow#14959
gabsow wants to merge 1 commit intoredis:unstablefrom
gabsow:redis+Modules-Workflow

Conversation

@gabsow
Copy link
Copy Markdown
Contributor

@gabsow gabsow commented Mar 30, 2026

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


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/*/src and building them alongside core by default, with an explicit make core path to build Redis without modules.

Adds a modules.json manifest and a new utils/modules/update-modules.sh helper to clone/update pinned module sources and generate a flattened redis-full.conf for running Redis with modules; the previously committed redis-full.conf is 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 passes ARCH, with a Rust cargo fetch step for redisjson); release tooling gains 01_create_tarball.sh --with-modules to produce a self-contained tarball including module sources and a module-enabled redis.conf.

Written by Cursor Bugbot for commit 5e3ff12. This will update automatically on new commits. Configure here.

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
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Mar 30, 2026

🤖 Augment PR Summary

Summary: This PR unifies the Redis core + modules build workflow by auto-detecting cloned module sources instead of relying on BUILD_WITH_MODULES=yes.

Changes:

  • Top-level Makefile: detect available modules automatically and add core, run, run-full, update-modules, update-modules-no-deps, and test-all targets.
  • Add modules.json manifest (module repos, pinned refs, shared library names, Rust metadata).
  • Add utils/modules/update-modules.sh to clone/update module sources and generate a flattened redis-full.conf.
  • Simplify module make logic to assume sources are managed externally (and pass computed ARCH into module builds; normalize Darwin to macos).
  • Stop tracking redis-full.conf (now generated) and ignore cloned module sources / build marker files.
  • Extend utils/releasetools/01_create_tarball.sh with --with-modules to bundle module sources and generate a flattened config in the tarball.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 7 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread Makefile
# 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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread Makefile
endif

# Never build modules on 32-bit
ifeq ($(MAKECMDGOALS),32bit)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Makefile:18 — The “Never build modules on 32-bit” guard only triggers when $(MAKECMDGOALS) is exactly 32bit; if 32bit is one of multiple goals, modules may still be considered available and built.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread Makefile
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 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 ;;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread modules/common.mk
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

exit 1
fi

MODULES=$(python3 -c "
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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

(cd "$(SRC_DIR)" && cargo fetch); \
touch .cargo_fetched; \
fi; \
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.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.

Fix in Cursor Fix in Web

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.

1 participant