internal/rosa: key metadata by string

For upcoming azalea integration. The API is quite ugly right now to ease migration.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-17 13:07:12 +09:00
parent c2ff9c9fa5
commit 30eb0d6a61
95 changed files with 1514 additions and 1567 deletions

View File

@@ -28,7 +28,7 @@ var (
)
func TestMain(m *testing.M) {
rosa.DropCaches("", rosa.OptLLVMNoLTO)
rosa.Native().DropCaches("", rosa.OptLLVMNoLTO)
container.TryArgv0(nil)
code := m.Run()
@@ -77,10 +77,9 @@ func TestCureAll(t *testing.T) {
cache := getCache(t)
t.Parallel()
for i := range rosa.PresetEnd {
p := rosa.PArtifact(i)
meta := rosa.GetMetadata(p)
a := rosa.Std.Load(p)
for _, p := range rosa.Native().Collect() {
a, _ := rosa.Native().Load(rosa.Std, p)
meta := rosa.Native().MustGet(p)
t.Run(meta.Name, func(t *testing.T) {
t.Parallel()
@@ -94,14 +93,13 @@ func TestCureAll(t *testing.T) {
}
func BenchmarkStage3(b *testing.B) {
arch, flags := rosa.Arch(), rosa.Flags()
b.Cleanup(func() { rosa.DropCaches(arch, flags) })
s := rosa.Native().Clone()
for b.Loop() {
rosa.Std.Load(rosa.LLVM)
s.Load(rosa.Std, rosa.LLVM)
b.StopTimer()
rosa.DropCaches("", 0)
s.DropCaches("", 0)
b.StartTimer()
}
}