aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-03 18:46:47 +0900
committerOphestra <cat@gensokyo.uk>2026-05-03 18:46:47 +0900
commita71a008f3c8324ab394e451b852cd9b21f072fab (patch)
tree2b0d7d0b81790eb51c322590316c64685849bae9
parent162265b47efb02ae7ed6d74f47c6fa95140129ae (diff)
cmd/mbf: optionally build on early stages
This makes debugging the bootstrap process much less cumbersome. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--cmd/mbf/main.go24
1 files changed, 21 insertions, 3 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go
index 291e91ef..44dd7b32 100644
--- a/cmd/mbf/main.go
+++ b/cmd/mbf/main.go
@@ -471,6 +471,9 @@ func main() {
flagExport string
flagRemote bool
flagNoReply bool
+
+ flagBoot bool
+ flagStd bool
)
c.NewCommand(
"cure",
@@ -484,11 +487,18 @@ func main() {
return fmt.Errorf("unknown artifact %q", args[0])
}
+ t := rosa.Std
+ if flagBoot {
+ t -= 2
+ } else if flagStd {
+ t -= 1
+ }
+
switch {
default:
var pathname *check.Absolute
err := cm.Do(func(cache *pkg.Cache) (err error) {
- pathname, _, err = cache.Cure(rosa.Std.Load(p))
+ pathname, _, err = cache.Cure(t.Load(p))
return
})
if err != nil {
@@ -541,7 +551,7 @@ func main() {
return cm.Do(func(cache *pkg.Cache) error {
return cache.EnterExec(
ctx,
- rosa.Std.Load(p),
+ t.Load(p),
true, os.Stdin, os.Stdout, os.Stderr,
rosa.AbsSystem.Append("bin", "mksh"),
"sh",
@@ -553,7 +563,7 @@ func main() {
if flagNoReply {
flags |= remoteNoReply
}
- a := rosa.Std.Load(p)
+ a := t.Load(p)
pathname, err := cureRemote(ctx, &addr, a, flags)
if !flagNoReply && err == nil {
log.Println(pathname)
@@ -591,6 +601,14 @@ func main() {
&flagNoReply,
"no-reply", command.BoolFlag(false),
"Do not receive a reply from the daemon",
+ ).Flag(
+ &flagBoot,
+ "boot", command.BoolFlag(false),
+ "Build on the stage0 toolchain",
+ ).Flag(
+ &flagStd,
+ "std", command.BoolFlag(false),
+ "Build on the intermediate toolchain",
)
}