Skip to content

Commit 0470945

Browse files
committed
Remove the x dist rust-std built optimization special-case
1 parent 3303770 commit 0470945

File tree

2 files changed

+24
-27
lines changed

2 files changed

+24
-27
lines changed

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -764,24 +764,10 @@ pub struct Std {
764764

765765
impl Std {
766766
pub fn new(builder: &Builder<'_>, target: TargetSelection) -> Self {
767-
// This is a build time optimization for running just `x dist rust-std` (without
768-
// `x dist rustc`).
769-
// If we know that we will be uplifting a stage2+ library from stage 1 anyway,
770-
// there is no point in building a stage2 rustc, which will then not do anything (because
771-
// the stdlib will be uplifted).
772-
let top_stage = builder.top_stage;
773-
let stage = if top_stage > 1
774-
&& compile::Std::should_be_uplifted_from_stage_1(builder, top_stage, target)
775-
{
776-
builder.info(&format!(
777-
"Note: stage {top_stage} library for `{}` would be uplifted from stage 1, so stage was downgraded from {top_stage} to 1 to avoid needless compiler build(s)",
778-
target
779-
));
780-
1
781-
} else {
782-
top_stage
783-
};
784-
Std { build_compiler: builder.compiler(stage, builder.config.host_target), target }
767+
Std {
768+
build_compiler: builder.compiler(builder.top_stage, builder.config.host_target),
769+
target,
770+
}
785771
}
786772
}
787773

src/bootstrap/src/core/builder/tests.rs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,8 @@ mod snapshot {
11331133
[dist] mingw <host>
11341134
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
11351135
[dist] rustc <host>
1136-
[dist] rustc 1 <host> -> std 1 <host>
1136+
[build] rustc 2 <host> -> std 2 <host>
1137+
[dist] rustc 2 <host> -> std 2 <host>
11371138
[dist] rustc 1 <host> -> rustc-dev 2 <host>
11381139
[dist] src <>
11391140
[dist] reproducible-artifacts <host>
@@ -1197,7 +1198,8 @@ mod snapshot {
11971198
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <host>
11981199
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
11991200
[dist] rustc <host>
1200-
[dist] rustc 1 <host> -> std 1 <host>
1201+
[build] rustc 2 <host> -> std 2 <host>
1202+
[dist] rustc 2 <host> -> std 2 <host>
12011203
[dist] rustc 1 <host> -> rustc-dev 2 <host>
12021204
[dist] rustc 1 <host> -> analysis 2 <host>
12031205
[dist] src <>
@@ -1214,6 +1216,7 @@ mod snapshot {
12141216
[build] rustc 1 <host> -> miri 2 <host>
12151217
[build] rustc 1 <host> -> cargo-miri 2 <host>
12161218
[dist] rustc 1 <host> -> miri 2 <host>
1219+
[dist] rustc 1 <host> -> std 1 <host>
12171220
[dist] rustc 1 <host> -> extended 2 <host>
12181221
[dist] reproducible-artifacts <host>
12191222
");
@@ -1284,7 +1287,8 @@ mod snapshot {
12841287
[dist] mingw <target1>
12851288
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
12861289
[dist] rustc <host>
1287-
[dist] rustc 1 <host> -> std 1 <host>
1290+
[build] rustc 2 <host> -> std 2 <host>
1291+
[dist] rustc 2 <host> -> std 2 <host>
12881292
[build] rustc 2 <host> -> std 2 <target1>
12891293
[dist] rustc 2 <host> -> std 2 <target1>
12901294
[dist] rustc 1 <host> -> rustc-dev 2 <host>
@@ -1346,7 +1350,8 @@ mod snapshot {
13461350
[dist] rustc <host>
13471351
[build] rustdoc 2 <target1>
13481352
[dist] rustc <target1>
1349-
[dist] rustc 1 <host> -> std 1 <host>
1353+
[build] rustc 2 <host> -> std 2 <host>
1354+
[dist] rustc 2 <host> -> std 2 <host>
13501355
[dist] rustc 1 <host> -> rustc-dev 2 <host>
13511356
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
13521357
[dist] src <>
@@ -1428,8 +1433,10 @@ mod snapshot {
14281433
[dist] rustc <host>
14291434
[build] rustdoc 2 <target1>
14301435
[dist] rustc <target1>
1431-
[dist] rustc 1 <host> -> std 1 <host>
1432-
[dist] rustc 1 <host> -> std 1 <target1>
1436+
[build] rustc 2 <host> -> std 2 <host>
1437+
[dist] rustc 2 <host> -> std 2 <host>
1438+
[build] rustc 2 <host> -> std 2 <target1>
1439+
[dist] rustc 2 <host> -> std 2 <target1>
14331440
[dist] rustc 1 <host> -> rustc-dev 2 <host>
14341441
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
14351442
[dist] src <>
@@ -1538,7 +1545,8 @@ mod snapshot {
15381545
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <target1>
15391546
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
15401547
[dist] rustc <target1>
1541-
[dist] rustc 1 <host> -> std 1 <target1>
1548+
[build] rustc 2 <host> -> std 2 <target1>
1549+
[dist] rustc 2 <host> -> std 2 <target1>
15421550
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
15431551
[dist] rustc 1 <host> -> analysis 2 <target1>
15441552
[dist] src <>
@@ -1556,6 +1564,7 @@ mod snapshot {
15561564
[build] rustc 1 <host> -> cargo-miri 2 <target1>
15571565
[dist] rustc 1 <host> -> miri 2 <target1>
15581566
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>
1567+
[dist] rustc 1 <host> -> std 1 <target1>
15591568
[doc] rustc 2 <target1> -> std 2 <target1> crates=[]
15601569
[dist] rustc 1 <host> -> extended 2 <target1>
15611570
[dist] reproducible-artifacts <target1>
@@ -1610,7 +1619,8 @@ mod snapshot {
16101619
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
16111620
[dist] rustc <host>
16121621
[dist] rustc 1 <host> -> rustc_codegen_cranelift 2 <host>
1613-
[dist] rustc 1 <host> -> std 1 <host>
1622+
[build] rustc 2 <host> -> std 2 <host>
1623+
[dist] rustc 2 <host> -> std 2 <host>
16141624
[dist] rustc 1 <host> -> rustc-dev 2 <host>
16151625
[dist] src <>
16161626
[dist] reproducible-artifacts <host>
@@ -2340,7 +2350,8 @@ mod snapshot {
23402350
[doc] rustc 1 <host> -> releases 2 <host>
23412351
[build] rustc 0 <host> -> RustInstaller 1 <host>
23422352
[dist] docs <host>
2343-
[dist] rustc 1 <host> -> std 1 <host>
2353+
[build] rustc 2 <host> -> std 2 <host>
2354+
[dist] rustc 2 <host> -> std 2 <host>
23442355
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <host>
23452356
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
23462357
[dist] rustc <host>

0 commit comments

Comments
 (0)