From 40d45e58be2be22968b71386c8c9d536abaea97c Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Mon, 4 Nov 2024 17:25:20 +0100 Subject: [PATCH] ensure correct toolchain --- .github/workflows/cargo_llvm_cov.yml | 14 +++----------- scripts/simtest/simtest-cov.sh | 6 +++--- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cargo_llvm_cov.yml b/.github/workflows/cargo_llvm_cov.yml index c9ce8297537..ff6b6a0a380 100644 --- a/.github/workflows/cargo_llvm_cov.yml +++ b/.github/workflows/cargo_llvm_cov.yml @@ -56,8 +56,9 @@ jobs: - name: Generate code coverage report (nextest.info) run: | - rustup component add llvm-tools --toolchain stable - LLVM_PROFDATA="$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" + TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') + rustup component add llvm-tools --toolchain "$TOOLCHAIN" + LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" if [[ -x "$LLVM_PROFDATA" ]]; then $LLVM_PROFDATA --version else @@ -84,15 +85,6 @@ jobs: exit 1 fi - - name: Upload .profraw dir (temp) - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 - if: always() - with: - name: llvm-cov-target - path: ./target/llvm-cov-target - if-no-files-found: error - retention-days: 1 - - name: Generate code coverage report (simtest.info) run: | git clean -fd diff --git a/scripts/simtest/simtest-cov.sh b/scripts/simtest/simtest-cov.sh index c002ce757cb..8d4939fb7d2 100755 --- a/scripts/simtest/simtest-cov.sh +++ b/scripts/simtest/simtest-cov.sh @@ -16,13 +16,13 @@ git apply ./scripts/simtest/config-patch root_dir=$(git rev-parse --show-toplevel) export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" -# MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --branch --lcov --output-path simtest.info \ -# nextest -vv --cargo-profile simulator +TOOLCHAIN=$(rustup show active-toolchain | awk '{print $1}') +LLVM_PROFDATA="$HOME/.rustup/toolchains/$TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" MSIM_WATCHDOG_TIMEOUT_MS=60000 MSIM_TEST_SEED=1 cargo llvm-cov --ignore-run-fail --no-report nextest -vv --cargo-profile simulator find target/llvm-cov-target -name '*.profraw' | while read file; do - if ! "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata" show "$file" > /dev/null 2>&1; then + if ! "$LLVM_PROFDATA" show "$file" > /dev/null 2>&1; then echo "Removing corrupted file: $file" rm "$file" fi