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.
This commit is contained in:
commit
204bd6e215
2 changed files with 10 additions and 3 deletions
|
@ -370,7 +370,7 @@ impl<'a> Builder<'a> {
|
||||||
match kind {
|
match kind {
|
||||||
Kind::Build => describe!(
|
Kind::Build => describe!(
|
||||||
compile::Std,
|
compile::Std,
|
||||||
compile::Rustc,
|
compile::Assemble,
|
||||||
compile::CodegenBackend,
|
compile::CodegenBackend,
|
||||||
compile::StartupObjects,
|
compile::StartupObjects,
|
||||||
tool::BuildManifest,
|
tool::BuildManifest,
|
||||||
|
|
|
@ -528,7 +528,7 @@ impl Step for Rustc {
|
||||||
const DEFAULT: bool = false;
|
const DEFAULT: bool = false;
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||||
run.path("compiler/rustc")
|
run.never()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
fn make_run(run: RunConfig<'_>) {
|
||||||
|
@ -1023,9 +1023,16 @@ pub struct Assemble {
|
||||||
|
|
||||||
impl Step for Assemble {
|
impl Step for Assemble {
|
||||||
type Output = Compiler;
|
type Output = Compiler;
|
||||||
|
const ONLY_HOSTS: bool = true;
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
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`
|
/// Prepare a new compiler from the artifacts in `stage`
|
||||||
|
|
Loading…
Reference in a new issue