{"record":{"id":"219f00a00f06c867","repo":"anomalyco/sst","slug":"unsupported-platform-s-s","errorCode":null,"errorMessage":"unsupported platform: %s %s","messagePattern":"unsupported platform: (.+?) (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/global/bun.go","lineNumber":102,"sourceCode":"\t\tfilename = \"bun-linux-x64-baseline.zip\"\n\t\tif cpuid.CPU.Has(cpuid.AVX2) {\n\t\t\tfilename = \"bun-linux-x64.zip\"\n\t\t}\n\t\tif isMusl {\n\t\t\tif cpuid.CPU.Has(cpuid.AVX2) {\n\t\t\t\tfilename = \"bun-linux-x64-musl.zip\"\n\t\t\t}\n\t\t\tfilename = \"bun-linux-x64-musl-baseline.zip\"\n\t\t}\n\tcase goos == \"windows\" && arch == \"amd64\":\n\t\tfilename = \"bun-windows-x64-baseline.zip\"\n\t\tif cpuid.CPU.Has(cpuid.AVX2) {\n\t\t\tfilename = \"bun-windows-x64.zip\"\n\t\t}\n\tdefault:\n\t}\n\tif filename == \"\" {\n\t\treturn fmt.Errorf(\"unsupported platform: %s %s\", goos, arch)\n\t}\n\tslog.Info(\"bun selected\", \"filename\", filename)\n\n\t_, err := task.Run(ctx, func() (any, error) {\n\t\turl := \"https://github.com/oven-sh/bun/releases/download/bun-v\" + BUN_VERSION + \"/\" + filename\n\t\tslog.Info(\"bun downloading\", \"url\", url)\n\t\tresponse, err := http.Get(url)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer response.Body.Close()\n\t\tif response.StatusCode != http.StatusOK {\n\t\t\treturn nil, fmt.Errorf(\"bad status: %s\", response.Status)\n\t\t}\n\t\tbodyBytes, err := io.ReadAll(response.Body)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/pkg/global/bun.go#L84-L120","documentation":"InstallBun maps (goos, arch) — with x64-mac additionally checked via ELF/Mach-O and Windows x64 via AVX2 — to a bun release asset name. If the combination has no known asset (filename stays empty), it returns 'unsupported platform: <goos> <arch>'.","triggerScenarios":"Running on an OS/arch pair outside the supported matrix: e.g. linux/riscv64, darwin/arm64 on very old tooling paths, freebsd, windows/arm64, or 32-bit builds.","commonSituations":"Deploying functions to a niche runtime architecture; building the CLI for an uncommon GOARCH; running on Windows ARM (e.g. Parallels on Apple Silicon) where AVX2 checks don't resolve a filename.","solutions":["Run on a supported platform (linux-x64, linux-arm64, darwin-x64/arm64, windows-x64)","Pre-install bun manually (curl -fsSL https://bun.sh/install | bash) so the global installer path isn't needed","Check GOOS/GOARCH of your binary and rebuild for a supported target"],"exampleFix":"// before\nGOOS=freebsd GOARCH=amd64 go build ./cmd/sst\n// after\nGOOS=linux GOARCH=amd64 go build ./cmd/sst","handlingStrategy":"fallback","validationCode":"switch runtime.GOOS + \"/\" + runtime.GOARCH {\ncase \"linux/amd64\", \"linux/arm64\", \"darwin/amd64\", \"darwin/arm64\", \"windows/amd64\":\n    // supported\ndefault:\n    return fmt.Errorf(\"unsupported platform %s/%s; install bun manually\", runtime.GOOS, runtime.GOARCH)\n}","typeGuard":"func isSupportedPlatform() bool {\n    goos, arch := runtime.GOOS, runtime.GOARCH\n    if goos == \"windows\" && arch != \"amd64\" { return false }\n    switch arch {\n    case \"amd64\", \"arm64\":\n        return goos == \"linux\" || goos == \"darwin\" || goos == \"windows\"\n    }\n    return false\n}","tryCatchPattern":"if err := global.InstallBun(ctx); err != nil {\n    if strings.Contains(err.Error(), \"unsupported platform\") {\n        return fmt.Errorf(\"please install bun manually: https://bun.sh\")\n    }\n    return err\n}","preventionTips":["Build/deploy only on the supported OS/arch matrix","Pre-install bun in base images to skip the auto-install path","Document platform requirements in CI setup steps"],"tags":["platform","bun","installation"],"backgroundTag":"unsupported-platform","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}