fix(release): listed worker --compile entrypoints in CI release script
- Added stats sync, browser tab, and JS eval workers as explicit --compile entrypoints in scripts/ci-release-build-binaries.ts so Bun emits them into bunfs in published binaries, matching the dev build script and the AGENTS.md worker spawn contract. - Switched the release-binary smoke step in .github/workflows/ci.yml to invoke --smoke-test (in addition to --version) so this regression cannot ship again. - Added packages/coding-agent/test/issue-1150-repro.test.ts pinning the symmetric contract: both build scripts must list every worker entry. Fixes #1150
This commit is contained in:
@@ -14,6 +14,20 @@ interface BinaryTarget {
|
||||
const repoRoot = path.join(import.meta.dir, "..");
|
||||
const binariesDir = path.join(repoRoot, "packages", "coding-agent", "binaries");
|
||||
const entrypoint = "./packages/coding-agent/src/cli.ts";
|
||||
// Worker entrypoints. Bun's `--compile` static analyzer discovers the
|
||||
// literal in `new Worker("…", …)` at each spawn site, but only actually
|
||||
// emits the worker into the bunfs root when it is also listed here as an
|
||||
// explicit additional entry. Paths are repo-root-relative (matching
|
||||
// `--root .` below) so the workers land at
|
||||
// `/$bunfs/root/packages/<pkg>/src/<worker>.js`, which is exactly what the
|
||||
// literals at the spawn sites resolve to. Keep this in sync with the dev
|
||||
// script at `packages/coding-agent/scripts/build-binary.ts`; the
|
||||
// `issue-1150-repro` test pins both halves of the contract.
|
||||
const workerEntrypoints = [
|
||||
"./packages/stats/src/sync-worker.ts",
|
||||
"./packages/coding-agent/src/tools/browser/tab-worker-entry.ts",
|
||||
"./packages/coding-agent/src/eval/js/worker-entry.ts",
|
||||
];
|
||||
const isDryRun = process.argv.includes("--dry-run");
|
||||
const targets: BinaryTarget[] = [
|
||||
{
|
||||
@@ -106,7 +120,7 @@ async function buildBinary(target: BinaryTarget): Promise<void> {
|
||||
console.log(`Building ${target.outfile}...`);
|
||||
await embedNative(target);
|
||||
if (isDryRun) {
|
||||
console.log(`DRY RUN bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --no-compile-autoload-tsconfig --no-compile-autoload-package-json --keep-names --define process.env.PI_COMPILED="true" --root . --external mupdf --target=${target.target} ${entrypoint} --outfile ${target.outfile}`);
|
||||
console.log(`DRY RUN bun build --compile --no-compile-autoload-bunfig --no-compile-autoload-dotenv --no-compile-autoload-tsconfig --no-compile-autoload-package-json --keep-names --define process.env.PI_COMPILED="true" --root . --external mupdf --target=${target.target} ${entrypoint} ${workerEntrypoints.join(" ")} --outfile ${target.outfile}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -132,6 +146,7 @@ async function buildBinary(target: BinaryTarget): Promise<void> {
|
||||
"--target",
|
||||
target.target,
|
||||
entrypoint,
|
||||
...workerEntrypoints,
|
||||
"--outfile",
|
||||
target.outfile,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user