summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2022-10-25 13:08:20 -0500
committerFederico Mena Quintero <federico@gnome.org>2022-10-25 13:23:47 -0500
commit8a12243cb5ce9e32aa3bd9f7bc5ce7581d43df2d (patch)
treeceadb586fa53b8a7803977abb9c434a3a388b8f0
parent9f474ceb86832c867e099f3884a5fc0159d0d9a4 (diff)
downloadlibrsvg-bilelmoussaoui/release-gtk-rs.tar.gz
build-with-coverage.sh: Don't hardcode the clang versionbilelmoussaoui/release-gtk-rs
The recent image update bumped clang from 14.0.6 to 15.0.2, so a hardcoded path of /usr/lib64/clang/{version} stopped working. Extract the version with a little script. Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/760>
-rw-r--r--ci/build-with-coverage.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/ci/build-with-coverage.sh b/ci/build-with-coverage.sh
index 9d4dea73..134c9fde 100644
--- a/ci/build-with-coverage.sh
+++ b/ci/build-with-coverage.sh
@@ -2,6 +2,8 @@
set -eux -o pipefail
+clang_version=$(clang --version | head -n 1 | cut -d' ' -f 3)
+
# Mixed gcc and Rust/LLVM coverage for the C API tests:
# https://searchfox.org/mozilla-central/source/browser/config/mozconfigs/linux64/code-coverage#15
export CC="clang"
@@ -9,7 +11,7 @@ export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
# RUSTFLAGS: "-Cinstrument-coverage"
export RUSTDOCFLAGS="-Cinstrument-coverage"
export LLVM_PROFILE_FILE="coverage-profiles/coverage-%p-%m.profraw"
-export LDFLAGS="--coverage -L/usr/lib64/clang/14.0.6/lib/linux"
+export LDFLAGS="--coverage -L/usr/lib64/clang/$clang_version/lib/linux"
export LIBS="-lclang_rt.profile-x86_64"
export RUSTC_BOOTSTRAP="1" # hack to make -Zprofile work on the non-nightly compiler
export CARGO_INCREMENTAL="0" # -Zprofile (gcov) doesn't like incremental compilation