fix(ci): heal failed target caches
All checks were successful
CI / rust-skia (Rust only) (push) Successful in 2m41s
CI / required (push) Successful in 8m14s

This commit is contained in:
2026-08-16 10:19:31 +00:00
parent e970bdecf6
commit 1254cf24e1
3 changed files with 10 additions and 15 deletions

View File

@@ -91,7 +91,6 @@ jobs:
if test -n "$previous_target"; then
cp -al "$previous_target" "$cargo_target"
rm -f -- "$cargo_target/.metacrate-ready"
touch "$cargo_target/.metacrate-cloned"
else
mkdir -p "$cargo_target"
fi
@@ -102,7 +101,6 @@ jobs:
fi
done < <(find "$cargo_cache_root" -mindepth 1 -maxdepth 1 -type d -name 'target-rust-1.97.1-aarch64-unknown-linux-gnu-*' -print0)
) 9>"$cargo_cache_root/required-target.lock"
test -f "$cargo_target/.metacrate-cloned" && cloned_target=true || cloned_target=false
test -f "$cargo_target/.metacrate-ready" && cargo_hit=true || cargo_hit=false
test -d "$CARGO_HOME/registry/cache" && dependency_hit=true || dependency_hit=false
test -f "$openjpeg_prefix/metacrate-openjpeg.identity" && test -f "$skia_archive" && native_hit=true || native_hit=false
@@ -116,7 +114,6 @@ jobs:
echo "METACRATE_DEPENDENCY_CACHE_HIT=$dependency_hit" >> "$GITHUB_ENV"
echo "METACRATE_NATIVE_CACHE_HIT=$native_hit" >> "$GITHUB_ENV"
echo "METACRATE_TOOLS_CACHE_HIT=$tools_hit" >> "$GITHUB_ENV"
echo "METACRATE_CARGO_TARGET_CLONED=$cloned_target" >> "$GITHUB_ENV"
- name: Install the single native prerequisite set
run: |
@@ -161,9 +158,9 @@ jobs:
python3 tools/normalize_git_mtimes.py --state "$CARGO_TARGET_DIR/.metacrate-mtimes.json"
python3 tools/normalize_git_mtimes.py --state "$CARGO_TARGET_DIR/.metacrate-mtimes.json" --check
# Cargo does not fingerprint CARGO_TARGET_DIR in integration-test
# binaries. Invalidate only the relocated program integration-test
# fingerprints so CARGO_BIN_EXE_* cannot name the pruned directory.
if test "$METACRATE_CARGO_TARGET_CLONED" = true; then
# binaries. After a clone, interruption, or failed gate, invalidate
# only those fingerprints so CARGO_BIN_EXE_* cannot stay poisoned.
if test "$METACRATE_CARGO_CACHE_HIT" != true; then
fingerprint_root="$CARGO_TARGET_DIR/debug/.fingerprint"
fingerprint_list="$CARGO_TARGET_DIR/.metacrate-relocated-fingerprints"
if test -d "$fingerprint_root"; then
@@ -174,7 +171,7 @@ jobs:
rm -rf -- "$integration_fingerprint"
done < "$fingerprint_list"
fi
rm -f -- "$fingerprint_list" "$CARGO_TARGET_DIR/.metacrate-cloned"
rm -f -- "$fingerprint_list"
fi
cargo run --locked -p metacrate-ci-matrix -- required-gate --evidence artifacts/ci/required-gate.json
touch "$CARGO_TARGET_DIR/.metacrate-ready"