{"record":{"id":"eb1347a599d07e8d","repo":"remotion-dev/remotion","slug":"run-bun-install-toolchain-ts-if-you-want-to-buil","errorCode":null,"errorMessage":"Run \"bun install-toolchain.ts\" if you want to build all platforms","messagePattern":"Run \"bun install-toolchain\\.ts\" if you want to build all platforms","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/compositor/build.ts","lineNumber":152,"sourceCode":"\t'x86_64-pc-windows-gnu': {\n\t\tfrom: `target/x86_64-pc-windows-gnu/${mode}/remotion.exe`,\n\t\tto: '../compositor-win32-x64-msvc/remotion.exe',\n\t\tdir: '../compositor-win32-x64-msvc',\n\t},\n};\n\nif (!hasCargo()) {\n\tconsole.log('Environment has no cargo. Skipping Rust builds.');\n\tprocess.exit(0);\n}\n\nconst nativeArch = getTarget();\n\nconst all = process.argv.includes('--all');\nconst cloudrun = process.argv.includes('--cloudrun');\nconst lambda = process.argv.includes('--lambda');\nif (!existsSync('toolchains') && all) {\n\tthrow new Error(\n\t\t'Run \"bun install-toolchain.ts\" if you want to build all platforms',\n\t);\n}\n\nfor (const toolchain of toolchains) {\n\tif (!existsSync(path.join('toolchains', toolchain)) && all) {\n\t\tthrow new Error(\n\t\t\t`Toolchain for ${toolchain} not found. Run \"node install-toolchain.mjs\" if you want to build all platforms`,\n\t\t);\n\t}\n}\n\nconst stdout = execSync('cargo metadata --format-version=1');\nconst {packages} = JSON.parse(stdout as unknown as string);\n\nconst rustFfmpegSys = packages.find((p) => p.name === 'ffmpeg-sys-next');\n\nif (!rustFfmpegSys) {","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/compositor/build.ts#L134-L170","documentation":"Thrown at the top of packages/compositor/build.ts when the --all flag is passed (build all target platforms) but the local 'toolchains' directory does not exist. Cross-compiling all platforms requires the cross toolchains installed by install-toolchain.ts, so the script aborts rather than failing later per-target.","triggerScenarios":"Running the compositor build with `--all` before running the toolchain installer, or after the toolchains directory was cleaned/deleted.","commonSituations":"A fresh checkout where `bun install-toolchain.ts` was never run; CI that runs the all-platforms build without the prerequisite setup step; a `clean` that removed the toolchains directory.","solutions":["Run `bun install-toolchain.ts` once to populate the toolchains directory before building with --all.","If you only need your native platform, drop the --all flag and the toolchains are not required.","Ensure your CI pipeline runs the toolchain installer step before the all-platforms build."],"exampleFix":"// before\nbun packages/compositor/build.ts --all\n\n// after\nbun packages/compositor/install-toolchain.ts\nbun packages/compositor/build.ts --all","handlingStrategy":"validation","validationCode":"if (process.argv.includes('--all') && !existsSync('toolchains')) {\n  throw new Error('Run bun install-toolchain.ts before building with --all');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `bun install-toolchain.ts` before any --all build.","Prefer --lambda or --cloudrun for single-target builds that don't need toolchains.","Add the toolchain install as a prerequisite CI step."],"tags":["compositor","build","toolchain","ci"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}