Skip to content

Commit b6a8e68

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#22710: ci: Invalidate depends caches when sources have been changed
f52a72a ci: Invalidate depends caches when sources have been changed (Hennadii Stepanov) 939640f ci: Reorder scripts to make git available before depends_sources_cache (Hennadii Stepanov) Pull request description: On master (502d22c) the Cirrus CI do _not_ invalidate depends caches when their sources has been changed, i.e. source version updates, a new dependency etc. This behavior causes: - breaking CI build for Android APK (see #22708) - the cache sizes growing It is assumed that caches could be invalidated via Cirrus CI API/GUI, but it is inconvenient and it does not work as expected in all cases. The common part of `fingerprint_key`s for both `depends_sources_cache` and `depends_built_cache` is the recent commit that changes sources in the `src/depends` sub-directory. For `depends_built_cache` additionally `CIRRUS_TASK_NAME` is used to avoid sharing of the same cache between tasks with different OSes and different `DEP_OPTS`. --- The `depends_sources` cache: - in master (502d22c) ![Screenshot from 2021-08-16 11-10-17](https://user-images.githubusercontent.com/32963518/129532207-56c09e06-c8d0-4f1e-a692-f198da011b20.png) - with this PR ![Screenshot from 2021-08-16 11-10-42](https://user-images.githubusercontent.com/32963518/129532253-f5426814-4f58-448f-ad52-da26cc312af7.png) ACKs for top commit: MarcoFalke: cr ACK f52a72a Zero-1729: crACK f52a72a Tree-SHA512: 0d14814ff308317c7c18cc725cf69055139030c207200af003872068f5567bd4b9c1f6783845d11742e314ebcc1dc5cae16aa86475376b623d921af5fcda14dd
2 parents b784ab1 + f52a72a commit b6a8e68

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.cirrus.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ base_template: &BASE_TEMPLATE
2929
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
3030
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
3131

32-
global_task_template: &GLOBAL_TASK_TEMPLATE
33-
<< : *BASE_TEMPLATE
32+
task_template: &TASK_TEMPLATE
3433
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
3534
container:
3635
# https://cirrus-ci.org/faq/#are-there-any-limits
@@ -41,9 +40,14 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
4140
folder: "/tmp/ccache_dir"
4241
depends_built_cache:
4342
folder: "depends/built"
43+
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-list -1 HEAD ./depends)
4444
ci_script:
4545
- ./ci/test_run_all.sh
4646

47+
global_task_template: &GLOBAL_TASK_TEMPLATE
48+
<< : *BASE_TEMPLATE
49+
<< : *TASK_TEMPLATE
50+
4751
depends_sdk_cache_template: &DEPENDS_SDK_CACHE_TEMPLATE
4852
depends_sdk_cache:
4953
folder: "depends/sdk-sources"
@@ -211,9 +215,11 @@ task:
211215
task:
212216
name: 'ARM64 Android APK [focal]'
213217
<< : *DEPENDS_SDK_CACHE_TEMPLATE
218+
<< : *BASE_TEMPLATE
214219
depends_sources_cache:
215220
folder: "depends/sources"
216-
<< : *GLOBAL_TASK_TEMPLATE
221+
fingerprint_script: git rev-list -1 HEAD ./depends
222+
<< : *TASK_TEMPLATE
217223
container:
218224
image: ubuntu:focal
219225
env:

0 commit comments

Comments
 (0)