{"record":{"id":"0d8875d54a9de3a6","repo":"oven-sh/bun","slug":"could-not-pack-the-install-fixture-pack-stderr","errorCode":null,"errorMessage":"could not pack the install fixture\n${pack.stderr}","messagePattern":"could not pack the install fixture\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/orderfile/generate.ts","lineNumber":260,"sourceCode":"    copyFileSync(join(here, \"cli-fixture.js\"), join(fixtures, \"cli.js\"));\n\n    // `bun install`, offline: the one dependency is a tarball packed by the binary\n    // we are about to trace, so a slow registry cannot cost a release its order\n    // file. The rest is the real path — lockfile, extraction, node_modules.\n    const dependency = join(fixtures, \"dep\");\n    const app = join(fixtures, \"app\");\n    mkdirSync(dependency);\n    mkdirSync(app);\n    writeFileSync(\n      join(dependency, \"package.json\"),\n      `{ \"name\": \"orderfile-dep\", \"version\": \"1.0.0\", \"main\": \"index.js\" }\\n`,\n    );\n    writeFileSync(join(dependency, \"index.js\"), `module.exports = 1;\\n`);\n    const pack = runCommand([bunProfile, \"pm\", \"pack\", \"--filename\", \"dep.tgz\"], {\n      cwd: dependency,\n      label: \"bun pm pack\",\n    });\n    if (pack.status !== 0) throw new Error(`could not pack the install fixture\\n${pack.stderr}`);\n    writeFileSync(\n      join(app, \"package.json\"),\n      `{ \"name\": \"orderfile-app\", \"version\": \"0.0.0\", ` +\n        `\"dependencies\": { \"orderfile-dep\": \"file:../dep/dep.tgz\" } }\\n`,\n    );\n    const installEnv = { BUN_INSTALL_CACHE_DIR: join(scratch, \"install-cache\") };\n\n    const workloads: Workload[] = [\n      { name: \"bun -e\", args: [\"-e\", \"console.log(1)\"] },\n      { name: \"bun hello.ts\", args: [join(fixtures, \"hello.ts\")] },\n      { name: \"bun server.js\", args: [join(fixtures, \"server.js\")] },\n      { name: \"bun test\", args: [\"test\", join(fixtures, \"tests\", \"example.test.ts\")] },\n      { name: \"bun install\", args: [\"install\"], cwd: app, env: installEnv },\n      { name: \"bun install (cached)\", args: [\"install\"], cwd: app, env: installEnv },\n      { name: \"bun cli.js (pipe)\", args: [join(fixtures, \"cli.js\")], input: CLI_INPUT },\n      {\n        name: \"bun cli.js (tty)\",\n        args: [join(fixtures, \"cli.js\")],","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/orderfile/generate.ts#L242-L278","documentation":"While constructing the `bun pm install` workload fixture, the generator runs `<bunProfile> pm pack --filename dep.tgz` inside a scratch dependency directory and that invocation exited non-zero; its stderr is appended. This exercises the traced binary itself, so failures usually indicate the binary — not the script — is broken.","triggerScenarios":"The bun-profile binary cannot execute in this environment (wrong arch, missing perm, dynamic loader issue); its `pm pack` implementation crashing; the scratch dir being unwritable or full.","commonSituations":"Tracing a binary built for another arch (e.g. x64 binary on arm64 without Rosetta); partially linked builds; sandboxed CI blocking tarball writes.","solutions":["Reproduce manually: run `<buildDir>/bun-profile pm pack --filename dep.tgz` in an empty dir with a minimal package.json","Confirm the binary executes at all: `file bun-profile` and `bun-profile --version`","Rebuild with `bun run build:release` if the binary is bad","Check scratch disk space/permissions if stderr suggests write failures"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import { spawnSync } from \"node:child_process\";\n\n// The traced binary must be able to run `pm pack` before we rely on it as a workload engine.\nconst smoke = spawnSync(bunProfile, [\"--version\"]);\nif (smoke.status !== 0) throw new Error(`${bunProfile} does not execute on this host — fix arch/perm before generating`);","typeGuard":null,"tryCatchPattern":"try {\n  createInstallFixture();\n} catch (err) {\n  if (/could not pack the install fixture/.test(String(err))) {\n    console.error(`Run \\`${bunProfile} pm pack\\` manually in a temp dir to see the underlying failure`);\n  }\n  throw err;\n}","preventionTips":["Verify the traced binary runs on the host (`bun-profile --version`) as the first step of any tracing session","Build and trace on the same platform/arch — do not reuse artifacts across machines"],"tags":["orderfile","package-manager","fixture","binary"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}