From 9836030c59f7a39d5df178133a80c98aef77f4d4 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 20 May 2026 09:01:40 +0900 Subject: [PATCH] internal/rosa: reinitialise frame alongside cache The cached frame can contain information made outdated by the DropCaches call. Signed-off-by: Ophestra --- internal/rosa/state.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/rosa/state.go b/internal/rosa/state.go index 5d3421f2..6142e4ac 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -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 } }