Skip to content

Commit 0acc0c8

Browse files
committed
Revert "avoid compiler_for for dist tools and force the current compiler"
This reverts commit 50f8412.
1 parent 9e4b3d6 commit 0acc0c8

File tree

2 files changed

+47
-11
lines changed

2 files changed

+47
-11
lines changed

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

+46-10
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,11 @@ impl Step for Rustc {
421421

422422
if let Some(ra_proc_macro_srv) = builder.ensure_if_default(
423423
tool::RustAnalyzerProcMacroSrv {
424-
compiler: builder.compiler(compiler.stage, builder.config.build),
424+
compiler: builder.compiler_for(
425+
compiler.stage,
426+
builder.config.build,
427+
compiler.host,
428+
),
425429
target: compiler.host,
426430
},
427431
builder.kind,
@@ -771,7 +775,11 @@ impl Step for Analysis {
771775
// Find the actual compiler (handling the full bootstrap option) which
772776
// produced the save-analysis data because that data isn't copied
773777
// through the sysroot uplifting.
774-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
778+
compiler: run.builder.compiler_for(
779+
run.builder.top_stage,
780+
run.builder.config.build,
781+
run.target,
782+
),
775783
target: run.target,
776784
});
777785
}
@@ -1116,7 +1124,11 @@ impl Step for Cargo {
11161124

11171125
fn make_run(run: RunConfig<'_>) {
11181126
run.builder.ensure(Cargo {
1119-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
1127+
compiler: run.builder.compiler_for(
1128+
run.builder.top_stage,
1129+
run.builder.config.build,
1130+
run.target,
1131+
),
11201132
target: run.target,
11211133
});
11221134
}
@@ -1161,7 +1173,11 @@ impl Step for Rls {
11611173

11621174
fn make_run(run: RunConfig<'_>) {
11631175
run.builder.ensure(Rls {
1164-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
1176+
compiler: run.builder.compiler_for(
1177+
run.builder.top_stage,
1178+
run.builder.config.build,
1179+
run.target,
1180+
),
11651181
target: run.target,
11661182
});
11671183
}
@@ -1199,7 +1215,11 @@ impl Step for RustAnalyzer {
11991215

12001216
fn make_run(run: RunConfig<'_>) {
12011217
run.builder.ensure(RustAnalyzer {
1202-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
1218+
compiler: run.builder.compiler_for(
1219+
run.builder.top_stage,
1220+
run.builder.config.build,
1221+
run.target,
1222+
),
12031223
target: run.target,
12041224
});
12051225
}
@@ -1237,7 +1257,11 @@ impl Step for Clippy {
12371257

12381258
fn make_run(run: RunConfig<'_>) {
12391259
run.builder.ensure(Clippy {
1240-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
1260+
compiler: run.builder.compiler_for(
1261+
run.builder.top_stage,
1262+
run.builder.config.build,
1263+
run.target,
1264+
),
12411265
target: run.target,
12421266
});
12431267
}
@@ -1280,7 +1304,11 @@ impl Step for Miri {
12801304

12811305
fn make_run(run: RunConfig<'_>) {
12821306
run.builder.ensure(Miri {
1283-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
1307+
compiler: run.builder.compiler_for(
1308+
run.builder.top_stage,
1309+
run.builder.config.build,
1310+
run.target,
1311+
),
12841312
target: run.target,
12851313
});
12861314
}
@@ -1414,7 +1442,11 @@ impl Step for Rustfmt {
14141442

14151443
fn make_run(run: RunConfig<'_>) {
14161444
run.builder.ensure(Rustfmt {
1417-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
1445+
compiler: run.builder.compiler_for(
1446+
run.builder.top_stage,
1447+
run.builder.config.build,
1448+
run.target,
1449+
),
14181450
target: run.target,
14191451
});
14201452
}
@@ -1464,7 +1496,7 @@ impl Step for Extended {
14641496
fn run(self, builder: &Builder<'_>) {
14651497
let target = self.target;
14661498
let stage = self.stage;
1467-
let compiler = builder.compiler(self.stage, self.host);
1499+
let compiler = builder.compiler_for(self.stage, self.host, self.target);
14681500

14691501
builder.info(&format!("Dist extended stage{} ({})", compiler.stage, target));
14701502

@@ -2227,7 +2259,11 @@ impl Step for LlvmBitcodeLinker {
22272259

22282260
fn make_run(run: RunConfig<'_>) {
22292261
run.builder.ensure(LlvmBitcodeLinker {
2230-
compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
2262+
compiler: run.builder.compiler_for(
2263+
run.builder.top_stage,
2264+
run.builder.config.build,
2265+
run.target,
2266+
),
22312267
target: run.target,
22322268
});
22332269
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ mod dist {
525525
first(cache.all::<compile::Rustc>()),
526526
&[
527527
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 0),
528-
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_1, stage = 1),
528+
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 0),
529529
rustc!(TEST_TRIPLE_1 => TEST_TRIPLE_2, stage = 1),
530530
]
531531
);

0 commit comments

Comments
 (0)