anomalyco/sst · error

unsupported platform: %s %s

Error message

unsupported platform: %s %s

What it means

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>'.

Source

Thrown at pkg/global/bun.go:102

		filename = "bun-linux-x64-baseline.zip"
		if cpuid.CPU.Has(cpuid.AVX2) {
			filename = "bun-linux-x64.zip"
		}
		if isMusl {
			if cpuid.CPU.Has(cpuid.AVX2) {
				filename = "bun-linux-x64-musl.zip"
			}
			filename = "bun-linux-x64-musl-baseline.zip"
		}
	case goos == "windows" && arch == "amd64":
		filename = "bun-windows-x64-baseline.zip"
		if cpuid.CPU.Has(cpuid.AVX2) {
			filename = "bun-windows-x64.zip"
		}
	default:
	}
	if filename == "" {
		return fmt.Errorf("unsupported platform: %s %s", goos, arch)
	}
	slog.Info("bun selected", "filename", filename)

	_, err := task.Run(ctx, func() (any, error) {
		url := "https://github.com/oven-sh/bun/releases/download/bun-v" + BUN_VERSION + "/" + filename
		slog.Info("bun downloading", "url", url)
		response, err := http.Get(url)
		if err != nil {
			return nil, err
		}
		defer response.Body.Close()
		if response.StatusCode != http.StatusOK {
			return nil, fmt.Errorf("bad status: %s", response.Status)
		}
		bodyBytes, err := io.ReadAll(response.Body)
		if err != nil {
			return nil, err
		}

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Run on a supported platform (linux-x64, linux-arm64, darwin-x64/arm64, windows-x64)
  2. Pre-install bun manually (curl -fsSL https://bun.sh/install | bash) so the global installer path isn't needed
  3. Check GOOS/GOARCH of your binary and rebuild for a supported target

Example fix

// before
GOOS=freebsd GOARCH=amd64 go build ./cmd/sst
// after
GOOS=linux GOARCH=amd64 go build ./cmd/sst
Defensive patterns

Strategy: fallback

Validate before calling

switch runtime.GOOS + "/" + runtime.GOARCH {
case "linux/amd64", "linux/arm64", "darwin/amd64", "darwin/arm64", "windows/amd64":
    // supported
default:
    return fmt.Errorf("unsupported platform %s/%s; install bun manually", runtime.GOOS, runtime.GOARCH)
}

Type guard

func isSupportedPlatform() bool {
    goos, arch := runtime.GOOS, runtime.GOARCH
    if goos == "windows" && arch != "amd64" { return false }
    switch arch {
    case "amd64", "arm64":
        return goos == "linux" || goos == "darwin" || goos == "windows"
    }
    return false
}

Try / catch

if err := global.InstallBun(ctx); err != nil {
    if strings.Contains(err.Error(), "unsupported platform") {
        return fmt.Errorf("please install bun manually: https://bun.sh")
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/219f00a00f06c867. Report an issue: GitHub.