Skip to content

Commit 7da375e

Browse files
committed
Remove the x dist rust-std built optimization special-case
1 parent 484d9b6 commit 7da375e

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
@@ -1056,7 +1056,8 @@ mod snapshot {
10561056
[dist] mingw <host>
10571057
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
10581058
[dist] rustc <host>
1059-
[dist] rustc 1 <host> -> std 1 <host>
1059+
[build] rustc 2 <host> -> std 2 <host>
1060+
[dist] rustc 2 <host> -> std 2 <host>
10601061
[dist] rustc 1 <host> -> rustc-dev 2 <host>
10611062
[dist] src <>
10621063
[dist] reproducible-artifacts <host>
@@ -1120,7 +1121,8 @@ mod snapshot {
11201121
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <host>
11211122
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
11221123
[dist] rustc <host>
1123-
[dist] rustc 1 <host> -> std 1 <host>
1124+
[build] rustc 2 <host> -> std 2 <host>
1125+
[dist] rustc 2 <host> -> std 2 <host>
11241126
[dist] rustc 1 <host> -> rustc-dev 2 <host>
11251127
[dist] rustc 1 <host> -> analysis 2 <host>
11261128
[dist] src <>
@@ -1137,6 +1139,7 @@ mod snapshot {
11371139
[build] rustc 1 <host> -> miri 2 <host>
11381140
[build] rustc 1 <host> -> cargo-miri 2 <host>
11391141
[dist] rustc 1 <host> -> miri 2 <host>
1142+
[dist] rustc 1 <host> -> std 1 <host>
11401143
[dist] rustc 1 <host> -> extended 2 <host>
11411144
[dist] reproducible-artifacts <host>
11421145
");
@@ -1207,7 +1210,8 @@ mod snapshot {
12071210
[dist] mingw <target1>
12081211
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
12091212
[dist] rustc <host>
1210-
[dist] rustc 1 <host> -> std 1 <host>
1213+
[build] rustc 2 <host> -> std 2 <host>
1214+
[dist] rustc 2 <host> -> std 2 <host>
12111215
[build] rustc 2 <host> -> std 2 <target1>
12121216
[dist] rustc 2 <host> -> std 2 <target1>
12131217
[dist] rustc 1 <host> -> rustc-dev 2 <host>
@@ -1269,7 +1273,8 @@ mod snapshot {
12691273
[dist] rustc <host>
12701274
[build] rustdoc 2 <target1>
12711275
[dist] rustc <target1>
1272-
[dist] rustc 1 <host> -> std 1 <host>
1276+
[build] rustc 2 <host> -> std 2 <host>
1277+
[dist] rustc 2 <host> -> std 2 <host>
12731278
[dist] rustc 1 <host> -> rustc-dev 2 <host>
12741279
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
12751280
[dist] src <>
@@ -1351,8 +1356,10 @@ mod snapshot {
13511356
[dist] rustc <host>
13521357
[build] rustdoc 2 <target1>
13531358
[dist] rustc <target1>
1354-
[dist] rustc 1 <host> -> std 1 <host>
1355-
[dist] rustc 1 <host> -> std 1 <target1>
1359+
[build] rustc 2 <host> -> std 2 <host>
1360+
[dist] rustc 2 <host> -> std 2 <host>
1361+
[build] rustc 2 <host> -> std 2 <target1>
1362+
[dist] rustc 2 <host> -> std 2 <target1>
13561363
[dist] rustc 1 <host> -> rustc-dev 2 <host>
13571364
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
13581365
[dist] src <>
@@ -1461,7 +1468,8 @@ mod snapshot {
14611468
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <target1>
14621469
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
14631470
[dist] rustc <target1>
1464-
[dist] rustc 1 <host> -> std 1 <target1>
1471+
[build] rustc 2 <host> -> std 2 <target1>
1472+
[dist] rustc 2 <host> -> std 2 <target1>
14651473
[dist] rustc 1 <host> -> rustc-dev 2 <target1>
14661474
[dist] rustc 1 <host> -> analysis 2 <target1>
14671475
[dist] src <>
@@ -1479,6 +1487,7 @@ mod snapshot {
14791487
[build] rustc 1 <host> -> cargo-miri 2 <target1>
14801488
[dist] rustc 1 <host> -> miri 2 <target1>
14811489
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <target1>
1490+
[dist] rustc 1 <host> -> std 1 <target1>
14821491
[doc] rustc 2 <target1> -> std 2 <target1> crates=[]
14831492
[dist] rustc 1 <host> -> extended 2 <target1>
14841493
[dist] reproducible-artifacts <target1>
@@ -1533,7 +1542,8 @@ mod snapshot {
15331542
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
15341543
[dist] rustc <host>
15351544
[dist] rustc 1 <host> -> rustc_codegen_cranelift 2 <host>
1536-
[dist] rustc 1 <host> -> std 1 <host>
1545+
[build] rustc 2 <host> -> std 2 <host>
1546+
[dist] rustc 2 <host> -> std 2 <host>
15371547
[dist] rustc 1 <host> -> rustc-dev 2 <host>
15381548
[dist] src <>
15391549
[dist] reproducible-artifacts <host>
@@ -2263,7 +2273,8 @@ mod snapshot {
22632273
[doc] rustc 1 <host> -> releases 2 <host>
22642274
[build] rustc 0 <host> -> RustInstaller 1 <host>
22652275
[dist] docs <host>
2266-
[dist] rustc 1 <host> -> std 1 <host>
2276+
[build] rustc 2 <host> -> std 2 <host>
2277+
[dist] rustc 2 <host> -> std 2 <host>
22672278
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <host>
22682279
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
22692280
[dist] rustc <host>

0 commit comments

Comments
 (0)