Cleanup dist::Bootstrap and add a simple test for it

This commit is contained in:
Jakub Beránek 2025-08-15 20:27:11 +02:00
parent e68c93b538
commit 699e5fe933
No known key found for this signature in database
GPG key ID: 909CD0D26483516B
2 changed files with 21 additions and 2 deletions

View file

@ -2604,15 +2604,17 @@ impl Step for RustDev {
/// Tarball intended for internal consumption to ease rustc/std development.
///
/// It only packages the binaries that were already compiled when bootstrap itself was built.
///
/// Should not be considered stable by end users.
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct Bootstrap {
pub target: TargetSelection,
target: TargetSelection,
}
impl Step for Bootstrap {
type Output = Option<GeneratedTarball>;
const DEFAULT: bool = false;
const IS_HOST: bool = true;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@ -2639,6 +2641,10 @@ impl Step for Bootstrap {
Some(tarball.generate())
}
fn metadata(&self) -> Option<StepMetadata> {
Some(StepMetadata::dist("bootstrap", self.target))
}
}
/// Tarball containing a prebuilt version of the build-manifest tool, intended to be used by the

View file

@ -1608,6 +1608,19 @@ mod snapshot {
");
}
#[test]
fn dist_bootstrap() {
let ctx = TestCtx::new();
insta::assert_snapshot!(
ctx
.config("dist")
.path("bootstrap")
.render_steps(), @r"
[build] rustc 0 <host> -> RustInstaller 1 <host>
[dist] bootstrap <host>
");
}
#[test]
fn check_compiler_no_explicit_stage() {
let ctx = TestCtx::new();