Skip to content

Commit

Permalink
Prevent 'functions have mismatched data' warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Sep 3, 2024
1 parent 3144988 commit f39219f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/capi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ jobs:
- uses: actions/checkout@v4

- name: Install PineAPPL's C API
env:
# `-C link-dead-code` is needed to prevent 'warning: XX functions have mismatched data' warnings
RUSTFLAGS: '-Cinstrument-coverage -Clink-dead-code'
run: |
export RUSTFLAGS="-Cinstrument-coverage"
cargo cinstall --verbose --prefix=/usr/local/ --manifest-path pineappl_capi/Cargo.toml
ldconfig
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
rustup component add llvm-tools
- name: Test
env:
RUSTFLAGS: '-Cinstrument-coverage'
# `-C link-dead-code` is needed to prevent 'warning: XX functions have mismatched data' warnings
RUSTFLAGS: '-Cinstrument-coverage -Clink-dead-code'
run: |
cd pineappl_py
python -m venv env
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ jobs:
- name: Run tests
env:
RUSTFLAGS: '-Cinstrument-coverage'
# `-C link-dead-code` is needed to prevent 'warning: XX functions have mismatched data' warnings
RUSTFLAGS: '-Cinstrument-coverage -Clink-dead-code'
run: |
# we need stderr, but we can't run test twice because it'll regenerate/modify the binaries which interferes with `llvm-cov`
cargo test --features=applgrid,evolve,fastnlo,fktable --no-fail-fast 2> >(tee stderr 1>&2)
Expand Down
3 changes: 2 additions & 1 deletion maintainer/generate-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export CARGO_TARGET_DIR="$(mktemp -d)"
# relative paths sometimes don't work, so use an absolute path
dir="${CARGO_TARGET_DIR}"/debug/doctestbins

export RUSTFLAGS="-Cinstrument-coverage"
# `-C link-dead-code` is needed to prevent 'warning: XX functions have mismatched data' warnings
export RUSTFLAGS="-Cinstrument-coverage -Clink-dead-code"
export RUSTDOCFLAGS="-Cinstrument-coverage -Z unstable-options --persist-doctests ${dir}"

# -Z doctest-in-workspace is enabled by default starting from 1.72.0
Expand Down

0 comments on commit f39219f

Please sign in to comment.