aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-08-19 15:07:26 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-08-19 15:07:29 +0200
commitb6a8e68b4e11be3aa5ceff8c483594f8e576faaf (patch)
treedaa0842dbf04f94274aa6e611db953803c72fb20
parentb784ab10f555b043c77a2356faff492c35a3404c (diff)
parentf52a72af569526f319d9f1480eb473b9570125c3 (diff)
downloadbitcoin-b6a8e68b4e11be3aa5ceff8c483594f8e576faaf.tar.xz
Merge bitcoin/bitcoin#22710: ci: Invalidate depends caches when sources have been changed
f52a72af569526f319d9f1480eb473b9570125c3 ci: Invalidate depends caches when sources have been changed (Hennadii Stepanov) 939640f87ec385d08f1b04bfd7f61c80038c4565 ci: Reorder scripts to make git available before depends_sources_cache (Hennadii Stepanov) Pull request description: On master (502d22ceed1f90ed41336260f8eb428d3acaf514) 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 (502d22ceed1f90ed41336260f8eb428d3acaf514) ![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 f52a72af569526f319d9f1480eb473b9570125c3 Zero-1729: crACK f52a72af569526f319d9f1480eb473b9570125c3 Tree-SHA512: 0d14814ff308317c7c18cc725cf69055139030c207200af003872068f5567bd4b9c1f6783845d11742e314ebcc1dc5cae16aa86475376b623d921af5fcda14dd
-rw-r--r--.cirrus.yml12
1 files changed, 9 insertions, 3 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index 26bd27754f..3e2e8864ac 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -29,8 +29,7 @@ base_template: &BASE_TEMPLATE
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
-global_task_template: &GLOBAL_TASK_TEMPLATE
- << : *BASE_TEMPLATE
+task_template: &TASK_TEMPLATE
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
container:
# https://cirrus-ci.org/faq/#are-there-any-limits
@@ -41,9 +40,14 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
folder: "/tmp/ccache_dir"
depends_built_cache:
folder: "depends/built"
+ fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-list -1 HEAD ./depends)
ci_script:
- ./ci/test_run_all.sh
+global_task_template: &GLOBAL_TASK_TEMPLATE
+ << : *BASE_TEMPLATE
+ << : *TASK_TEMPLATE
+
depends_sdk_cache_template: &DEPENDS_SDK_CACHE_TEMPLATE
depends_sdk_cache:
folder: "depends/sdk-sources"
@@ -211,9 +215,11 @@ task:
task:
name: 'ARM64 Android APK [focal]'
<< : *DEPENDS_SDK_CACHE_TEMPLATE
+ << : *BASE_TEMPLATE
depends_sources_cache:
folder: "depends/sources"
- << : *GLOBAL_TASK_TEMPLATE
+ fingerprint_script: git rev-list -1 HEAD ./depends
+ << : *TASK_TEMPLATE
container:
image: ubuntu:focal
env: