Skip to content

Commit

Permalink
Fix fingerprinting for lld on Windows with dylib.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed May 27, 2020
1 parent 1795c7d commit 90c0bcd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ fn calculate_normal(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Finger
let outputs = cx
.outputs(unit)?
.iter()
.filter(|output| output.flavor != FileFlavor::DebugInfo)
.filter(|output| !matches!(output.flavor, FileFlavor::DebugInfo | FileFlavor::Auxiliary))
.map(|output| output.path.clone())
.collect();

Expand Down
36 changes: 36 additions & 0 deletions tests/testsuite/freshness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2436,3 +2436,39 @@ fn linking_interrupted() {
)
.run();
}

#[cargo_test]
#[cfg_attr(
not(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc")),
ignore
)]
fn lld_is_fresh() {
// Check for bug when using lld linker that it remains fresh with dylib.
let p = project()
.file(
".cargo/config",
r#"
[target.x86_64-pc-windows-msvc]
linker = "rust-lld"
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
"#,
)
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.1.0"
[lib]
crate-type = ["dylib"]
"#,
)
.file("src/lib.rs", "")
.build();

p.cargo("build").run();
p.cargo("build -v")
.with_stderr("[FRESH] foo [..]\n[FINISHED] [..]")
.run();
}

0 comments on commit 90c0bcd

Please sign in to comment.