Skip to content

Commit 918484b

Browse files
authored
Avoid non reproducible cache generation at codcov (#10926)
1 parent 2b10153 commit 918484b

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

.github/workflows/CICD.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,26 +1116,22 @@ jobs:
11161116
SCCACHE_GHA_ENABLED: "true"
11171117
RUSTC_WRAPPER: "sccache"
11181118
CARGO_INCREMENTAL: 0
1119+
RUSTC_BOOTSTRAP: 1
11191120
strategy:
11201121
fail-fast: false
11211122
matrix:
11221123
job:
1123-
- { os: ubuntu-latest , features: unix, toolchain: nightly }
1124+
- { os: ubuntu-latest , features: unix }
11241125
# FIXME: Re-enable macos code coverage
1125-
# - { os: macos-latest , features: macos, toolchain: nightly }
1126+
# - { os: macos-latest , features: macos }
11261127
# FIXME: Re-enable Code Coverage on windows, which currently fails due to "profiler_builtins". See #6686.
1127-
# - { os: windows-latest , features: windows, toolchain: nightly-x86_64-pc-windows-gnu }
1128+
# - { os: windows-latest , features: windows, toolchain: stable-x86_64-pc-windows-gnu }
11281129
steps:
11291130
- uses: actions/checkout@v6
1130-
- uses: dtolnay/rust-toolchain@master
1131-
with:
1132-
toolchain: ${{ matrix.job.toolchain }}
1133-
components: rustfmt
11341131
- uses: taiki-e/install-action@v2
11351132
with:
11361133
tool: nextest,grcov@0.8.24
11371134
- uses: Swatinem/rust-cache@v2
1138-
11391135
- name: Run sccache-cache
11401136
uses: mozilla-actions/sccache-action@v0.0.9
11411137

@@ -1149,9 +1145,6 @@ jobs:
11491145
## VARs setup
11501146
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
11511147
1152-
# toolchain
1153-
TOOLCHAIN="nightly" ## default to "nightly" toolchain (required for certain required unstable compiler flags) ## !maint: refactor when stable channel has needed support
1154-
11551148
# * specify gnu-type TOOLCHAIN for windows; `grcov` requires gnu-style code coverage data files
11561149
case ${{ matrix.job.os }} in windows-*) TOOLCHAIN="$TOOLCHAIN-x86_64-pc-windows-gnu" ;; esac;
11571150

util/build-run-test-coverage-linux.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ REPO_main_dir="$(dirname -- "${ME_dir}")"
4141
FEATURES_OPTION=${FEATURES_OPTION:-"--features=feat_os_unix"}
4242
COVERAGE_DIR=${COVERAGE_DIR:-"${REPO_main_dir}/coverage"}
4343

44-
# Find llvm-profdata in the nightly toolchain (which is used for coverage builds)
45-
LLVM_PROFDATA="$(find "$(RUSTUP_TOOLCHAIN=nightly-gnu rustc --print sysroot)" -name llvm-profdata)"
44+
# Find llvm-profdata (which is used for coverage builds)
45+
LLVM_PROFDATA="$(find "$(rustc --print sysroot)" -name llvm-profdata)"
4646
if [ -z "${LLVM_PROFDATA}" ]; then
47-
echo "Error: llvm-profdata not found. Install it with: rustup +nightly-gnu component add llvm-tools"
47+
echo "Error: llvm-profdata not found. Install it with: rustup component add llvm-tools"
4848
exit 1
4949
fi
5050

@@ -60,10 +60,10 @@ rm -rf "${REPORT_DIR}" && mkdir -p "${REPORT_DIR}"
6060
#shellcheck disable=SC2086
6161
UTIL_LIST=$("${ME_dir}"/show-utils.sh ${FEATURES_OPTION})
6262

63+
export RUSTC_BOOTSTRAP=1
6364
export CARGO_INCREMENTAL=0
6465
export RUSTFLAGS="-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
6566
export RUSTDOCFLAGS="-Cpanic=abort"
66-
export RUSTUP_TOOLCHAIN="nightly-gnu"
6767
export LLVM_PROFILE_FILE="${PROFRAW_DIR}/coverage-%4m.profraw"
6868

6969
# Disable expanded command printing for the rest of the program

0 commit comments

Comments
 (0)