Skip to content

Commit

Permalink
Track panic mode in fingerprint
Browse files Browse the repository at this point in the history
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
alexcrichton committed May 2, 2018
1 parent acea5e2 commit 7f44648
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 @@ -457,6 +457,7 @@ fn calculate<'a, 'cfg>(
unit.mode,
cx.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(&cx.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 7f44648

Please sign in to comment.