{"record":{"id":"2d693594c411a411","repo":"xtekky/gpt4free","slug":"no-runtime-in-manifest-for-platform-q","errorCode":null,"errorMessage":"no runtime in manifest for platform %q","messagePattern":"no runtime in manifest for platform %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"g4f-go/download.go","lineNumber":66,"sourceCode":"\t\t}\n\t\treturn \"linux-x64\"\n\tcase \"windows\":\n\t\treturn \"windows-amd64\"\n\tcase \"darwin\":\n\t\tif arch == \"arm64\" {\n\t\t\treturn \"darwin-arm64\"\n\t\t}\n\t\treturn \"darwin-x64\"\n\t}\n\treturn runtime.GOOS + \"-\" + arch\n}\n\n// runtimeSpecForHost picks the manifest entry for this OS/arch.\nfunc runtimeSpecForHost(m *RuntimeManifest) (*RuntimeSpec, error) {\n\tkey := runtimeManifestKey()\n\tspec, ok := m.Platforms[key]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"no runtime in manifest for platform %q\", key)\n\t}\n\treturn &spec, nil\n}\n\n// partName is the temp file used while a download is in flight.\nfunc partName(binDir string) string {\n\treturn filepath.Join(binDir, \".g4f-runtime\", \"runtime.download\")\n}\n\n// installedOkName marks a fully verified runtime extraction.\nfunc installedOkName(binDir string) string {\n\treturn filepath.Join(binDir, \".g4f-runtime\", \".runtime-ok\")\n}\n\n// downloadRuntime fetches the manifest URL for this host into cachePath\n// (verifying size + sha256 when pinned) and reports live progress to stderr.\nfunc downloadRuntime(binDir, cachePath string, spec *RuntimeSpec) error {\n\tif err := os.MkdirAll(filepath.Dir(partName(binDir)), 0o755); err != nil {","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f-go/download.go#L48-L84","documentation":"runtimeSpecForHost in g4f-go/download.go builds a platform key from runtime.GOOS and arch (with darwin-arm64/darwin-x64 special-casing) and looks it up in the manifest's Platforms map. If no entry matches, it errors with 'no runtime in manifest for platform %q' — the shipped runtime.json simply has no build for your OS/architecture.","triggerScenarios":"Running the g4f-go launcher on a platform absent from runtime.json's Platforms map — e.g. linux-riscv64, windows-arm64, freebsd-amd64 — or with a stale/trimmed runtime.json embedded with the binary.","commonSituations":"Running on uncommon architectures (ARM Windows, RISC-V, BSD); using a very old binary whose manifest predates darwin-arm64; a hand-edited or corrupted embedded runtime.json.","solutions":["Print your key (GOOS + '-' + GOARCH) and check it exists under 'platforms' in runtime.json","Update the g4f-go binary/runtime.json to a release that ships your platform","If your platform is genuinely unsupported, install the Python runtime manually and point the tool at it, or build from source","On Apple Silicon, confirm the manifest uses the special key 'darwin-arm64' rather than 'darwin-arm64' variants like 'darwin-aarch64'"],"exampleFix":"// before\nspec, err := runtimeSpecForHost(m)  // no runtime in manifest for platform \"linux-riscv64\"\n\n// after\n// pre-check and give a clearer message\nkey := runtimeManifestKey()\nif _, ok := m.Platforms[key]; !ok {\n    log.Fatalf(\"unsupported platform %s; supported: %v\", key, platformKeys(m))\n}","handlingStrategy":"validation","validationCode":"key := runtimeManifestKey()\nif _, ok := m.Platforms[key]; !ok {\n    // fail early with supported-platform list before attempting install\n    log.Fatalf(\"unsupported platform %s; supported: %v\", key, platformKeys(m))\n}","typeGuard":"func platformSupported(m *RuntimeManifest, key string) bool {\n    _, ok := m.Platforms[key]\n    return ok\n}","tryCatchPattern":"spec, err := runtimeSpecForHost(m)\nif err != nil {\n    if strings.Contains(err.Error(), \"no runtime in manifest\") {\n        // surface supported platforms or fall back to a system Python\n    }\n    return err\n}","preventionTips":["Ship runtime.json entries for every OS/arch you claim to support (incl. darwin-arm64)","Validate the manifest against runtime.GOOS/GOARCH at startup, not mid-download","Keep the embedded manifest in lockstep with the binary release"],"tags":["go","runtime-manifest","platform-support","unsupported-platform"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}