-
Notifications
You must be signed in to change notification settings - Fork 13k
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
bootstrap: Allow cleaning individual crates #106168
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
@bors r+ |
📌 Commit 99746a921de1016ab270e394427e982833a89daa has been approved by It is now in the queue for this repository. |
/// Return a `-p=x -p=y` string suitable for passing to a cargo invocation. | ||
pub fn cargo_crates_in_set(&self) -> Interned<Vec<String>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from compile.rs
below without changes.
/// Like `cargo`, but only passes flags that are valid for all commands. | ||
pub fn bare_cargo( | ||
&self, | ||
compiler: Compiler, | ||
mode: Mode, | ||
target: TargetSelection, | ||
cmd: &str, | ||
) -> Command { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from fn cargo
below without changes (other than returning cargo
)
@bors r- left a stray |
As a bonus, this stops special casing `clean` in `Builder`.
@bors r=Mark-Simulacrum |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b38a6d3): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
As a bonus, this stops special casing
clean
inBuilder
.Motivation
Cleaning artifacts isn't strictly necessary to get cargo to rebuild;
touch compiler/rustc_driver/src/lib.rs
(for example) will also work. There's two reasons I thought making this part of bootstrap proper was a better approach:touch
does not remove artifacts, it just causes a rebuild. This is unhelpful for when you want to measure how long the compiler itself takes to build (e.g. for Therustc_query_impl
crate is too big, which hurts compile times for the compiler itself #65031).x clean --stage 1 rustc
, which makes it easier to work around ICE: stage2 builds of rustc itself see metadata serialized by a different rustc #76720 without having to completely wipe all the stage 0 artifacts, or having to be intimately familiar with which directories to remove.