Closed rhysd closed 3 years ago
So "-Wl,--as-needed"
conflicts with -C link-dead-code
https://github.com/rust-lang/rust/issues/64685 I'll try to push this issue along some how as it's quite an old one and a big pain point with coverage on linux. Does tarpaulin work for you at all because I'd expect it to fail if the cargo build afterwards fails?
I'm guessing here there's a further issue with incremental building and the RUSTFLAGS changing not rebuilding dependencies when they should be which should probably be raised on rustc. Or just general confusion with the artefacts from a build that failed with linker issues then being linked against.
Thank you for the quick clarification. I did not catch the Rust issue. I'll subscribe the issue. And meanwhile I will put cargo clean
to clean up built things by tarpaulin for avoiding succeeding cargo build
failure.
Does tarpaulin work for you at all because I'd expect it to fail if the cargo build afterwards fails?
Yes, tarpaulin itself works for me.
Good to know it works :smile: I'll just close this as it seems the questions answered and you're now following a better issue for updates :smile:
I'm using tarpaulin on GitHub Actions Linux worker. I'm facing the following mysterious link error.
cargo build
caused the link error only when running aftercargo tarpaulin
.Of course removing
cargo tarpaulin
line did not cause this issue.And running
cargo clean
just after `cargo tarpaulin also did not cause this issue.Link error:
https://github.com/rhysd/git-brws/runs/1386448015?check_suite_focus=true#step:7:91
Repro
I tried to reproduce this issue with minimal Rust project just after running
cargo init
. But it did not reproduce. I guess some dependency of my project caused this issue, but I could not know which crate caused it from the link error. Instead, I prepared a branch to reproduce this issue with my personal project which could cause this issue:https://github.com/rhysd/git-brws/tree/cargo-tarpaulin-issue
It contains my project and the minimal CI workflow to cause this issue.
How to run the workflow:
cargo-tarpaulin-issue
, commit something and push it to your forkEnvironment