GitLab CI: Set ccache's base_dir for RPM builds.

GitLab CI builds RPMs in a different directory for each pipeline
($CI_PROJECT_DIR/build/packaging/rpm/BUILD/wireshark-<version>), so set
base_dir to the build directory and enable absolute_paths_in_stderr.

Fix our cache directory max sizes as well.
This commit is contained in:
Gerald Combs 2022-10-20 13:21:10 -07:00
parent f5f561d5c7
commit a30774d8c1
1 changed files with 5 additions and 3 deletions

View File

@ -141,10 +141,12 @@ variables:
paths:
- ccache/
before_script:
# It might make sense to set "GIT_STRATEGY: none" and build from
# the tarball.
- BUILD_DIR=$(ls wireshark-*.tar.*)
- BUILD_DIR=${BUILD_DIR%%.tar.*}
- mkdir -p ccache
- ccache --show-stats
- ccache --set-config absolute_paths_in_stderr=true
- ccache --set-config base_dir="$CI_PROJECT_DIR/build/packaging/rpm/BUILD/$BUILD_DIR"
- git config --global user.email "you@example.com"
- git config --global user.name "Your Name"
- mkdir build
@ -154,7 +156,7 @@ variables:
after_script:
# The cache should be large enough to be useful but it shouldn't take
# too long to restore+save each run.
- ccache --max-size $( du --summarize --block-size=1M "$CI_PROJECT_DIR/build" | awk '{printf ("%dM", $1 * 1.5)}' )
- ccache --max-size $( du --summarize --block-size=1M $CI_PROJECT_DIR/build/packaging/rpm/BUILD/wireshark-* | awk '{printf ("%dM", $1 * 1.5)}' )
artifacts:
paths:
- build/packaging/rpm/RPMS