diff --git a/.github/workflows/cache-warm.yml b/.github/workflows/cache-warm.yml index a9902fc4d..660d96b09 100644 --- a/.github/workflows/cache-warm.yml +++ b/.github/workflows/cache-warm.yml @@ -94,6 +94,9 @@ concurrency: env: CARGO_TERM_COLOR: always + # Swatinem/rust-cache hashes every RUST* variable. Keep this aligned with + # ci.yml or the writer and readers use disjoint cache keys. + RUST_BACKTRACE: 1 jobs: # Readers: test-and-lint, test-ilm-integration-serial, build-rustfs-debug-binary, @@ -101,7 +104,7 @@ jobs: warm-ci-dev: name: Warm ci-dev runs-on: sm-standard-4 - timeout-minutes: 90 + timeout-minutes: 120 env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" steps: @@ -191,7 +194,7 @@ jobs: warm-ci-feat-rio: name: Warm ci-feat-rio runs-on: sm-standard-4 - timeout-minutes: 90 + timeout-minutes: 120 env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" steps: @@ -219,7 +222,7 @@ jobs: warm-ci-feat-proto: name: Warm ci-feat-proto runs-on: sm-standard-4 - timeout-minutes: 90 + timeout-minutes: 120 env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" steps: diff --git a/scripts/security/check_cache_save_if.sh b/scripts/security/check_cache_save_if.sh index 3e63bdc8a..27abc6545 100755 --- a/scripts/security/check_cache_save_if.sh +++ b/scripts/security/check_cache_save_if.sh @@ -64,3 +64,25 @@ if [ "$status" -ne 0 ]; then fi echo "OK: every ./.github/actions/setup call states cache-save-if explicitly" + +# rust-cache hashes every CARGO*, CC*, CFLAGS*, CXX*, CMAKE*, and RUST* +# variable that is present when the setup action runs. The dedicated writer +# and the CI readers therefore need identical workflow-level compiler env. +compiler_env() { + awk ' + /^env:[[:space:]]*$/ { in_env = 1; next } + in_env && /^[^[:space:]]/ { exit } + in_env && /^ (CARGO|CC|CFLAGS|CXX|CMAKE|RUST)[A-Z0-9_]*:/ { print } + ' "$1" | sort +} + +ci_env="$(compiler_env .github/workflows/ci.yml)" +warm_env="$(compiler_env .github/workflows/cache-warm.yml)" + +if [ "$ci_env" != "$warm_env" ]; then + echo "CI and cache-warm compiler environments differ; rust-cache keys will not match:" >&2 + diff -u <(printf '%s\n' "$ci_env") <(printf '%s\n' "$warm_env") >&2 || true + exit 1 +fi + +echo "OK: cache-warm and CI compiler environments match"