Skip to content

Commit 1ed61f5

Browse files
authored
Rollup merge of rust-lang#89759 - jyn514:x-build-assemble, r=Mark-Simulacrum
Assemble the compiler when running `x.py build` Previously, there was no way to actually get binaries in `build/$TARGET/stage1/bin` without building the standard library. This makes it possible to build just the compiler. This can be useful when the standard library isn't actually necessary for trying out your tests (e.g. a bug that can be reproduced with only a `no_core` crate). Closes rust-lang#73519.
2 parents 0a998f8 + 31265c6 commit 1ed61f5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Diff for: src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ impl<'a> Builder<'a> {
370370
match kind {
371371
Kind::Build => describe!(
372372
compile::Std,
373-
compile::Rustc,
373+
compile::Assemble,
374374
compile::CodegenBackend,
375375
compile::StartupObjects,
376376
tool::BuildManifest,

Diff for: src/bootstrap/compile.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ impl Step for Rustc {
528528
const DEFAULT: bool = false;
529529

530530
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
531-
run.path("compiler/rustc")
531+
run.never()
532532
}
533533

534534
fn make_run(run: RunConfig<'_>) {
@@ -1023,9 +1023,16 @@ pub struct Assemble {
10231023

10241024
impl Step for Assemble {
10251025
type Output = Compiler;
1026+
const ONLY_HOSTS: bool = true;
10261027

10271028
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
1028-
run.never()
1029+
run.path("compiler/rustc")
1030+
}
1031+
1032+
fn make_run(run: RunConfig<'_>) {
1033+
run.builder.ensure(Assemble {
1034+
target_compiler: run.builder.compiler(run.builder.top_stage + 1, run.target),
1035+
});
10291036
}
10301037

10311038
/// Prepare a new compiler from the artifacts in `stage`

0 commit comments

Comments
 (0)