Skip to content

Commit af237c2

Browse files
committed
Cleanup dist::Bootstrap and add a simple test for it
1 parent 529d6d2 commit af237c2

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

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

26122614
impl Step for Bootstrap {
26132615
type Output = Option<GeneratedTarball>;
2614-
const DEFAULT: bool = false;
2616+
26152617
const IS_HOST: bool = true;
26162618

26172619
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -2638,6 +2640,10 @@ impl Step for Bootstrap {
26382640

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

26432649
/// 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)