Skip to content

Commit 699e5fe

Browse files
committed
Cleanup dist::Bootstrap and add a simple test for it
1 parent e68c93b commit 699e5fe

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,15 +2604,17 @@ impl Step for RustDev {
26042604

26052605
/// Tarball intended for internal consumption to ease rustc/std development.
26062606
///
2607+
/// It only packages the binaries that were already compiled when bootstrap itself was built.
2608+
///
26072609
/// Should not be considered stable by end users.
26082610
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
26092611
pub struct Bootstrap {
2610-
pub target: TargetSelection,
2612+
target: TargetSelection,
26112613
}
26122614

26132615
impl Step for Bootstrap {
26142616
type Output = Option<GeneratedTarball>;
2615-
const DEFAULT: bool = false;
2617+
26162618
const IS_HOST: bool = true;
26172619

26182620
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -2639,6 +2641,10 @@ impl Step for Bootstrap {
26392641

26402642
Some(tarball.generate())
26412643
}
2644+
2645+
fn metadata(&self) -> Option<StepMetadata> {
2646+
Some(StepMetadata::dist("bootstrap", self.target))
2647+
}
26422648
}
26432649

26442650
/// Tarball containing a prebuilt version of the build-manifest tool, intended to be used by the

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,6 +1608,19 @@ mod snapshot {
16081608
");
16091609
}
16101610

1611+
#[test]
1612+
fn dist_bootstrap() {
1613+
let ctx = TestCtx::new();
1614+
insta::assert_snapshot!(
1615+
ctx
1616+
.config("dist")
1617+
.path("bootstrap")
1618+
.render_steps(), @r"
1619+
[build] rustc 0 <host> -> RustInstaller 1 <host>
1620+
[dist] bootstrap <host>
1621+
");
1622+
}
1623+
16111624
#[test]
16121625
fn check_compiler_no_explicit_stage() {
16131626
let ctx = TestCtx::new();

0 commit comments

Comments
 (0)