diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-02-10 21:24:25 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-02-10 22:31:08 +0900 |
| commit | 0061d11f939157e181a908f50b0ffb4c991e0375 (patch) | |
| tree | fc611a4624f1a13951a17e38aead148214a7a62b /cmd/mbf | |
| parent | fb101a02f21d048515561659b06bfc2a35568c56 (diff) | |
internal/rosa: use self-hosted stage0
This removes the bootstrap dependency on Gentoo stage3 tarball.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/mbf')
| -rw-r--r-- | cmd/mbf/main.go | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index 83bb6714..9828a8f1 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -111,15 +111,31 @@ func main() { { var ( + flagGentoo string + flagChecksum string + flagStage0 bool ) c.NewCommand( "stage3", "Check for toolchain 3-stage non-determinism", func(args []string) (err error) { - _, _, _, stage1 := (rosa.Std - 2).NewLLVM() - _, _, _, stage2 := (rosa.Std - 1).NewLLVM() - _, _, _, stage3 := rosa.Std.NewLLVM() + std := rosa.Std + if flagGentoo != "" { + std -= 3 // magic number to discourage misuse + + var checksum pkg.Checksum + if len(flagChecksum) != 0 { + if err = pkg.Decode(&checksum, flagChecksum); err != nil { + return + } + } + rosa.SetGentooStage3(flagGentoo, checksum) + } + + _, _, _, stage1 := (std - 2).NewLLVM() + _, _, _, stage2 := (std - 1).NewLLVM() + _, _, _, stage3 := std.NewLLVM() var ( pathname *check.Absolute checksum [2]unique.Handle[pkg.Checksum] @@ -153,7 +169,7 @@ func main() { if flagStage0 { if pathname, _, err = cache.Cure( - rosa.Std.Load(rosa.Stage0), + std.Load(rosa.Stage0), ); err != nil { return err } @@ -164,6 +180,16 @@ func main() { }, ). Flag( + &flagGentoo, + "gentoo", command.StringFlag(""), + "Bootstrap from a Gentoo stage3 tarball", + ). + Flag( + &flagChecksum, + "checksum", command.StringFlag(""), + "Checksum of Gentoo stage3 tarball", + ). + Flag( &flagStage0, "stage0", command.BoolFlag(false), "Create bootstrap stage0 tarball", |
