{"record":{"id":"028ef70e0443a088","repo":"can1357/oh-my-pi","slug":"binary-build-did-not-produce-source","errorCode":null,"errorMessage":"Binary build did not produce ${source}","messagePattern":"Binary build did not produce (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/metaharness/src/tb/agent.ts","lineNumber":77,"sourceCode":"\tconst arches = [...new Set(opts.arches)];\n\tconst cached: Partial<Record<GuestArch, string>> = {};\n\tfor (const arch of arches) {\n\t\tcached[arch] = path.join(opts.cacheDir, `omp-linux-${arch}-${manifest.version}`);\n\t}\n\tconst missing: GuestArch[] = [];\n\tfor (const arch of arches) {\n\t\tif (opts.rebuild || !(await Bun.file(cached[arch]!).exists())) missing.push(arch);\n\t}\n\n\tif (missing.length > 0) {\n\t\tawait fs.mkdir(opts.cacheDir, { recursive: true });\n\t\tawait refreshCrossNatives(missing, manifest.version);\n\t\tconst targets = missing.map(arch => `linux-${arch}`).join(\",\");\n\t\tawait run([\"bun\", \"scripts/ci-release-build-binaries.ts\", \"--targets\", targets], REPO_ROOT);\n\t\tfor (const arch of missing) {\n\t\t\tconst source = path.join(CODING_AGENT_DIR, \"binaries\", `omp-linux-${arch}`);\n\t\t\tconst destination = cached[arch]!;\n\t\t\tif (!(await Bun.file(source).exists())) throw new Error(`Binary build did not produce ${source}`);\n\t\t\tawait Bun.write(destination, Bun.file(source));\n\t\t\tawait fs.chmod(destination, 0o755);\n\t\t}\n\t}\n\n\tconst binaries: AgentBinaries = { version: manifest.version };\n\tfor (const arch of arches) binaries[arch] = cached[arch];\n\treturn binaries;\n}\n\n/** Install omp and gateway-only configuration into one running trial microVM. */\nexport async function installAgent(vm: TrialVm, binaries: AgentBinaries, gateway: GatewayConfig): Promise<string> {\n\tconst binary = binaries[vm.arch];\n\tif (!binary) throw new Error(`No omp binary available for guest architecture ${vm.arch}`);\n\n\tconst entrypoint = \"/opt/omp/omp\";\n\tconst mkdir = await vm.exec(\"mkdir -p /opt/omp\");\n\tif (mkdir.exitCode !== 0) throw new Error(`Could not create /opt/omp: ${mkdir.stderr.trim()}`);","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/src/tb/agent.ts#L59-L95","documentation":"After invoking the binary build script for the missing guest architectures, prepareAgentBinaries verifies that `packages/coding-agent/binaries/omp-linux-<arch>` was produced and throws this error if not. It prevents caching a non-existent artifact and surfaces a build-script failure that exited 0 without emitting the binary.","triggerScenarios":"`bun scripts/ci-release-build-binaries.ts --targets <targets>` completed (possibly exit 0) but did not write `binaries/omp-linux-<arch>` for one of the requested targets — e.g. the script skipped an unsupported target, build output went elsewhere, or an inner step silently failed.","commonSituations":"Requesting an architecture the release script does not support; the script's output directory changed; disk-full or compile failure swallowed by the script; stale script version that ignores `--targets`.","solutions":["Run `bun scripts/ci-release-build-binaries.ts --targets linux-<arch>` manually and inspect its output","Check `packages/coding-agent/binaries/` for what was actually produced and whether the path/name changed","Confirm the requested arch is supported by the build script","Free disk space / fix toolchain errors if the build failed silently"],"exampleFix":"// before\nawait prepareAgentBinaries({ arches: [\"mips64\"], ... }); // build script never emits mips64\n// after\nconst supported = new Set([\"x64\", \"arm64\"]);\nconst missing = arches.filter(a => supported.has(a) && !cached[a]);","handlingStrategy":"validation","validationCode":"// verify build outputs exist before calling prepareAgentBinaries\nfor (const arch of arches) {\n  const p = path.join(CODING_AGENT_DIR, \"binaries\", `omp-linux-${arch}`);\n  if (!(await Bun.file(p).exists())) throw new Error(`build script will not produce ${p}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await prepareAgentBinaries({ arches, cacheDir, rebuild: true });\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Binary build did not produce\")) {\n    // fall back to a previously cached binary for that arch\n  } else throw err;\n}","preventionTips":["Confirm the release build script supports every requested target","Run the build script manually once and inspect binaries/ output","Check disk space and toolchain health before long builds","Keep the output path expectation in sync with the script"],"tags":["build","artifacts","verification"],"backgroundTag":"build-artifact-missing","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}