aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2022-10-20 21:17:25 -0700
committerGerald Combs <gerald@wireshark.org>2022-10-20 21:53:37 -0700
commit139e46898dfd4aeed90da6f0684f8e32475340c8 (patch)
tree260b7a2300987a34ccb90dda0db1d07d0b2ddf43 /.gitlab-ci.yml
parentd7c993d4afbc52306330c089fb74c6f5bebfec37 (diff)
CMake+GitLab CI: Add and use RPMBUILD_EXTRA_ARGS.
Add an RPMBUILD_EXTRA_ARGS variable to CMakeLists.txt and use it in GitLab CI to define __cmake_builddir. This should let ccache work with our RPM builds.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml17
1 files changed, 5 insertions, 12 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 16fa6d4a5d..3db159908c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -80,7 +80,7 @@ variables:
tags:
- docker
after_script:
- - for builddir in build/packaging/rpm/BUILD/wireshark-*/build build/packaging/rpm/BUILD/wireshark-* build obj-*; do [ ! -d "$builddir/run" ] || break; done
+ - for builddir in build/packaging/rpm/BUILD/wireshark-*/build build/packaging/rpm/BUILD/wireshark* build obj-*; do [ ! -d "$builddir/run" ] || break; done
- if [[ "$CI_JOB_NAME" == "build:rpm-opensuse-"* ]]; then export LD_LIBRARY_PATH=$builddir/run; fi
- if [ -f $builddir/run/tshark ]; then $builddir/run/tshark --version; fi
needs: []
@@ -141,15 +141,8 @@ variables:
paths:
- ccache/
before_script:
- - BUILD_DIR=$(ls wireshark-*.tar.*)
- - BUILD_DIR=${BUILD_DIR%%.tar.*}
- mkdir -p ccache
- ccache --show-stats
- # Not yet supported by openSUSE
- - ccache --set-config absolute_paths_in_stderr=true || true
- - ccache --set-config hash_dir=false
- - ccache --set-config base_dir="$CI_PROJECT_DIR/build/packaging/rpm/BUILD/$BUILD_DIR"
- - cat "$CCACHE_DIR/ccache.conf"
- git config --global user.email "you@example.com"
- git config --global user.name "Your Name"
- mkdir build
@@ -159,7 +152,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/packaging/rpm/BUILD/wireshark-* | 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
@@ -260,7 +253,7 @@ Fedora RPM Package:
# https://gitlab.com/gitlab-com/support-forum/issues/2790
- export FORCE_CMAKE_NINJA_NON_VERBOSE=1
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
- - cmake3 -GNinja -DENABLE_CCACHE=ON ..
+ - cmake3 -G Ninja -DENABLE_CCACHE=ON -DRPMBUILD_EXTRA_ARGS="--define;__cmake_builddir $CI_PROJECT_DIR/build/packaging/rpm/BUILD/wireshark" ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- ninja wireshark_rpm
@@ -277,7 +270,7 @@ openSUSE 15.3 RPM Package:
image: registry.gitlab.com/wireshark/wireshark-containers/opensuse-15.3-dev
script:
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
- - cmake -GNinja -DENABLE_CCACHE=ON -DUSE_qt6=OFF ..
+ - cmake -G Ninja -DENABLE_CCACHE=ON -DRPMBUILD_EXTRA_ARGS="--define;__cmake_builddir $CI_PROJECT_DIR/build/packaging/rpm/BUILD/wireshark" -DUSE_qt6=OFF ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- ninja wireshark_rpm
@@ -294,7 +287,7 @@ Rocky Linux 9 RPM Package:
image: registry.gitlab.com/wireshark/wireshark-containers/rockylinux-9-dev
script:
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
- - cmake -GNinja -DENABLE_CCACHE=ON -DUSE_qt6=OFF ..
+ - cmake -G Ninja -DENABLE_CCACHE=ON -DRPMBUILD_EXTRA_ARGS="--define;__cmake_builddir $CI_PROJECT_DIR/build/packaging/rpm/BUILD/wireshark" -DUSE_qt6=OFF ..
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
- ninja wireshark_rpm