diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-10-13 22:51:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-13 22:51:03 +0200 |
| commit | 204bd6e2156c01ba183532294b6dd9366e0c0a04 (patch) | |
| tree | fd4b7b790235d85a84ea97fce50fc5dac04a3a17 /src/bootstrap | |
| parent | 9f0ef184b815318bf044194e150f612a3d898105 (diff) | |
| parent | 31265c6ca3a2d404b7dbda0e3529f0be7c38cde7 (diff) | |
| download | rust-204bd6e2156c01ba183532294b6dd9366e0c0a04.tar.gz rust-204bd6e2156c01ba183532294b6dd9366e0c0a04.zip | |
Rollup merge of #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 https://github.com/rust-lang/rust/issues/73519.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/builder.rs | 2 | ||||
| -rw-r--r-- | src/bootstrap/compile.rs | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 7df7a36f540..6750f7a549d 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -370,7 +370,7 @@ impl<'a> Builder<'a> { match kind { Kind::Build => describe!( compile::Std, - compile::Rustc, + compile::Assemble, compile::CodegenBackend, compile::StartupObjects, tool::BuildManifest, diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 4b189672226..e9cc7662e63 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -528,7 +528,7 @@ impl Step for Rustc { const DEFAULT: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.path("compiler/rustc") + run.never() } fn make_run(run: RunConfig<'_>) { @@ -1023,9 +1023,16 @@ pub struct Assemble { impl Step for Assemble { type Output = Compiler; + const ONLY_HOSTS: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - run.never() + run.path("compiler/rustc") + } + + fn make_run(run: RunConfig<'_>) { + run.builder.ensure(Assemble { + target_compiler: run.builder.compiler(run.builder.top_stage + 1, run.target), + }); } /// Prepare a new compiler from the artifacts in `stage` |
