internal/rosa: reinitialise frame alongside cache
All checks were successful
Test / Create distribution (push) Successful in 1m4s
Test / Sandbox (push) Successful in 2m46s
Test / ShareFS (push) Successful in 3m43s
Test / Hakurei (push) Successful in 3m57s
Test / Sandbox (race detector) (push) Successful in 5m25s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 1m24s

The cached frame can contain information made outdated by the DropCaches call.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-20 09:01:40 +09:00
parent b482fd4abf
commit 9836030c59

View File

@@ -189,8 +189,6 @@ type S struct {
// Target architecture.
arch string
// For matching arch-specific values.
identArch unique.Handle[azalea.Ident]
// For initialising arch.
archOnce sync.Once
@@ -229,7 +227,6 @@ func (s *S) wantsArch() {
s.archOnce.Do(func() {
if s.arch == "" {
s.arch = runtime.GOARCH
s.identArch = unique.Make(azalea.Ident(s.arch))
}
})
}
@@ -248,11 +245,11 @@ func (s *S) DropCaches(targetArch string, flags int) {
}
s.arch = targetArch
s.identArch = unique.Make(azalea.Ident(s.arch))
s.opts = flags
for i := range s.c {
s.c[i].Clear()
}
s.frameOnce = sync.Once{}
}
// get returns the named [Artifact].
@@ -426,7 +423,8 @@ func (s *S) getFrame() azalea.Frame {
return unique.Make(azalea.Ident(name))
}
var identDefault = k("default")
identDefault := k("default")
identArch := unique.Make(azalea.Ident(s.arch))
enumCompress := map[unique.Handle[azalea.Ident]]any{
k("uncompressed"): uint32(pkg.TarUncompressed),
@@ -627,7 +625,7 @@ func (s *S) getFrame() azalea.Frame {
fallback = arg.V
continue
case s.identArch:
case identArch:
return arg.V, true, nil
}
}