Skip to content
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 build project with 'panic = abort' #2726

Closed
alexbool opened this issue May 22, 2016 · 2 comments · Fixed by #2730
Closed

Cannot build project with 'panic = abort' #2726

alexbool opened this issue May 22, 2016 · 2 comments · Fixed by #2730

Comments

@alexbool
Copy link

Seems like a bug in #2687

alexbool@alexbool-osx ~/D/I/nounwind> cat Cargo.toml 
[package]
name = "nounwind"
version = "0.1.0"
authors = ["Alexander Bulaev <[email protected]>"]

[dependencies]
kernel32-sys = "*"

[profile.release]
panic = "abort"

alexbool@alexbool-osx ~/D/I/nounwind> cat src/main.rs 
extern crate kernel32;

fn main() {
}

alexbool@alexbool-osx ~/D/I/nounwind> cargo build --release
   Compiling kernel32-sys v0.2.2
error: the crate `build` is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind`
error: aborting due to previous error
error: Could not compile `kernel32-sys`.

To learn more, run the command again with --verbose.

Meta:

alexbool@alexbool-osx ~/D/I/nounwind> rustc -vV
rustc 1.10.0-nightly (476fe6eef 2016-05-21)
binary: rustc
commit-hash: 476fe6eefe17db91ff7a60aab34aa67a0a750a18
commit-date: 2016-05-21
host: x86_64-apple-darwin
release: 1.10.0-nightly

alexbool@alexbool-osx ~/D/I/nounwind> cargo -vV
cargo 0.11.0-nightly (259324c 2016-05-20)
@alexbool
Copy link
Author

If I add

[profile.dev]
panic = "abort"

to Cargo.toml, cargo build --release works fine

alexcrichton added a commit to alexcrichton/cargo that referenced this issue May 23, 2016
Build scripts were apparently always compiled with the "dev" profile rather than
the standard "match whatever the normal build was" profile, which meant that if
dev/release disagreed on panic=abort you'd get compile errors. Seems bad!

This commit fixes this by just having build scripts always compile with the same
profile as libraries (for now), as this was the original intention anyway.

Closes rust-lang#2726
@alexcrichton
Copy link
Member

Whoa now that's a weird bug! I believe I've fixed in #2730 though

bors added a commit that referenced this issue May 23, 2016
…excrichton

Fix build scripts and panic=abort

Build scripts were apparently always compiled with the "dev" profile rather than
the standard "match whatever the normal build was" profile, which meant that if
dev/release disagreed on panic=abort you'd get compile errors. Seems bad!

This commit fixes this by just having build scripts always compile with the same
profile as libraries (for now), as this was the original intention anyway.

Closes #2726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants