Skip to content

feat(build): single-binary distribution via bun --compile#1

Merged
SWSAmor merged 2 commits into
mainfrom
feat/bun-compiled-binary
May 15, 2026
Merged

feat(build): single-binary distribution via bun --compile#1
SWSAmor merged 2 commits into
mainfrom
feat/bun-compiled-binary

Conversation

@SWSAmor
Copy link
Copy Markdown
Owner

@SWSAmor SWSAmor commented May 15, 2026

Summary

  • New bun build --compile pipeline producing standalone binaries for all five targets (darwin-arm64/x64, linux-x64/arm64, windows-x64); host build is ~63 MB.
  • Templates inlined at build time (scripts/embed-templates.ts + filesystem-first / embedded-fallback loader), so npm/npx/dev still reads from templates/ while the compiled binary uses the embedded copy.
  • Pyodide (13 MB WASM) lazy-loaded via dynamic import + --external pyodide, keeping it out of the binary unless PYTHON_SANDBOX_READY=true is set at runtime.
  • runtime-detect.ts heuristic on process.execPath skips the npm install -g self-bootstrap when running as the compiled binary.
  • .github/workflows/release.yml builds the 5-target matrix on tag push and attaches binaries + SHA256SUMS to a GitHub Release.
  • README updated: standalone-binary install path via Releases, plus a new "Build Standalone Binary (from Source)" section with mcpServers wiring example.

Smoke test (darwin-arm64, this branch)

  • npm run build:binary produced bin/code-executor-mcp (Mach-O 64-bit arm64, 63 MB).
  • Replaced command/args in ~/.mcp.json with the absolute binary path; Claude Code started the server cleanly (single process, no node/npx parent).
  • mcp__code-executor__healthhealthy: true, 350 wrapped tools connected.
  • executeTypescript round-trip through a child MCP (basic-memory.list_memory_projects) succeeded in 66 ms.

Test plan

  • CI: npm run build:binary succeeds on the host target.
  • CI: npm run build:binary:all cross-compiles all five targets.
  • CI: tagged push triggers .github/workflows/release.yml and attaches all five binaries + SHA256SUMS.
  • Manual: download a release binary on a clean machine without Node.js on PATH and run code-executor-mcp setup.
  • Manual: confirm Pyodide stays out of the binary unless PYTHON_SANDBOX_READY=true is set.

🤖 Generated with Claude Code

SWSAmor added 2 commits April 26, 2026 09:16
- Add `bun build --compile` build scripts producing standalone binaries for
  darwin-arm64/x64, linux-x64/arm64, windows-x64 (~63MB host target)
- Embed template files via auto-generated `src/cli/templates/embedded.ts`,
  with filesystem-first / embedded-fallback loader so npm/npx/dev still
  reads from `templates/` and the compiled binary uses inline strings
- Lazy-load pyodide (13MB WASM) via dynamic import — keeps it out of the
  compiled binary unless `PYTHON_SANDBOX_READY=true` enables it at runtime
- Skip `npm install -g` self-bootstrap when running as compiled binary
  (new `runtime-detect.ts` heuristic on `process.execPath`)
- Add `.github/workflows/release.yml` that builds the 5-target matrix on
  tag push and attaches binaries + SHA256SUMS to a GitHub Release
- README: document npm / bunx / standalone-binary install paths
…pServers

Adds an "Installation Options → Build Standalone Binary (from Source)"
section covering `npm run build:binary{,:all}`, Bun 1.1+ prerequisite,
template embedding step, and a sample mcpServers JSON snippet that
points `command` at the compiled binary instead of `npx`/`node`.
@SWSAmor SWSAmor merged commit 0b02959 into main May 15, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant