-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flag panic=abort is causing build script to fail #78011
Comments
The machinery (proc-macros) used by syn are fundamentally incompatible with panic=abort. You must set the panic strategy via the Cargo profile. Unfortunately RUSTFLAGS are opaque to Cargo, so it has no knowledge of what you are trying to do. There are several issues for tracking giving more flexibility to setting flags (like rust-lang/cargo#6375). However, in this case, you should be using the profile, since Cargo needs to know about the panic strategy. |
Although I'm not sure if this is specifically relevant to unwinding (without looking at the source), I'll still label it to be something related to RT |
Thank you @ehuss, let me explain purpose - I'm setting this flag for coverage reporting as it is adviced in grcov crate docs. I guess to workaround this issue if I got it right what you suggesting is to create temporary Just found a similar ticket #72609 . Should I close this one too in regards to the RUSTFLAGS tickets which you mentioned? |
Thank you @ehuss , specifying options via Cargo has worked! but I also used a cargo feature For anyone facing similar issue a following extension to my workspace's
Then I am able to collect code coverage metrics with a following command: export RUSTFLAGS="-Zprofile"
cargo test -p $pkg --lib --all-features --profile=coverage -Z unstable-options
# and collect coverage metrics respectively
grcov ./target/coverage/ -s . -t lcov --llvm --branch --ignore-not-existing --ignore "cli*" --ignore "*test*" --ignore "target/*" --ignore "*migrations*" --excl-start '#\[cfg\(test\)\]' --excl-stop '^}' -o $coverage_report Closing this issue as I also outlined solution in grcov crate. |
Cargo doesn't fully pay attention to the RUSTFLAGS variable. As such, to pass appropriate flags to rustc, Cargo uses a profile. We thus create a profile specifically for generating code coverage and updating the code coverage docs accordingly. See rust-lang/rust#78011. Closes #3553.
Cargo doesn't fully pay attention to the RUSTFLAGS variable. As such, to pass appropriate flags to rustc, Cargo uses a profile. We thus create a profile specifically for generating code coverage and updating the code coverage docs accordingly. See rust-lang/rust#78011. Closes build-trust#3553.
Instruction to reproduce:
RUSTFLAGS="-Cpanic=abort" cargo +nightly build --verbose
I'm submitting it here as it does not panicing nor failing without
panic=abort
flag, all compiles good.This issue reproduces for me on
nightly-2020-07-07
as well as latestrustc 1.49.0-nightly (dd7fc54eb 2020-10-15)
I initially thought that it is #70148 though realized it was already fixed long time ago and this issue reproduces with
-Cpanic=abort
.I tried this code in Cargo.toml:
I expected to see this happen: explanation
Successful compilation
Instead, this happened: explanation
Resulting in a build script to abort:
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: