github/copilot-sdk · error

runtime package is missing prebuilds/

Error message

runtime package is missing prebuilds/%s/%s: %w

What it means

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.

Solutions

  1. Inspect the archive (tar -tf pkg.tgz | grep prebuilds) to confirm the wrapper file exists under the resolved platform directory.
  2. Use a runtime package version that publishes the wrapper for your platform, or bundle on a platform that is covered.
  3. Check the wrapper naming convention (runtimeWrapperName) against the package's prebuild filenames; align binary name or upgrade the bundler.
  4. Re-download the tarball and verify its checksum if extraction is corrupt rather than missing.

Example fix

// before
bundler --binary-name myapp --platform linux-arm64 ...
// prebuilds/linux-arm64/myapp-wrapper.node missing

// after
bundler --binary-name default --platform linux-arm64 ...
// or upgrade runtime pkg that publishes per-binary arm64 wrappers
Defensive patterns

Strategy: validation

Validate before calling

wrapperName := runtimeWrapperName(info.binaryName)
want := "package/prebuilds/" + info.runtimePlatform + "/" + wrapperName
entries, err := listTarball(tarballPath)
if err != nil {
	return err
}
found := false
for _, e := range entries {
	if filepath.Clean(e) == want {
		found = true
	}
}
if !found {
	return fmt.Errorf("wrapper %s not published for %s; check supported platforms", wrapperName, info.runtimePlatform)
}

Type guard

func tarballHasEntry(tarballPath, name string) bool {
	f, err := os.Open(tarballPath)
	if err != nil {
		return false
	}
	defer f.Close()
	gz, err := gzip.NewReader(f)
	if err != nil {
		return false
	}
	defer gz.Close()
	tr := tar.NewReader(gz)
	for {
		hdr, err := tr.Next()
		if err == io.EOF {
			return false
		}
		if err != nil {
			return false
		}
		if filepath.Clean(hdr.Name) == filepath.Clean(name) {
			return true
		}
	}
}

Try / catch

if err := buildBundle(...); err != nil {
	if strings.Contains(err.Error(), "missing prebuilds") && strings.Contains(err.Error(), wrapperName) {
		log.Errorf("wrapper %s absent for %s; use a covered platform or a package version that ships it", wrapperName, info.runtimePlatform)
		return err
	}
	return err
}

Prevention

When it happens

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

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

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09). Data as JSON: /api/errors/e59b02818e6ea7e7. Report an issue: GitHub.

Appendix: source

Thrown at go/cmd/bundler/main.go:489

		return bundleArtifacts{}, fmt.Errorf("runtime package is missing prebuilds/%s/runtime.node: %w", info.runtimePlatform, err)
	}
	runtimeHash, err := sha256File(rawLibPath)
	if err != nil {
		return bundleArtifacts{}, fmt.Errorf("failed to hash runtime.node: %w", err)
	}
	if err := compressZstdFile(rawLibPath, runtimeArtifactPath); err != nil {
		return bundleArtifacts{}, fmt.Errorf("failed to write runtime.node: %w", err)
	}

	wrapperName := runtimeWrapperName(info.binaryName)
	rawWrapperPath := filepath.Join(tempDir, wrapperName)
	if err := extractFileFromTarball(
		tarballPath,
		tempDir,
		"package/prebuilds/"+info.runtimePlatform+"/"+wrapperName,
		wrapperName,
	); err != nil {
		return bundleArtifacts{}, fmt.Errorf("runtime package is missing prebuilds/%s/%s: %w", info.runtimePlatform, wrapperName, err)
	}
	wrapperHash, err := sha256File(rawWrapperPath)
	if err != nil {
		return bundleArtifacts{}, fmt.Errorf("failed to hash runtime wrapper: %w", err)
	}
	if err := compressZstdFile(rawWrapperPath, wrapperArtifactPath); err != nil {
		return bundleArtifacts{}, fmt.Errorf("failed to write runtime wrapper: %w", err)
	}
	if err := createRuntimeAssetsArchive(tarballPath, assetsArtifactPath, info); err != nil {
		return bundleArtifacts{}, fmt.Errorf("failed to write runtime assets: %w", err)
	}
	assetsHash, err := sha256File(assetsArtifactPath)
	if err != nil {
		return bundleArtifacts{}, fmt.Errorf("failed to hash runtime assets: %w", err)
	}

	fmt.Printf("Successfully created %s\n", outputPath)
	fmt.Printf("Successfully created %s\n", runtimeArtifactPath)

View on GitHub (pinned to cd8cf15dc3)