From 402cd6d6c28de15593bac9efd80ac9c95587778c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 10 Mar 2026 23:33:04 -0600 Subject: [PATCH] fix(flutter): include arch in rawcache tag to prevent collisions Flutter's API returns separate entries for universal (x64) and arm64 macOS builds under the same version/channel/os. The rawcache tag was version-channel-os, so arm64 overwrote universal. Now extracts arch from the archive path and appends it to the tag. Re-fetched flutter: +218 entries recovered. --- cmd/fetchraw/main.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/cmd/fetchraw/main.go b/cmd/fetchraw/main.go index 58f07de..37c6b56 100644 --- a/cmd/fetchraw/main.go +++ b/cmd/fetchraw/main.go @@ -400,8 +400,24 @@ func fetchFlutter(ctx context.Context, client *http.Client, cacheRoot, pkgName s return fmt.Errorf("flutterdist: %w", err) } for _, rel := range batch { - // Use version+channel+os as the tag to distinguish per-OS entries. + // Use version+channel+os+arch as the tag. The arch is embedded + // in the archive path (e.g. flutter_macos_arm64_3.0.0-stable.zip + // vs flutter_macos_3.0.0-stable.zip for universal/x64). + arch := "" + base := filepath.Base(rel.Archive) + prefix := "flutter_" + rel.OS + "_" + if after, ok := strings.CutPrefix(base, prefix); ok { + if !strings.HasPrefix(after, rel.Version) { + // There's an arch segment between OS and version. + if idx := strings.Index(after, "_"); idx > 0 { + arch = after[:idx] + } + } + } tag := fmt.Sprintf("%s-%s-%s", rel.Version, rel.Channel, rel.OS) + if arch != "" { + tag += "-" + arch + } data, err := json.Marshal(rel) if err != nil { return fmt.Errorf("flutterdist marshal %s: %w", tag, err)