summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2023-04-24 15:10:57 -0600
committerFederico Mena Quintero <federico@gnome.org>2023-04-24 15:17:19 -0600
commit43051221275a35c5c4f6d6fcaf4f654a03e1e171 (patch)
treef8be427d88a3abcd7106266601acbaed1a5ffb2f
parent499a92b06c348c43a3ba080c056d8be76c2941d7 (diff)
downloadlibrsvg-43051221275a35c5c4f6d6fcaf4f654a03e1e171.tar.gz
ci/build-with-coverage.sh: Adjust for clang 16
With clang 15.0.7, its utility libraries were in /usr/lib64/clang/15.0.7/lib/linux. However, with clang 16, they are now in /usr/lib64/clang/16/lib/linux (e.g. without minor/micro version numbers). Extract just the major version from `clang --version`. Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/822>
-rw-r--r--ci/build-with-coverage.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/ci/build-with-coverage.sh b/ci/build-with-coverage.sh
index 372802dd..9226a695 100644
--- a/ci/build-with-coverage.sh
+++ b/ci/build-with-coverage.sh
@@ -2,7 +2,16 @@
set -eux -o pipefail
-clang_version=$(clang --version | head -n 1 | cut -d' ' -f 3)
+clang_version=$(clang --version | head -n 1 | cut -d' ' -f 3 | cut -d'.' -f 1)
+clang_libraries_path="/usr/lib64/clang/$clang_version/lib/linux"
+clang_profile_lib="clang_rt.profile-x86_64"
+
+if [ ! -d $clang_libraries_path ]
+then
+ echo "Expected clang libraries (for $clang_profile_lib) to be in $clang_libraries_path"
+ echo "but that directory does not exist. Please adjust the build-with-coverage.sh script."
+ exit 1
+fi
# Mixed gcc and Rust/LLVM coverage for the C API tests:
# https://searchfox.org/mozilla-central/source/browser/config/mozconfigs/linux64/code-coverage#15
@@ -11,8 +20,8 @@ export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
# RUSTFLAGS: "-Cinstrument-coverage"
export RUSTDOCFLAGS="-Cinstrument-coverage"
export LLVM_PROFILE_FILE="$(pwd)/coverage-profiles/coverage-%p-%m.profraw"
-export LDFLAGS="--coverage -L/usr/lib64/clang/$clang_version/lib/linux"
-export LIBS="-lclang_rt.profile-x86_64"
+export LDFLAGS="--coverage -L$clang_libraries_path"
+export LIBS="-l$clang_profile_lib"
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
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off"