-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cannot run benchmarks with panic = "abort"
#3166
Comments
Dug a bit more into this today. The dependency actually isn't needed here to trigger the bug, and if you configure The problem here is that libtest, Rust's testing framework, requires the unwind panic mode and is incompatible with The "fix" here would be to ignore |
The patch in #3175 is confusing to me. Is there any way to run tests or benchmarks with |
Unfortunately no because they all link to libtest which is compiled with |
I see, and because Is there any work on making an alternative |
Perhaps yeah, but that's more of a rust-lang/rust issue than a Cargo one. |
Interesting. If I were to make an alternative |
Yeah you can specify |
Both of these profiles link to libtest, so it's invalid to configure them with `panic="abort"`. To prevent confusing errors just ignore the configuration for now. Closes rust-lang#3166
Ignore `panic` configuration for test/bench profiles Both of these profiles link to libtest, so it's invalid to configure them with `panic="abort"`. To prevent confusing errors just ignore the configuration for now. Closes #3166
@alexcrichton: |
@sanmai-NL seems reasonable to me! Want to open an issue for that? |
My first reaction to your suggestion is that it would be too much overhead. I can try to make a PR for it straight away. If it doesn't cost you too much time, perhaps you can give some pointers on how to generate an appropriate warning in Cargo, e.g. similar to the current ‘Unknown field’ warning. |
Sure yeah sounds good! The best way to generate warnings right now is the If that doesn't end up working out though, just let me know |
The following error is obtained when running
cargo bench
, with the apanic = "abort"
option incargo.toml
:The
cargo.toml
needs to set the panic behavior in[profile.bench]
, e.g.:cargo.toml
:The text was updated successfully, but these errors were encountered: