Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[regression] when using lld on windows and nightly cargo, no-op builds recompile everything #8284

Closed
froydnj opened this issue May 26, 2020 · 0 comments · Fixed by #8290
Closed
Assignees
Labels
A-rebuild-detection Area: rebuild detection and fingerprinting C-bug Category: bug P-high Priority: High regression-from-stable-to-nightly Regression in nightly that previously worked in stable.

Comments

@froydnj
Copy link
Contributor

froydnj commented May 26, 2020

Problem

A user reported https://bugzilla.mozilla.org/show_bug.cgi?id=1640643, where no-op builds were repeatedly recompiling Rust code.

Steps

  1. Set up environment to use lld as the linker.
  2. Run cargo build
  3. Run cargo build again

Possible Solution(s)

The CARGO_LOG=cargo::core::compiler::fingerprint=trace output linked in the above bug contains a number of:

[2020-05-25T13:33:10Z DEBUG cargo::core::compiler::fingerprint] failed to get mtime of "d:/mozilla/obj-full\\release\\deps\\serde_derive-1d5d1f5a8084dca6.dll.exp": failed to stat `d:/mozilla/obj-full\release\deps\serde_derive-1d5d1f5a8084dca6.dll.exp`

and similar lines. It looks like eac3b66 (cc @ehuss ), as part of a refactoring, introduced an additional requirement of .dll.exp files being present. This appears to be a regression.

Removing

// NOTE: lld does not produce these
ret.push(FileType {
suffix: ".dll.exp".to_string(),
prefix: prefix.clone(),
flavor: FileFlavor::Auxiliary,
crate_type: Some(crate_type.clone()),
should_replace_hyphens: true,
});

should fix the bug.

Notes

Output of cargo version: cargo 1.45.0-nightly (500b2bd01 2020-05-18)

@froydnj froydnj added the C-bug Category: bug label May 26, 2020
@ehuss ehuss added A-rebuild-detection Area: rebuild detection and fingerprinting P-high Priority: High regression-from-stable-to-nightly Regression in nightly that previously worked in stable. labels May 26, 2020
@ehuss ehuss self-assigned this May 26, 2020
@bors bors closed this as completed in 974fed9 May 27, 2020
ehuss pushed a commit to ehuss/cargo that referenced this issue Jun 5, 2020
Fix fingerprinting for lld on Windows with dylib.

This fixes an issue where if `lld` is used on Windows, dynamic libraries will never be treated as "fresh". This is a regression from rust-lang#8210 where Cargo is expecting export files to be created, but lld does not create these.

The solution is to ignore "Auxiliary" files in fingerprinting, which AFAIK aren't really needed (only the primary output files really matter).

Fixes rust-lang#8284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rebuild-detection Area: rebuild detection and fingerprinting C-bug Category: bug P-high Priority: High regression-from-stable-to-nightly Regression in nightly that previously worked in stable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants