diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index 1a03757..62588a3 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -477,17 +477,19 @@ func main() { "shell", "Interactive shell in the specified Rosa OS environment", func(args []string) error { - root := make([]pkg.Artifact, 0, 6+len(args)) - for _, arg := range args { + presets := make([]rosa.PArtifact, len(args)) + for i, arg := range args { p, ok := rosa.ResolveName(arg) if !ok { return fmt.Errorf("unknown artifact %q", arg) } - root = append(root, rosa.Std.Load(p)) + presets[i] = p } + root := make(rosa.Collect, 0, 6+len(args)) + root = rosa.Std.AppendPresets(root, presets...) if flagWithToolchain { - musl, compilerRT, runtimes, clang := rosa.Std.NewLLVM() + musl, compilerRT, runtimes, clang := (rosa.Std - 1).NewLLVM() root = append(root, musl, compilerRT, runtimes, clang) } else { root = append(root, rosa.Std.Load(rosa.Musl)) @@ -497,6 +499,12 @@ func main() { rosa.Std.Load(rosa.Toybox), ) + if _, _, err := cache.Cure(&root); err == nil { + return errors.New("unreachable") + } else if !errors.Is(err, rosa.Collected{}) { + return err + } + type cureRes struct { pathname *check.Absolute checksum unique.Handle[pkg.Checksum]