Skip to content

MOD-16514 - fix bootstrap & build for al os - #1612

Merged
TalBarYakar merged 23 commits into
masterfrom
tal.ba/fix/build_bootstrap
Jul 5, 2026
Merged

TalBarYakar merged 23 commits into
masterfrom
tal.ba/fix/build_bootstrap

Conversation

@TalBarYakar

@TalBarYakar TalBarYakar commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes affect bootstrap, compiler selection, and Rust toolchain resolution on many OS images and shared CI hosts; regressions could surface as failed builds rather than runtime security issues.

Overview
Improves bootstrap and build reliability across Alpine (musl) and several Linux flavors, with emphasis on shared build hosts and CI.

For Alpine/musl, Cargo is configured with target-feature=-crt-static, and bootstrap adds a libclang.so symlink so bindgen can dlopen LLVM’s versioned libraries.

getrust.sh is rewritten to stay user-scoped (~/.cargo / ~/.rustup only): no /usr/local symlinks, no rustup update, no default toolchain—only the channel from rust-toolchain.toml. Clippy/linter workflows now rely on install_script.sh (dropped duplicate getrust.sh) and source "$HOME/.cargo/env"; macOS sparse checkout includes rust-toolchain.toml.

Shared install helpers: centralized install_aws_cli (arch-aware, skip if present), cmake skips when a sufficient version exists, apt passes DEBIAN_FRONTEND through sudo to avoid tzdata hangs, and EL8/EL9 expose gcc-toolset tools under /usr/local/bin. Bionic/focal only bump gcc-10 when the active compiler is older than 10; bionic also gets non-interactive debconf/tzdata, conditional cmake-from-source, and AWS CLI via the shared helper.

make build only exports RUSTFLAGS / RUSTDOCFLAGS when non-empty, avoiding empty overrides that can break musl builds.

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

@TalBarYakar TalBarYakar changed the title Tal.ba/fix/build bootstrap MOD-16514 - fix bootstrap & build for al os Jul 1, 2026
@TalBarYakar
TalBarYakar marked this pull request as ready for review July 1, 2026 12:14
@TalBarYakar
TalBarYakar requested review from AvivDavid23 and gabsow July 1, 2026 12:15
@TalBarYakar TalBarYakar self-assigned this Jul 1, 2026
Comment thread .install/os/alpine.sh Resolved
Comment thread .install/lib/packages.sh Resolved
Comment thread .install/os/focal.sh
$SUDO update-alternatives --set gcc /usr/bin/gcc-10
$SUDO update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 60
$SUDO update-alternatives --set g++ /usr/bin/g++-10
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.

g++ may stay old

Medium Severity

Compiler selection keys only off gcc -dumpversion. When the active gcc major is already 10 or higher, the script skips all update-alternatives work, so g++ can remain on an older default even though this OS script exists to provide gcc/g++ 10 for C++20.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9b784a8. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

debian_default_install pins cc, gcc, and g++ together atomically — if the active gcc is already ≥ 10, g++ will also have been set to the matching version by the same block. The check is intentionally "only upgrade, never downgrade" to be safe in shared bootstrap containers where another module may have already set a newer compiler.

@codecov

codecov Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.99%. Comparing base (733ffed) to head (d3292be).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1612   +/-   ##
=======================================
  Coverage   85.99%   85.99%           
=======================================
  Files          15       15           
  Lines        5177     5177           
=======================================
  Hits         4452     4452           
  Misses        725      725           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gabsow gabsow left a comment

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.

Reviewed the bootstrap/build changes. I did not find new blocking issues beyond the ones cursor already flagged (alpine libclang.so symlink needs sudo; install_aws_cli aws/install needs sudo; focal g++ may stay old under the _cur<10 guard). Note that this PR is the more robust bionic reference of the three module bootstraps — it runs apt-get update before importing the toolchain-r keys and hard-installs gnupg wget curl ca-certificates — whereas the RedisBloom/RedisTimeSeries siblings soft-fail those; worth aligning them to this one.

@gabsow

gabsow commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Cross-module consistency (non-blocking) — this is one of three sibling PRs applying the same CI bootstrap/build fix:

Their .install/ logic has drifted in a few places — worth reconciling so the three modules keep an identical bootstrap:

  1. bionic prerequisite install (the one that matters): RedisJSON runs apt-get update -qq and then hard-installs gnupg wget curl ca-certificates; RedisBloom/RedisTimeSeries skip the update and soft-fail (apt-get install ... gnupg wget 2>/dev/null || true). On a clean image that can silently leave the ubuntu-toolchain-r PPA key unimported. Recommend standardizing on the RedisJSON variant.
  2. debian_default_install gcc/cc/g++ pinning (lib/pm.sh): present in RedisBloom/RedisTimeSeries, absent in RedisJSON. Plausibly intentional (JSON is Rust; the others are C with -fblocks defer macros, so pinning gcc over clang matters there) — but worth a deliberate call rather than drift.
  3. el8 python3.11-pip + update-alternatives --set python3: present in RedisBloom/RedisTimeSeries, absent in RedisJSON.

None of this blocks — flagging so the three don't silently diverge.

Comment thread .install/os/alpine.sh Resolved
gabsow
gabsow previously approved these changes Jul 2, 2026

@gabsow gabsow left a comment

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.

Re-reviewed after the fix commits — all blockers resolved:

  • HIGH (alpine libclang.so path): the symlink logic now finds the versioned libclang under the llvm*/lib location, so bindgen's dlopen works on Alpine. ✅
  • ln / AWS-CLI sudo: the libclang symlink and install_aws_cli now run with $SUDO, so a non-root bootstrap no longer fails. ✅
  • focal g++ may stay old: debian_default_install pins cc/gcc/g++ together, so the _cur ≥ 10 skip leaves a consistent toolchain — reasonable as-is.

LGTM — approving.

@TalBarYakar
TalBarYakar force-pushed the tal.ba/fix/build_bootstrap branch from 9cdcc21 to 7cdd641 Compare July 2, 2026 13:21
Comment thread .install/os/bionic.sh
$SUDO ln -sf /usr/local/bin/cmake /usr/bin/cmake
fi

pip3 install dataclasses

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unguarded bionic dataclasses pip

Medium Severity

bionic.sh ends with a bare pip3 install dataclasses while install_script.sh runs with set -e, so any pip error aborts the whole bootstrap. Sister EL8 scripts use a guarded, version-pinned install with || true for the same backport.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 31fcded. Configure here.

Comment thread .install/getrust.sh Resolved
Match flow-linter.yml; getrust.sh now installs Rust user-scoped, so later
Actions steps don't see cargo without sourcing the env.

@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 3 total unresolved issues (including 2 from previous reviews).

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 6e55a63. Configure here.

Comment thread .install/getrust.sh Resolved
invokes it from the repo root (works), but the workflow then called
./getrust.sh sudo again from working-directory: .install — where
rust-toolchain.toml doesn't exist, so its `sed rust-toolchain.toml` errored
with "No such file or directory" (exit 2).

Removed the redundant ./getrust.sh line from flow-linter.yml and
flow-clippy.yml; install_script.sh handles Rust install on its own.
The macOS "Deps checkout" fetches only .install and test requirements, then
runs install_script.sh -> getrust.sh, which reads rust-toolchain.toml from
the repo root to resolve the pinned toolchain. That file wasn't in the sparse
list, so getrust failed with "sed: rust-toolchain.toml: No such file or
directory". Add it to the sparse-checkout.
@TalBarYakar
TalBarYakar merged commit c091f23 into master Jul 5, 2026
61 checks passed
@TalBarYakar
TalBarYakar deleted the tal.ba/fix/build_bootstrap branch July 5, 2026 09:15
TalBarYakar added a commit that referenced this pull request Jul 5, 2026
* MOD-13014: redact user data from JSONPath trace logs (#1605)

MOD-13014 removed user data from errors but left the JSONPath engine's
trace logs, which still emitted document values, query literals and paths
at Redis `debug` log level (trace! maps to RedisLogLevel::Debug).

Gate those traces behind a cached mirror of Redis core's
`hide-user-data-from-log` server config: a new `trace_user_data!` macro
suppresses the message when the flag is on. The module reads the config
at load and refreshes it on CONFIG SET via a config-changed event
handler. Structural traces (grammar rules, "missing operand"
diagnostics) stay on plain trace! and are unaffected.

Co-authored-by: Claude Opus 4.8 <[email protected]>

* remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_dat… (#1613)

* MOD-16366 json add flow tests to check llapi c api (#1614)

* MOD-16366 LLAPI flow tests

* remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_data_from_log`

* remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_data_from_log`

* fail if module not available

* fixes

* CR

* .

* CR

* MOD-16514 - fix bootstrap & build for al os (#1612)

* alma8 +rhel8+rhel9+bionic +focal passes

* fix for alpine

* fix for bionic

* fix

* fix mariner

* fix bionic bootstrap

* fix bionic

* fix bionic

* fi bionic

* fix bionic

* install aws cli for json

* bionic fix

* fix bionic

* fix for focal

* fix for focak

* fix for bionic & focal &mariner&alpine

* apply fixes

* fix remarks

* fix for alpine

* try another methood

* ci: source $HOME/.cargo/env in flow-clippy so cargo is on PATH

Match flow-linter.yml; getrust.sh now installs Rust user-scoped, so later
Actions steps don't see cargo without sourcing the env.

* CI was failing because getrust.sh ran twice. install_script.sh already
invokes it from the repo root (works), but the workflow then called
./getrust.sh sudo again from working-directory: .install — where
rust-toolchain.toml doesn't exist, so its `sed rust-toolchain.toml` errored
with "No such file or directory" (exit 2).

Removed the redundant ./getrust.sh line from flow-linter.yml and
flow-clippy.yml; install_script.sh handles Rust install on its own.

* ci(macos): add rust-toolchain.toml to sparse checkout

The macOS "Deps checkout" fetches only .install and test requirements, then
runs install_script.sh -> getrust.sh, which reads rust-toolchain.toml from
the repo root to resolve the pinned toolchain. That file wasn't in the sparse
list, so getrust failed with "sed: rust-toolchain.toml: No such file or
directory". Add it to the sparse-checkout.

* bump version 8.9.81 to
Cargo.lock
&
Cargo.toml

---------

Co-authored-by: Tom Gabsow <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Aviv David <[email protected]>
TalBarYakar added a commit that referenced this pull request Jul 27, 2026
* MOD-13014: redact user data from JSONPath trace logs (#1605)

MOD-13014 removed user data from errors but left the JSONPath engine's
trace logs, which still emitted document values, query literals and paths
at Redis `debug` log level (trace! maps to RedisLogLevel::Debug).

Gate those traces behind a cached mirror of Redis core's
`hide-user-data-from-log` server config: a new `trace_user_data!` macro
suppresses the message when the flag is on. The module reads the config
at load and refreshes it on CONFIG SET via a config-changed event
handler. Structural traces (grammar rules, "missing operand"
diagnostics) stay on plain trace! and are unaffected.

Co-authored-by: Claude Opus 4.8 <[email protected]>

* remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_dat… (#1613)

* MOD-16366 json add flow tests to check llapi c api (#1614)

* MOD-16366 LLAPI flow tests

* remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_data_from_log`

* remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_data_from_log`

* fail if module not available

* fixes

* CR

* .

* CR

* MOD-16514 - fix bootstrap & build for al os (#1612)

* alma8 +rhel8+rhel9+bionic +focal passes

* fix for alpine

* fix for bionic

* fix

* fix mariner

* fix bionic bootstrap

* fix bionic

* fix bionic

* fi bionic

* fix bionic

* install aws cli for json

* bionic fix

* fix bionic

* fix for focal

* fix for focak

* fix for bionic & focal &mariner&alpine

* apply fixes

* fix remarks

* fix for alpine

* try another methood

* ci: source $HOME/.cargo/env in flow-clippy so cargo is on PATH

Match flow-linter.yml; getrust.sh now installs Rust user-scoped, so later
Actions steps don't see cargo without sourcing the env.

* CI was failing because getrust.sh ran twice. install_script.sh already
invokes it from the repo root (works), but the workflow then called
./getrust.sh sudo again from working-directory: .install — where
rust-toolchain.toml doesn't exist, so its `sed rust-toolchain.toml` errored
with "No such file or directory" (exit 2).

Removed the redundant ./getrust.sh line from flow-linter.yml and
flow-clippy.yml; install_script.sh handles Rust install on its own.

* ci(macos): add rust-toolchain.toml to sparse checkout

The macOS "Deps checkout" fetches only .install and test requirements, then
runs install_script.sh -> getrust.sh, which reads rust-toolchain.toml from
the repo root to resolve the pinned toolchain. That file wasn't in the sparse
list, so getrust failed with "sed: rust-toolchain.toml: No such file or
directory". Add it to the sparse-checkout.

* MOD-16300 perf(json_path): materialize filter literals once per query (#1615)

* MOD-16300 perf(json_path): materialize filter literals once per query

* simplify

* CR + Reuse cache in whole query

* MOD-16608 Bump ijson(reduce object memory) (#1617)

* MOD-16608 Bump ijson(reduce object memory)

* clippy

* fix memory test

* MOD-16274 | MOD-16275 add size/sizeof and empty operators on object (#1618)

* MOD-16685 Add RedisJSON API to open from RedisModuleKey (#1619)

* MOD-16685 Add RedisJSON API to open from RedisModuleKey

Add a RedisJSON shared API V8 entry that opens a JSON root from an
already-open RedisModuleKey handle. This lets consumers such as RediSearch
reuse an existing key handle instead of manually checking isJSON and calling
RedisModule_ModuleTypeGetValue.

Update the RediSearch RedisJSON API header copy and add LLAPI coverage for the
new openKeyFromHandle path.

* use Imanager to get value for json

* fix clippy

* rename functions

* fix compilation

* MOD-16872 make `apply_updates` return the current status of updates (#1621)

* add docker image managment to json (#1622)

* Add `AGENTS.md` and `CLAUDE.md`

* ignore AGENS.MD in spellcheck

* ignore CLAUDE.MD in spellcheck

* [MOD-17021] Add getWithPath LLAPI to evaluate a pre-compiled JSONPath (#1623)

* MOD-16899: add getWithPath LLAPI to evaluate a pre-compiled JSONPath

Adds a V9 RedisJSON C API entry getWithPath(json, JSONPath) that evaluates an already-compiled path (from pathParse) instead of a path string, skipping the per-call pest compilation. Callers that resolve the same path across many documents (e.g. RediSearch FT.AGGREGATE LOAD) can compile once and reuse the handle.

- c_api.rs: json_api_get_with_path + exported JSONAPI_getWithPath, struct/initializer entry, REDIS_JSONAPI_LATEST_API_VER 8->9; parity unit test (getWithPath == get).

- include/rejson_api.h: getWithPath declaration + LATEST_API_VER bump. lib.rs: register the entrypoint.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* MOD-16899: add LLAPI flow test for getWithPath

Extend the llapi_test_module consumer with LLAPI.OPEN_GET_WITH_PATH (pathParse + getWithPath, via an open_and_get_with_path helper mirroring open_and_get, sharing reply_nodes_as_json with OPEN_GET) and assert in test_llapi.py that it matches LLAPI.OPEN_GET, plus missing-key / bad-path / projection error cases.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* getWithPath: reject projections at runtime like json_api_get

Replace the debug_assert with 'if query.is_projection() { return null(); }' so a projection path is handled identically to the string-based json_api_get in all builds (not just debug), and defensively at the FFI boundary. Add a unit test passing a compiled projection Query directly.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* getWithPath: trim projection comments

Drop the self-explanatory test doc comment and shorten the guard comment to a one-liner referencing json_api_get.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* getWithPath: drop json_api_get reference from projection guard comment

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>

* MOD-16952 - enhance bootstrap (add list and dry-run arg) (#1624)

* enhance bootstrap - add check-deps

* write list to afile

* add optional deps

* add another optional deps

* add another optional deps

* add versioning managment

* rename command to list

* renme to list

* add dry run

* fix colors

* fix missing uv

* remove min cmake version

* fix remarks

* add the retry mechanizm to json as well

* fix remarks

* fix remarks

* add _sh so we can have the full bootstrap output

* always return to the workspace dir

* make single copy paste install all

* fix alma8

* fix bad dry-run print

* gaurd tool-set version 11

* fix curl minimal

* remove centos-release-scl for amazonlinux2

* fix macos env

* fix(bootstrap): make sudo a no-op on root containers without a sudo binary

The install scripts run privileged steps via literal `sudo` inside `_sh`
command strings (e.g. `sudo ln -sf ...`, `| sudo tee`, `&& sudo make install`).
On a slim Docker image that runs install_script.sh directly as root with no
`sudo` package installed (e.g. RedisTimeSeries' amazonlinux2 CI), those steps
fail with `sudo: command not found` (exit 127), aborting the whole bootstrap.

Add a root-only pass-through in pm.sh/deps_lib.sh: when running as root and no
real `sudo` binary exists, define `sudo()` to run its arguments directly. When
not root, a missing sudo stays a genuine error and is left unmasked.

* version update

* Revert "[MOD-17021] Add getWithPath LLAPI to evaluate a pre-compiled JSONPath (#1623)"

This reverts commit 628013e.

---------

Co-authored-by: Tom Gabsow <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Aviv David <[email protected]>
Co-authored-by: avivdavid23 <[email protected]>
Co-authored-by: Itzikvaknin <[email protected]>
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