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

Fix build-std collisions. #7860

Merged
merged 2 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/cargo/core/compiler/context/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,5 +587,15 @@ fn compute_metadata<'a, 'cfg>(
if let Ok(ref channel) = __cargo_default_lib_metadata {
channel.hash(&mut hasher);
}

// std units need to be kept separate from user dependencies. std crates
// are differentiated in the Unit with `is_std` (for things like
// `-Zforce-unstable-if-unmarked`), so they are always built separately.
// This isn't strictly necessary for build dependencies which probably
// don't need unstable support. A future experiment might be to set
// `is_std` to false for build dependencies so that they can be shared
// with user dependencies.
unit.is_std.hash(&mut hasher);

Some(Metadata(hasher.finish()))
}
1 change: 1 addition & 0 deletions src/cargo/core/compiler/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
//! -C incremental=… flag | ✓ |
//! mtime of sources | ✓[^3] |
//! RUSTFLAGS/RUSTDOCFLAGS | ✓ |
//! is_std | | ✓
//!
//! [^1]: Build script and bin dependencies are not included.
//!
Expand Down