diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-01-25 01:32:21 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-01-25 01:43:18 +0900 |
| commit | 20790af71ec9a69a462ecaaa7fc308e3b685383d (patch) | |
| tree | e7cfdd8fec51c5dc37db88ad887c07dee947b600 /cmd | |
| parent | 43b8a40fc0e8d99bf29531d33f1f57d0c6e9df5e (diff) | |
internal/rosa: lazy initialise all artifacts
This improves performance, though not as drastically as lazy initialising llvm.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/mbf/main.go | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index 329a885e..c382144f 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -143,24 +143,52 @@ func main() { if len(args) != 1 { return errors.New("cure requires 1 argument") } - var a pkg.Artifact + var p rosa.PArtifact switch args[0] { + case "autoconf": + p = rosa.Autoconf + case "bash": + p = rosa.Bash case "busybox": - a = rosa.Std.NewBusybox() - case "musl": - a = rosa.Std.NewMusl(nil) + p = rosa.Busybox + case "cmake": + p = rosa.CMake + case "coreutils": + p = rosa.Coreutils + case "diffutils": + p = rosa.Diffutils + case "gettext": + p = rosa.Gettext case "git": - a = rosa.Std.NewGit() + p = rosa.Git case "go": - a = rosa.Std.NewGo() + p = rosa.Go + case "kernel-headers": + p = rosa.KernelHeaders + case "libffi": + p = rosa.Libffi + case "m4": + p = rosa.M4 + case "make": + p = rosa.Make + case "ninja": + p = rosa.Ninja + case "perl": + p = rosa.Perl + case "patch": + p = rosa.Patch + case "python": + p = rosa.Python case "rsync": - a = rosa.Std.NewRsync() + p = rosa.Rsync + case "zlib": + p = rosa.Zlib default: return fmt.Errorf("unsupported artifact %q", args[0]) } - pathname, _, err := cache.Cure(a) + pathname, _, err := cache.Cure(rosa.Std.Load(p)) if err == nil { log.Println(pathname) } |
