Skip to content
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/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,16 @@ impl CommandLineStep for Rustc {
for krate in &*self.crates {
cargo.arg("-p").arg(krate);
}
// When we run `x check compiler --all-targets`, then the `Rustc` step is executed in
Comment thread
jieyouxu marked this conversation as resolved.
// two "modes" - one with all in-tree rustc crates, and a second time with empty crates
// in `PrepareRustcRmetaSysroot`, to prepare .rmeta files for RustcPrivate tools.
// If we use `--all-targets` for both, then we will end up with a duplicated .rmeta file
// in the sysroot, which breaks everything.
// So we only use `--all-targets` for the default case where crates are empty.
// This will also be used when someone does `x check compiler/<rustc-crate>`.
if !self.crates.is_empty() && builder.sess.config.cmd.check_all_targets() {
cargo.arg("--all-targets");
}
Comment on lines +388 to +397

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢


let _guard = builder.msg(
self.check_kind.to_kind(),
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/core/config/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,11 @@ impl Subcommand {
_ => false,
}
}

/// Are we executing a `check --all-targets` command?
pub(crate) fn check_all_targets(&self) -> bool {
matches!(self, Subcommand::Check { all_targets: true, .. })
}
}

/// Returns the shell completion for a given shell, if the result differs from the current
Expand Down
Loading