Repository navigation
ci: build release binaries with Bun's AOT compiler - #3718
Merged
Merged
Conversation
Compile the binaries with `bun compile` (Bun canary) on a native runner per target, since AOT cannot cross-compile. Locally on linux-x64 the AOT binary starts in ~40 ms instead of ~220 ms with --bytecode and is 104 MB instead of 163 MB, and passes the whole E2E suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XcU6mYjWis3a6YpqCW2xgB
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Build the release binaries with Bun's ahead-of-time compiler (
bun compile, i.e.bun build --compile --aot) instead of--bytecode.AOT compiles the CLI to machine code at build time. Measured locally on linux-x64 (i7-7700K, WSL2) with hyperfine (
-N --warmup 2), same commit,generatewith--dry-run:--bytecode(Bun 1.4.4)dist/)--versiongenerate --targets claudecode --features rulesgenerate --targets '*' --features rulesgenerate --targets '*' --features '*'--versionIn CI, the
Test binarystep went from 200 s to 70 s on Linux x64 and from 389 s to 112 s on Windows (whose binary had no--bytecode), and the whole E2E workflow from ~11 min to ~5 min.The full E2E suite (1514 tests) passes against the AOT binary.
Changes
.github/actions/build-bun-binary: switches Bun to canary, prints its revision, runsbun compile --minify, and smoke-tests--version.ubuntu-latest(linux-x64),ubuntu-24.04-arm(linux-arm64),macos-latest(darwin-arm64),macos-15-intel(darwin-x64),windows-latest(windows-x64).e2e-binaries.yml: the separate build job and the binary cache are gone; each matrix leg builds its own binary and runs the E2E suite against it, so linux-arm64 and darwin-x64 are now tested too.publish-assets.yml: a newbuild-binariesmatrix job (read-only permissions) uploads each binary as an artifact;build-assetsdownloads them and continues as before (checksums, attestation, release upload). Asset names are unchanged.--sourcemapis dropped: with AOT only--sourcemap=externalhas an effect, and the binary already reports source positions.--bytecodebuild used to segfault; the AOT build is checked by the Windows E2E leg.Caveats
bun compile). Canary moves daily and cannot be pinned, so builds are not reproducible; the revision is printed in every build log. Once a stable Bun ships AOT,bun upgrade --canaryshould be removed.🤖 Generated with Claude Code
https://claude.ai/code/session_01XcU6mYjWis3a6YpqCW2xgB