cargo: Still cannot build project with 'panic = abort'

This time compiler plugins seem to be the culprit

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

[dependencies]
quasi_macros = "*"

[profile.release]
panic = "abort"

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

fn main() {
}

alexbool@alexbool-osx ~/D/I/nounwind> cargo build --release
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling aster v0.16.0
   Compiling quasi_codegen v0.10.0
   Compiling quasi_macros v0.10.0
error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort`
error: aborting due to previous error
error: Could not compile `quasi_macros`.

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

This time adding

[profile.dev]
panic = "abort"

doesn’t help

Meta:

alexbool@alexbool-osx ~/D/I/nounwind> rustc -vV
rustc 1.10.0-nightly (57ef01513 2016-05-23)
binary: rustc
commit-hash: 57ef015132ec09345b88d2ec20a9d9809b5d3dfc
commit-date: 2016-05-23
host: x86_64-apple-darwin
release: 1.10.0-nightly
alexbool@alexbool-osx ~/D/I/nounwind> cargo -vV
cargo 0.11.0-nightly (ca743f3 2016-05-23)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 3
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@Jragonmiris ah unfortunately that’s a bad error message but it’s because of crate-type = ["dylib", "rlib"] in the c_vec crate. This causes Cargo to pass -C prefer-dynamic which links to the dylib that we ship which is compiled against panic_unwind, meaning the abort mode is indeed invalid (this error is coming from the compiler).

The fix here would be to remove "dylib" from the c_vec crate.

@alexcrichton if it’s hard to fix, maybe it’s easier to detect that problem and tell the user why it’s broken and link to this here. That was surprisingly hard to google for and it wastes quite a bit of time.