Skip to content

Commit 588fb97

Browse files
authored
ci: pin a Rust nightly version (#6513)
Should prevent accidental breaking of the CI.
1 parent 08a333a commit 588fb97

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

.install/test_deps/common_installations.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ activate_venv() {
2020
fi
2121
}
2222

23+
# retrieve nightly version from build.sh
24+
NIGHTLY_VERSION=$(grep "NIGHTLY_VERSION=" build.sh | cut -d'=' -f2 | tr -d '"')
2325
# --allow-downgrade:
2426
# Allow `rustup` to install an older `nightly` if the latest one
2527
# is missing one of the components we need.
@@ -29,7 +31,7 @@ activate_venv() {
2931
# Required to run `cargo miri test` for UB detection
3032
# rust-src:
3133
# Required to build RedisJSON with address sanitizer
32-
rustup toolchain install nightly \
34+
rustup toolchain install $NIGHTLY_VERSION \
3335
--allow-downgrade \
3436
--component llvm-tools-preview \
3537
--component miri \
@@ -40,7 +42,7 @@ cargo install cargo-llvm-cov --locked
4042
# Make sure `miri` is fully operational before running tests with it.
4143
# See https://github.com/rust-lang/miri/blob/master/README.md#running-miri-on-ci
4244
# for more details.
43-
cargo +nightly miri setup
45+
cargo +$NIGHTLY_VERSION miri setup
4446

4547
python3 -m venv venv
4648
activate_venv

build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,11 +552,16 @@ run_rust_tests() {
552552
export RUSTFLAGS="${RUSTFLAGS:+${RUSTFLAGS} }-D warnings"
553553
fi
554554

555+
# Pin a specific working version of nightly to prevent breaking the CI because
556+
# regressions in a nightly build.
557+
# Make sure to synchronize updates across all modules: Redis and RedisJSON.
558+
NIGHTLY_VERSION="nightly-2025-07-30"
559+
555560
# Add Rust test extensions
556561
if [[ $COV == 1 ]]; then
557562
# We use the `nightly` compiler in order to include doc tests in the coverage computation.
558563
# See https://github.com/taiki-e/cargo-llvm-cov/issues/2 for more details.
559-
RUST_EXTENSIONS="+nightly llvm-cov"
564+
RUST_EXTENSIONS="+$NIGHTLY_VERSION llvm-cov"
560565
RUST_TEST_OPTIONS="
561566
--doctests
562567
--codecov
@@ -565,7 +570,7 @@ run_rust_tests() {
565570
--output-path=$BINROOT/rust_cov.info
566571
"
567572
elif [[ -n "$SAN" || "$RUN_MIRI" == "1" ]]; then # using `elif` as we shouldn't run with both
568-
RUST_EXTENSIONS="+nightly miri"
573+
RUST_EXTENSIONS="+$NIGHTLY_VERSION miri"
569574
fi
570575

571576
# Run cargo test with the appropriate filter

tests/deps/setup_rejson.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ TEST_DEPS_DIR="${ROOT}/tests/deps"
2121
JSON_MODULE_DIR="${TEST_DEPS_DIR}/RedisJSON"
2222
JSON_BIN_DIR="${BINROOT}/RedisJSON/${JSON_BRANCH}"
2323
export JSON_BIN_PATH="${JSON_BIN_DIR}/rejson.so"
24+
# Instruct RedisJSON to use the same pinned nightly version as RediSearch
25+
export RUST_GOOD_NIGHTLY=$(grep "NIGHTLY_VERSION=" ${ROOT}/build.sh | cut -d'=' -f2 | tr -d '"')
2426

2527
# Check if REJSON_PATH is set externally
2628
if [ -n "$REJSON_PATH" ]; then

0 commit comments

Comments
 (0)