Skip to content

Commit

Permalink
Auto merge of #5458 - alexcrichton:track-panic, r=matklad
Browse files Browse the repository at this point in the history
Track panic mode in fingerprint

Ensure that if we've previously compiled a crate with panic=abort and we later
need it for panic=unwind we correctly recompile it.

Closes #5445
  • Loading branch information
bors committed May 2, 2018
2 parents 1b26ece + 7f44648 commit 31b38fe
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cargo/core/compiler/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ fn calculate<'a, 'cfg>(
unit.mode,
bcx.extra_args_for(unit),
cx.incremental_args(unit)?,
cx.used_in_plugin.contains(unit), // used when passing panic=abort
));
let fingerprint = Arc::new(Fingerprint {
rustc: util::hash_u64(&bcx.build_config.rustc.verbose_version),
Expand Down
45 changes: 45 additions & 0 deletions tests/testsuite/freshness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1119,3 +1119,48 @@ fn path_dev_dep_registry_updates() {
execs().with_status(0).with_stderr("[FINISHED] [..]"),
);
}

#[test]
fn change_panic_mode() {
let p = project("p")
.file(
"Cargo.toml",
r#"
[workspace]
members = ['foo', 'bar']
[profile.dev]
panic = 'abort'
"#,
)
.file("src/lib.rs", "")
.file(
"foo/Cargo.toml",
r#"
[package]
name = "foo"
version = "0.1.1"
authors = []
"#,
)
.file("foo/src/lib.rs", "")
.file(
"bar/Cargo.toml",
r#"
[package]
name = "bar"
version = "0.1.1"
authors = []
[lib]
proc-macro = true
[dependencies]
foo = { path = '../foo' }
"#,
)
.file("bar/src/lib.rs", "extern crate foo;")
.build();

assert_that(p.cargo("build -p foo"), execs().with_status(0));
assert_that(p.cargo("build -p bar"), execs().with_status(0));
}

0 comments on commit 31b38fe

Please sign in to comment.