Skip to content

Commit 96d170f

Browse files
committed
Cleanup dist::Bootstrap and add a simple test for it
1 parent 154443f commit 96d170f

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
@@ -2594,15 +2594,17 @@ impl Step for RustDev {
25942594

25952595
/// Tarball intended for internal consumption to ease rustc/std development.
25962596
///
2597+
/// It only packages the binaries that were already compiled when bootstrap itself was built.
2598+
///
25972599
/// Should not be considered stable by end users.
25982600
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
25992601
pub struct Bootstrap {
2600-
pub target: TargetSelection,
2602+
target: TargetSelection,
26012603
}
26022604

26032605
impl Step for Bootstrap {
26042606
type Output = Option<GeneratedTarball>;
2605-
const DEFAULT: bool = false;
2607+
26062608
const IS_HOST: bool = true;
26072609

26082610
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -2629,6 +2631,10 @@ impl Step for Bootstrap {
26292631

26302632
Some(tarball.generate())
26312633
}
2634+
2635+
fn metadata(&self) -> Option<StepMetadata> {
2636+
Some(StepMetadata::dist("bootstrap", self.target))
2637+
}
26322638
}
26332639

26342640
/// 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
@@ -1531,6 +1531,19 @@ mod snapshot {
15311531
");
15321532
}
15331533

1534+
#[test]
1535+
fn dist_bootstrap() {
1536+
let ctx = TestCtx::new();
1537+
insta::assert_snapshot!(
1538+
ctx
1539+
.config("dist")
1540+
.path("bootstrap")
1541+
.render_steps(), @r"
1542+
[build] rustc 0 <host> -> RustInstaller 1 <host>
1543+
[dist] bootstrap <host>
1544+
");
1545+
}
1546+
15341547
#[test]
15351548
fn check_compiler_no_explicit_stage() {
15361549
let ctx = TestCtx::new();

0 commit comments

Comments
 (0)