Skip to content

Commit 90c0bcd

Browse files
committed
Fix fingerprinting for lld on Windows with dylib.
1 parent 1795c7d commit 90c0bcd

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/cargo/core/compiler/fingerprint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ fn calculate_normal(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Finger
12291229
let outputs = cx
12301230
.outputs(unit)?
12311231
.iter()
1232-
.filter(|output| output.flavor != FileFlavor::DebugInfo)
1232+
.filter(|output| !matches!(output.flavor, FileFlavor::DebugInfo | FileFlavor::Auxiliary))
12331233
.map(|output| output.path.clone())
12341234
.collect();
12351235

tests/testsuite/freshness.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,3 +2436,39 @@ fn linking_interrupted() {
24362436
)
24372437
.run();
24382438
}
2439+
2440+
#[cargo_test]
2441+
#[cfg_attr(
2442+
not(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc")),
2443+
ignore
2444+
)]
2445+
fn lld_is_fresh() {
2446+
// Check for bug when using lld linker that it remains fresh with dylib.
2447+
let p = project()
2448+
.file(
2449+
".cargo/config",
2450+
r#"
2451+
[target.x86_64-pc-windows-msvc]
2452+
linker = "rust-lld"
2453+
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
2454+
"#,
2455+
)
2456+
.file(
2457+
"Cargo.toml",
2458+
r#"
2459+
[package]
2460+
name = "foo"
2461+
version = "0.1.0"
2462+
2463+
[lib]
2464+
crate-type = ["dylib"]
2465+
"#,
2466+
)
2467+
.file("src/lib.rs", "")
2468+
.build();
2469+
2470+
p.cargo("build").run();
2471+
p.cargo("build -v")
2472+
.with_stderr("[FRESH] foo [..]\n[FINISHED] [..]")
2473+
.run();
2474+
}

0 commit comments

Comments
 (0)