Skip to content

Commit c5699a9

Browse files
authored
Unrolled build for #145000
Rollup merge of #145000 - Kobzol:std-cargo-stage, r=jieyouxu Remove unneeded `stage` parameter when setting up stdlib Cargo The standard library can't be built using a compiler that has a lower stage than 1 anymore, so the condition was useless (you can test that with e.g. `x doc std --stage 0`, which is broken - I aim to forbid doing that soon). Found this while doing an unrelated cleanup. r? `@jieyouxu`
2 parents 7d82b83 + 057df26 commit c5699a9

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl Step for Std {
8484
Kind::Check,
8585
);
8686

87-
std_cargo(builder, target, stage, &mut cargo);
87+
std_cargo(builder, target, &mut cargo);
8888
if matches!(builder.config.cmd, Subcommand::Fix) {
8989
// By default, cargo tries to fix all targets. Tell it not to fix tests until we've added `test` to the sysroot.
9090
cargo.arg("--lib");
@@ -125,7 +125,7 @@ impl Step for Std {
125125
Kind::Check,
126126
);
127127

128-
std_cargo(builder, target, build_compiler.stage, &mut cargo);
128+
std_cargo(builder, target, &mut cargo);
129129

130130
// Explicitly pass -p for all dependencies krates -- this will force cargo
131131
// to also check the tests/benches/examples for these crates, rather

src/bootstrap/src/core/build_steps/clippy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl Step for Std {
154154
Kind::Clippy,
155155
);
156156

157-
std_cargo(builder, target, compiler.stage, &mut cargo);
157+
std_cargo(builder, target, &mut cargo);
158158

159159
for krate in &*self.crates {
160160
cargo.arg("-p").arg(krate);

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl Step for Std {
269269
target,
270270
Kind::Build,
271271
);
272-
std_cargo(builder, target, compiler.stage, &mut cargo);
272+
std_cargo(builder, target, &mut cargo);
273273
for krate in &*self.crates {
274274
cargo.arg("-p").arg(krate);
275275
}
@@ -497,7 +497,7 @@ fn compiler_rt_for_profiler(builder: &Builder<'_>) -> PathBuf {
497497

498498
/// Configure cargo to compile the standard library, adding appropriate env vars
499499
/// and such.
500-
pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, cargo: &mut Cargo) {
500+
pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, cargo: &mut Cargo) {
501501
// rustc already ensures that it builds with the minimum deployment
502502
// target, so ideally we shouldn't need to do anything here.
503503
//
@@ -645,12 +645,8 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
645645
// built with bitcode so that the produced rlibs can be used for both LTO
646646
// builds (which use bitcode) and non-LTO builds (which use object code).
647647
// So we override the override here!
648-
//
649-
// But we don't bother for the stage 0 compiler because it's never used
650-
// with LTO.
651-
if stage >= 1 {
652-
cargo.rustflag("-Cembed-bitcode=yes");
653-
}
648+
cargo.rustflag("-Cembed-bitcode=yes");
649+
654650
if builder.config.rust_lto == RustcLto::Off {
655651
cargo.rustflag("-Clto=off");
656652
}

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ fn doc_std(
722722
let mut cargo =
723723
builder::Cargo::new(builder, compiler, Mode::Std, SourceType::InTree, target, Kind::Doc);
724724

725-
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
725+
compile::std_cargo(builder, target, &mut cargo);
726726
cargo
727727
.arg("--no-deps")
728728
.arg("--target-dir")

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2858,7 +2858,7 @@ impl Step for Crate {
28582858
.arg("--manifest-path")
28592859
.arg(builder.src.join("library/sysroot/Cargo.toml"));
28602860
} else {
2861-
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
2861+
compile::std_cargo(builder, target, &mut cargo);
28622862
}
28632863
}
28642864
Mode::Rustc => {

0 commit comments

Comments
 (0)