internal/rosa: lazy initialise all artifacts
All checks were successful
Test / Create distribution (push) Successful in 48s
Test / Sandbox (push) Successful in 2m37s
Test / Hakurei (push) Successful in 4m5s
Test / ShareFS (push) Successful in 4m2s
Test / Hpkg (push) Successful in 4m33s
Test / Sandbox (race detector) (push) Successful in 4m59s
Test / Hakurei (race detector) (push) Successful in 5m57s
Test / Flake checks (push) Successful in 1m44s

This improves performance, though not as drastically as lazy initialising llvm.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-25 01:32:21 +09:00
parent 43b8a40fc0
commit 20790af71e
17 changed files with 174 additions and 94 deletions

View File

@@ -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)
}