Skip to content

Commit cc71b2a

Browse files
committed
use correct llvm path for coverage test
1 parent 351dfb9 commit cc71b2a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ci/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ RUN \
7070
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh -s -- --no-modify-path --profile minimal --default-toolchain $RUST_VERSION -y && \
7171
rustup component add rustfmt && \
7272
rustup component add clippy && \
73-
rustup component add llvm-tools-preview && \
7473
rustup install $RUST_NIGHTLY_VERSION && \
7574
rustup component add clippy --toolchain=$RUST_NIGHTLY_VERSION && \
7675
rustup component add rustfmt --toolchain=$RUST_NIGHTLY_VERSION && \
7776
rustup component add miri --toolchain=$RUST_NIGHTLY_VERSION && \
77+
rustup component add llvm-tools-preview --toolchain=$RUST_NIGHTLY_VERSION && \
7878
rustup target add wasm32-unknown-unknown && \
7979
cargo install cargo-audit && \
8080
cargo install cargo-hack && \

scripts/coverage.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ fi
2828
# shellcheck source=ci/rust-version.sh
2929
source "$here/../ci/rust-version.sh" nightly
3030

31+
# Check llvm path
32+
llvm_profdata="$(find "$(rustc +"$rust_nightly" --print sysroot)" -name llvm-profdata)"
33+
if [ -z "$llvm_profdata" ]; then
34+
echo "Error: couldn't find llvm-profdata. Try installing the llvm-tools component with \`rustup component add llvm-tools-preview --toolchain=$rust_nightly\`"
35+
exit 1
36+
fi
37+
llvm_path="$(dirname "$llvm_profdata")"
38+
3139
# get commit hash. it will be used to name output folder
3240
if [ -z "$COMMIT_HASH" ]; then
3341
COMMIT_HASH=$(git rev-parse --short=9 HEAD)
@@ -66,6 +74,7 @@ grcov_common_args=(
6674
--source-dir "$here/.."
6775
--binary-path "$here/../target/cov/debug"
6876
--llvm
77+
--llvm-path "$llvm_path"
6978
--ignore \*.cargo\*
7079
--ignore \*build.rs
7180
--ignore bench-tps\*

0 commit comments

Comments
 (0)