fix(ci): heal failed target caches
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
},
|
||||
{
|
||||
"path": ".gitea/workflows/ci.yml",
|
||||
"bytes": 9946,
|
||||
"sha256": "e32a0e2bc2240e6033babd106fbc13decd17a70df075ceb1d60dce53c0e23a34"
|
||||
"bytes": 9673,
|
||||
"sha256": "5be87bcc41f0301657631a284a1ebeb4f2e6e82ada4510e9e658e9cb39884695"
|
||||
},
|
||||
{
|
||||
"path": ".gitea/workflows/release.yml",
|
||||
@@ -2637,8 +2637,8 @@
|
||||
},
|
||||
{
|
||||
"path": "tools/ci-matrix/src/ci_gate.rs",
|
||||
"bytes": 45862,
|
||||
"sha256": "89eff04b27bb60847714632ec1df004b05ea6f31da2b634a27396ee0a79473b4"
|
||||
"bytes": 45710,
|
||||
"sha256": "c51f45614fa8e018fe819cada93147976e5bd9134af27aa55c1ca598dd60388c"
|
||||
},
|
||||
{
|
||||
"path": "tools/ci-matrix/src/dependency.rs",
|
||||
|
||||
@@ -1047,22 +1047,20 @@ fn validate_workflows(root: &Path, manifest: &CoverageManifest) -> Result<()> {
|
||||
"flock --exclusive 9",
|
||||
"rm -f -- \"$cargo_target/.metacrate-ready\"",
|
||||
"rm -f -- \"$CARGO_TARGET_DIR/.metacrate-ready\"",
|
||||
"touch \"$cargo_target/.metacrate-cloned\"",
|
||||
"stale_target",
|
||||
"python3 tools/normalize_git_mtimes.py --state",
|
||||
".metacrate-mtimes.json\" --check",
|
||||
"'**/Cargo.toml'",
|
||||
"METACRATE_DEPENDENCY_CACHE_HIT",
|
||||
"cp -al \"$previous_target\" \"$cargo_target\"",
|
||||
"METACRATE_CARGO_TARGET_CLONED=$cloned_target",
|
||||
"if test \"$METACRATE_CARGO_TARGET_CLONED\" = true",
|
||||
"if test \"$METACRATE_CARGO_CACHE_HIT\" != true",
|
||||
"fingerprint_root=\"$CARGO_TARGET_DIR/debug/.fingerprint\"",
|
||||
"-path '*/libremetaverse-programs-*/*'",
|
||||
"-name 'test-integration-test-*'",
|
||||
"-printf '%h\\0' > \"$fingerprint_list\"",
|
||||
"rm -rf -- \"$integration_fingerprint\"",
|
||||
"done < \"$fingerprint_list\"",
|
||||
"rm -f -- \"$fingerprint_list\" \"$CARGO_TARGET_DIR/.metacrate-cloned\"",
|
||||
"rm -f -- \"$fingerprint_list\"",
|
||||
] {
|
||||
if !required.contains(marker) {
|
||||
return Err(MatrixError::new(format!(
|
||||
|
||||
Reference in New Issue
Block a user