{"record":{"id":"e59b02818e6ea7e7","repo":"github/copilot-sdk","slug":"runtime-package-is-missing-prebuilds-s-s-w","errorCode":null,"errorMessage":"runtime package is missing prebuilds/%s/%s: %w","messagePattern":"runtime package is missing prebuilds/(.+?)/(.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/cmd/bundler/main.go","lineNumber":489,"sourceCode":"\t\treturn bundleArtifacts{}, fmt.Errorf(\"runtime package is missing prebuilds/%s/runtime.node: %w\", info.runtimePlatform, err)\n\t}\n\truntimeHash, err := sha256File(rawLibPath)\n\tif err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash runtime.node: %w\", err)\n\t}\n\tif err := compressZstdFile(rawLibPath, runtimeArtifactPath); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to write runtime.node: %w\", err)\n\t}\n\n\twrapperName := runtimeWrapperName(info.binaryName)\n\trawWrapperPath := filepath.Join(tempDir, wrapperName)\n\tif err := extractFileFromTarball(\n\t\ttarballPath,\n\t\ttempDir,\n\t\t\"package/prebuilds/\"+info.runtimePlatform+\"/\"+wrapperName,\n\t\twrapperName,\n\t); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"runtime package is missing prebuilds/%s/%s: %w\", info.runtimePlatform, wrapperName, err)\n\t}\n\twrapperHash, err := sha256File(rawWrapperPath)\n\tif err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash runtime wrapper: %w\", err)\n\t}\n\tif err := compressZstdFile(rawWrapperPath, wrapperArtifactPath); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to write runtime wrapper: %w\", err)\n\t}\n\tif err := createRuntimeAssetsArchive(tarballPath, assetsArtifactPath, info); err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to write runtime assets: %w\", err)\n\t}\n\tassetsHash, err := sha256File(assetsArtifactPath)\n\tif err != nil {\n\t\treturn bundleArtifacts{}, fmt.Errorf(\"failed to hash runtime assets: %w\", err)\n\t}\n\n\tfmt.Printf(\"Successfully created %s\\n\", outputPath)\n\tfmt.Printf(\"Successfully created %s\\n\", runtimeArtifactPath)","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/go/cmd/bundler/main.go#L471-L507","documentation":"buildBundle extracts the platform runtime wrapper library (named by runtimeWrapperName(info.binaryName), e.g. a per-binary wrapper .node/.so) from the tarball at package/prebuilds/<runtimePlatform>/<wrapperName>. Failure — most often the entry being absent for the target platform — is wrapped with this message, echoing the platform and wrapper name it expected.","triggerScenarios":"extractFileFromTarball(tarballPath, tempDir, \"package/prebuilds/\"+info.runtimePlatform+\"/\"+wrapperName, ...) errors: the wrapper file is missing from prebuilds/<platform>/, the tarball is corrupt, or the archive entry cannot be written to tempDir.","commonSituations":"Bundling a custom-named binary whose wrapper prebuild was not published for that platform, using a runtime package version where wrapper naming changed, or targeting a platform without published wrapper artifacts (musl/arm variants).","solutions":["Inspect the archive (tar -tf pkg.tgz | grep prebuilds) to confirm the wrapper file exists under the resolved platform directory.","Use a runtime package version that publishes the wrapper for your platform, or bundle on a platform that is covered.","Check the wrapper naming convention (runtimeWrapperName) against the package's prebuild filenames; align binary name or upgrade the bundler.","Re-download the tarball and verify its checksum if extraction is corrupt rather than missing."],"exampleFix":"// before\nbundler --binary-name myapp --platform linux-arm64 ...\n// prebuilds/linux-arm64/myapp-wrapper.node missing\n\n// after\nbundler --binary-name default --platform linux-arm64 ...\n// or upgrade runtime pkg that publishes per-binary arm64 wrappers","handlingStrategy":"validation","validationCode":"wrapperName := runtimeWrapperName(info.binaryName)\nwant := \"package/prebuilds/\" + info.runtimePlatform + \"/\" + wrapperName\nentries, err := listTarball(tarballPath)\nif err != nil {\n\treturn err\n}\nfound := false\nfor _, e := range entries {\n\tif filepath.Clean(e) == want {\n\t\tfound = true\n\t}\n}\nif !found {\n\treturn fmt.Errorf(\"wrapper %s not published for %s; check supported platforms\", wrapperName, info.runtimePlatform)\n}","typeGuard":"func tarballHasEntry(tarballPath, name string) bool {\n\tf, err := os.Open(tarballPath)\n\tif err != nil {\n\t\treturn false\n\t}\n\tdefer f.Close()\n\tgz, err := gzip.NewReader(f)\n\tif err != nil {\n\t\treturn false\n\t}\n\tdefer gz.Close()\n\ttr := tar.NewReader(gz)\n\tfor {\n\t\thdr, err := tr.Next()\n\t\tif err == io.EOF {\n\t\t\treturn false\n\t\t}\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t\tif filepath.Clean(hdr.Name) == filepath.Clean(name) {\n\t\t\treturn true\n\t\t}\n\t}\n}","tryCatchPattern":"if err := buildBundle(...); err != nil {\n\tif strings.Contains(err.Error(), \"missing prebuilds\") && strings.Contains(err.Error(), wrapperName) {\n\t\tlog.Errorf(\"wrapper %s absent for %s; use a covered platform or a package version that ships it\", wrapperName, info.runtimePlatform)\n\t\treturn err\n\t}\n\treturn err\n}","preventionTips":["Verify the wrapper filename matches the package's prebuilds/<platform>/ listing before building custom-named binaries.","Pin runtime package versions known to ship wrappers for all target platforms.","Check runtimeWrapperName output against the actual archive entries when upgrading either the bundler or the package.","Validate the tarball checksum after download to avoid corrupt-archive false failures."],"tags":["prebuilds","wrapper","tarball","platform"],"backgroundTag":"resource-not-found","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}