From 0c0b606044fe65987c0c7db9727f32e93b37b204 Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Wed, 30 Aug 2023 09:29:08 +0100 Subject: [PATCH] Replace cargo-kcov with llvm-cov cargo-kcov is no longer working as of rust toolchain version 1.71.0, as it can no longer discover test executables. This is due to cargo changing its verbose stdout printing to include the qualified path to rustc, which causes cargo-kcov's string matching to fail. See also https://github.com/kennytm/cargo-kcov/issues/54 cargo-kcov has had its last commit in 2019, so replace it with cargo-llvm-cov, which is actively maintained, and written for rust. Signed-off-by: Patrick Roy --- build_container.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_container.sh b/build_container.sh index 25fa65a..8520f5f 100755 --- a/build_container.sh +++ b/build_container.sh @@ -24,18 +24,18 @@ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAI # Use `git` executable to avoid OOM on arm64: # https://github.com/rust-lang/cargo/issues/10583#issuecomment-1129997984 cargo --config "net.git-fetch-with-cli = true" \ - install cargo-kcov critcmp cargo-audit cargo-fuzz + install critcmp cargo-audit cargo-fuzz rm -rf /root/.cargo/registry/ # Install nightly (needed for fuzzing) rustup install --profile=minimal nightly rustup component add miri rust-src --toolchain nightly +rustup component add llvm-tools-preview # needed for coverage # Install other rust targets. rustup target add $(uname -m)-unknown-linux-musl -# Install kcov. -cargo kcov --print-install-kcov-sh | sh +cargo install cargo-llvm-cov # Install libgpiod (required by vhost-device crate) pushd /opt