@@ -50,16 +50,15 @@ build_task:
50
50
# all PRs & branches will share caches with other PRs and branches
51
51
# for a given $DEST_BRANCH and vX value. Adjust vX if cache schema
52
52
# changes.
53
- fingerprint_key : " cargo_v2_ ${DEST_BRANCH}_amd64"
53
+ fingerprint_script : echo -e "cargo_v3_ ${DEST_BRANCH}_amd64\n---\n$(<Cargo.lock)\n---\n$(<Cargo.toml)"yy
54
54
# Required to be set explicitly since fingerprint_key is also set
55
55
reupload_on_changes : true
56
56
targets_cache : &targets_cache
57
- # Similar to cargo_cache, but holds the actual compiled artifacts. This must
58
- # be scoped similar to bin_cache to avoid binary pollution across cache
59
- # contexts. For example, two PRs that happen to coincidentally change
60
- # and use cache. Adjust vX if cache schema changes.
57
+ # Similar to cargo_cache, but holds the actual compiled dependent artifacts.
58
+ # This should be scoped to a hash of the dependency-metadata lock file.
59
+ # Cirrus-CI will automatically use separate caches for PRs and branches.
61
60
folder : " $CARGO_TARGET_DIR"
62
- fingerprint_key : " targets_v2_ ${CIRRUS_TAG}${DEST_BRANCH}${CIRRUS_PR}_amd64" # Cache only within same tag, branch, or PR (branch will be 'pull/#')
61
+ fingerprint_script : echo -e "targets_v3_ ${CIRRUS_TAG}${DEST_BRANCH}${CIRRUS_PR}_amd64\n---\n$(<Cargo.lock)\n---\n$(<Cargo.toml)"
63
62
reupload_on_changes : true
64
63
bin_cache : &bin_cache
65
64
# This simply prevents rebuilding bin/netavark for every subsequent task.
@@ -70,6 +69,7 @@ build_task:
70
69
reupload_on_changes : true
71
70
setup_script : &setup "$SCRIPT_BASE/setup.sh"
72
71
main_script : &main "$SCRIPT_BASE/runner.sh $CIRRUS_TASK_NAME"
72
+ cache_grooming_script : &groom bash "$SCRIPT_BASE/cache_groom.sh"
73
73
upload_caches : [ "cargo", "targets", "bin" ]
74
74
75
75
@@ -82,11 +82,15 @@ build_aarch64_task:
82
82
architecture : arm64 # CAUTION: This has to be "arm64", not "aarch64"
83
83
cargo_cache : &cargo_cache_aarch64
84
84
folder : " $CARGO_HOME"
85
- fingerprint_key : " cargo_v2_${DEST_BRANCH}_aarch64"
85
+ # N/B: Should exactly match (except for arch) line from build_task (above).
86
+ # (No, there isn't an easy way to not duplicate most of this :()
87
+ fingerprint_script : echo -e "cargo_v3_${DEST_BRANCH}_aarch64\n---\n$(<Cargo.lock)\n---\n$(<Cargo.toml)"yy
86
88
reupload_on_changes : true
87
89
targets_cache : &targets_cache_aarch64
88
90
folder : " $CARGO_TARGET_DIR"
89
- fingerprint_key : " targets_v2_${CIRRUS_TAG}${DEST_BRANCH}${CIRRUS_PR}_aarch64" # Cache only within same tag, branch, or PR (branch will be 'pull/#')
91
+ # N/B: Should exactly match (except for arch) line from build_task (above).
92
+ # (No, there isn't an easy way to not duplicate most of this :()
93
+ fingerprint_script : echo -e "targets_v3_${CIRRUS_TAG}${DEST_BRANCH}${CIRRUS_PR}_aarch64\n---\n$(<Cargo.lock)\n---\n$(<Cargo.toml)"
90
94
reupload_on_changes : true
91
95
bin_cache : &bin_cache_aarch64
92
96
# This simply prevents rebuilding bin/netavark for every subsequent task.
@@ -95,6 +99,7 @@ build_aarch64_task:
95
99
reupload_on_changes : true
96
100
setup_script : *setup
97
101
main_script : *main
102
+ cache_grooming_script : *groom
98
103
upload_caches : [ "cargo", "targets", "bin" ]
99
104
# Downstream CI needs the aarch64 binaries from this CI system.
100
105
# However, we don't want to confuse architectures.
0 commit comments