aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-10 19:40:45 +0900
committerOphestra <cat@gensokyo.uk>2026-02-10 21:22:46 +0900
commitfb101a02f21d048515561659b06bfc2a35568c56 (patch)
tree463d221e3408de18728ba85cf3412cde8b5a3e48 /cmd
parent3dbd67d1138e46d15df408d1404c946163e15ef1 (diff)
internal/rosa: self-host stage0 tarball
This replaces gentoo stage3 tarballs. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mbf/main.go92
1 files changed, 56 insertions, 36 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go
index db5e80af..83bb6714 100644
--- a/cmd/mbf/main.go
+++ b/cmd/mbf/main.go
@@ -109,46 +109,66 @@ func main() {
)
}
- 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()
- var (
- pathname *check.Absolute
- checksum [2]unique.Handle[pkg.Checksum]
- )
+ {
+ var (
+ 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()
+ var (
+ pathname *check.Absolute
+ checksum [2]unique.Handle[pkg.Checksum]
+ )
- if pathname, _, err = cache.Cure(stage1); err != nil {
- return err
- }
- log.Println("stage1:", pathname)
+ if pathname, _, err = cache.Cure(stage1); err != nil {
+ return err
+ }
+ log.Println("stage1:", pathname)
- if pathname, checksum[0], err = cache.Cure(stage2); err != nil {
- return err
- }
- log.Println("stage2:", pathname)
- if pathname, checksum[1], err = cache.Cure(stage3); err != nil {
- return err
- }
- log.Println("stage3:", pathname)
+ if pathname, checksum[0], err = cache.Cure(stage2); err != nil {
+ return err
+ }
+ log.Println("stage2:", pathname)
+ if pathname, checksum[1], err = cache.Cure(stage3); err != nil {
+ return err
+ }
+ log.Println("stage3:", pathname)
- if checksum[0] != checksum[1] {
- err = &pkg.ChecksumMismatchError{
- Got: checksum[0].Value(),
- Want: checksum[1].Value(),
+ if checksum[0] != checksum[1] {
+ err = &pkg.ChecksumMismatchError{
+ Got: checksum[0].Value(),
+ Want: checksum[1].Value(),
+ }
+ } else {
+ log.Println(
+ "stage2 is identical to stage3",
+ "("+pkg.Encode(checksum[0].Value())+")",
+ )
}
- } else {
- log.Println(
- "stage2 is identical to stage3",
- "("+pkg.Encode(checksum[0].Value())+")",
- )
- }
- return
- },
- )
+
+ if flagStage0 {
+ if pathname, _, err = cache.Cure(
+ rosa.Std.Load(rosa.Stage0),
+ ); err != nil {
+ return err
+ }
+ log.Println(pathname)
+ }
+
+ return
+ },
+ ).
+ Flag(
+ &flagStage0,
+ "stage0", command.BoolFlag(false),
+ "Create bootstrap stage0 tarball",
+ )
+ }
{
var (