mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Manually prune CI ccache.
Since ccache in Cirrus currently does not preserve timestamps the timestamp-based cache pruning implemented by ccache likely would just remove random files. To work around this, this patch implements a manual pruning step. This step runs after the build so that at least the files used in the build should have their timestamps updated. We can then force eviction of some of the unused files from the cache by cleaning the cache with a size less than the maximum cache size.
This commit is contained in:
parent
117d25dcd8
commit
b3cd1c5215
1 changed files with 8 additions and 0 deletions
|
@ -113,6 +113,9 @@ ci_template: &CI_TEMPLATE
|
||||||
type: text/html
|
type: text/html
|
||||||
cache_statistics_script:
|
cache_statistics_script:
|
||||||
ccache --show-stats
|
ccache --show-stats
|
||||||
|
ccache_prune_script:
|
||||||
|
# Evit some of the cached build artifacts not used in this build.
|
||||||
|
CCACHE_MAXSIZE=${ZEEK_CCACHE_PRUNE_SIZE} ccache -c
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CIRRUS_WORKING_DIR: /zeek
|
CIRRUS_WORKING_DIR: /zeek
|
||||||
|
@ -148,6 +151,11 @@ env:
|
||||||
CCACHE_MAXSIZE: 1000M
|
CCACHE_MAXSIZE: 1000M
|
||||||
CCACHE_MAXFILES: 20000
|
CCACHE_MAXFILES: 20000
|
||||||
|
|
||||||
|
# Size to use when manually pruning the cache below. This size should be
|
||||||
|
# roughly `CCACHE_MAXSIZE - <build_size>`. This works around
|
||||||
|
# https://github.com/cirruslabs/cirrus-ci-agent/issues/277.
|
||||||
|
ZEEK_CCACHE_PRUNE_SIZE: 700M
|
||||||
|
|
||||||
# Increase this to flush the ccache cache. Mainly useful until there's
|
# Increase this to flush the ccache cache. Mainly useful until there's
|
||||||
# a solution for the mtime pruning above.
|
# a solution for the mtime pruning above.
|
||||||
ZEEK_CCACHE_EPOCH: 2
|
ZEEK_CCACHE_EPOCH: 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue