Skip to content

Commit 6df1a44

Browse files
sylvestreRenjiSann
authored andcommitted
remove %p from LLVM_PROFILE_FILE
1 parent dc469f7 commit 6df1a44

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

.github/workflows/CICD.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ jobs:
10091009
- uses: dtolnay/rust-toolchain@master
10101010
with:
10111011
toolchain: ${{ matrix.job.toolchain }}
1012-
components: rustfmt
1012+
components: llvm-tools-preview
10131013
- uses: taiki-e/install-action@nextest
10141014
- uses: taiki-e/install-action@grcov
10151015
- uses: Swatinem/rust-cache@v2
@@ -1070,24 +1070,32 @@ jobs:
10701070
run: |
10711071
## Dependent VARs setup
10721072
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
1073+
df -h .
1074+
df -h ${{ github.workspace }}
10731075
# * determine sub-crate utility list
10741076
UTILITY_LIST="$(./util/show-utils.sh ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }})"
10751077
CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo -n "-puu_${u} "; done;)"
1078+
df -h
10761079
outputs CARGO_UTILITY_LIST_OPTIONS
10771080
- name: Test
1078-
run: cargo nextest run --profile ci --hide-progress-bar ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
1081+
run: |
1082+
df -h
1083+
cargo nextest run --profile ci --hide-progress-bar ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
1084+
df -h
10791085
env:
10801086
RUSTC_WRAPPER: ""
1081-
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
1087+
RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
10821088
RUSTDOCFLAGS: "-Cpanic=abort"
10831089
RUST_BACKTRACE: "1"
1090+
LLVM_PROFILE_FILE: "${{ github.workspace }}/build/coverage-%m.profraw"
10841091
# RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
10851092
- name: Test individual utilities
10861093
run: cargo nextest run --profile ci --hide-progress-bar ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
10871094
env:
10881095
RUSTC_WRAPPER: ""
1089-
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
1096+
RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
10901097
RUSTDOCFLAGS: "-Cpanic=abort"
1098+
LLVM_PROFILE_FILE: "${{ github.workspace }}/build/coverage-%m.profraw"
10911099
RUST_BACKTRACE: "1"
10921100
# RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }}
10931101
- name: Generate coverage data (via `grcov`)
@@ -1097,13 +1105,14 @@ jobs:
10971105
## Generate coverage data
10981106
COVERAGE_REPORT_DIR="target/debug"
10991107
COVERAGE_REPORT_FILE="${COVERAGE_REPORT_DIR}/lcov.info"
1100-
# GRCOV_IGNORE_OPTION='--ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*"' ## `grcov` ignores these params when passed as an environment variable (why?)
1101-
# GRCOV_EXCLUDE_OPTION='--excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"' ## `grcov` ignores these params when passed as an environment variable (why?)
11021108
mkdir -p "${COVERAGE_REPORT_DIR}"
1103-
# display coverage files
1104-
grcov . --output-type files --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()" | sort --unique
1109+
# display coverage files (for debug)
1110+
du -h ${{ github.workspace }}/build/
1111+
grcov --version
1112+
ls -al target/
1113+
ls -al target/debug
11051114
# generate coverage report
1106-
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
1115+
grcov ${{ github.workspace }}/build/ --output-type lcov -b target/debug/ --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
11071116
echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
11081117
- name: Upload coverage results (to Codecov.io)
11091118
uses: codecov/codecov-action@v4

.github/workflows/GnuTests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ jobs:
407407
locale -a
408408
- name: Build binaries
409409
env:
410-
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
410+
RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
411411
RUSTDOCFLAGS: "-Cpanic=abort"
412+
LLVM_PROFILE_FILE: ${{ github.workspace }}/build/profile-%m.profraw
412413
run: |
413414
## Build binaries
414415
cd uutils
@@ -425,9 +426,9 @@ jobs:
425426
mkdir -p "${COVERAGE_REPORT_DIR}"
426427
sudo chown -R "$(whoami)" "${COVERAGE_REPORT_DIR}"
427428
# display coverage files
428-
grcov . --output-type files --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()" | sort --unique
429+
grcov ${{ github.workspace }}/build/profile-%m.profraw --output-type files --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()" | sort --unique
429430
# generate coverage report
430-
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
431+
grcov ${{ github.workspace }}/build/profile-%m.profraw --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
431432
echo "report=${COVERAGE_REPORT_FILE}" >> $GITHUB_OUTPUT
432433
- name: Upload coverage results (to Codecov.io)
433434
uses: codecov/codecov-action@v4

0 commit comments

Comments
 (0)