Skip to content

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

Closed
@froydnj

Description

@froydnj

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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions