-
Notifications
You must be signed in to change notification settings - Fork 5k
build: bun-standalone — reduced-footprint --compile runtime #32262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
bda4775
97fd0e9
de8eb91
535eeea
5c34fe8
dd34b28
eb087fc
cb8c88c
4907b67
87dbc85
14fe94c
f1a9925
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,7 +125,7 @@ function download_buildkite_artifact() { | |
| # (build-bun unsigned, windows-sign signed). Pin to the sign step to | ||
| # guarantee we get the signed one. | ||
| local step_args=() | ||
| if [[ -n "$WINDOWS_ARTIFACT_STEP" && "$name" == bun-windows-* ]]; then | ||
| if [[ -n "$WINDOWS_ARTIFACT_STEP" && ( "$name" == bun-windows-* || "$name" == bun-standalone-windows-* ) ]]; then | ||
| step_args=(--step "$WINDOWS_ARTIFACT_STEP") | ||
| fi | ||
| run_command buildkite-agent artifact download "$name" "$dir" "${step_args[@]}" | ||
|
|
@@ -238,6 +238,36 @@ function create_release() { | |
| bun-windows-aarch64-profile.zip | ||
| ) | ||
|
|
||
| # Reduced-footprint --compile runtime. Same triplets minus android/freebsd | ||
| # (see shouldBuildStandalone in .buildkite/ci.mjs). buildkite-agent artifact | ||
| # download without --step searches the whole build, so these are picked up | ||
| # from the *-build-bun-standalone steps. | ||
| local standalone_artifacts=( | ||
| bun-standalone-darwin-aarch64.zip | ||
| bun-standalone-darwin-aarch64-profile.zip | ||
| bun-standalone-darwin-x64.zip | ||
| bun-standalone-darwin-x64-profile.zip | ||
| bun-standalone-linux-aarch64.zip | ||
| bun-standalone-linux-aarch64-profile.zip | ||
| bun-standalone-linux-x64.zip | ||
| bun-standalone-linux-x64-profile.zip | ||
| bun-standalone-linux-x64-baseline.zip | ||
| bun-standalone-linux-x64-baseline-profile.zip | ||
| bun-standalone-linux-aarch64-musl.zip | ||
| bun-standalone-linux-aarch64-musl-profile.zip | ||
| bun-standalone-linux-x64-musl.zip | ||
| bun-standalone-linux-x64-musl-profile.zip | ||
| bun-standalone-linux-x64-musl-baseline.zip | ||
| bun-standalone-linux-x64-musl-baseline-profile.zip | ||
| bun-standalone-windows-x64.zip | ||
| bun-standalone-windows-x64-profile.zip | ||
| bun-standalone-windows-x64-baseline.zip | ||
| bun-standalone-windows-x64-baseline-profile.zip | ||
| bun-standalone-windows-aarch64.zip | ||
| bun-standalone-windows-aarch64-profile.zip | ||
| ) | ||
| artifacts+=("${standalone_artifacts[@]}") | ||
|
|
||
|
Comment on lines
+269
to
+270
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix contradictory standalone upload flow (mandatory + duplicate best-effort pass). Line 269 makes standalone artifacts required by appending them to Suggested fix- artifacts+=("${standalone_artifacts[@]}")
@@
- for artifact in "${artifacts[@]}"; do
- local standalone="${artifact/bun-/bun-standalone-}"
- ( upload_artifact "$standalone" ) || echo "warn: skipping missing standalone artifact: $standalone"
- done
+ for standalone in "${standalone_artifacts[@]}"; do
+ ( upload_artifact "$standalone" ) || echo "warn: skipping missing standalone artifact: $standalone"
+ doneAlso applies to: 292-295 🤖 Prompt for AI Agents |
||
| function upload_artifact() { | ||
| local artifact="$1" | ||
| download_buildkite_artifact "$artifact" | ||
|
|
@@ -255,6 +285,15 @@ function create_release() { | |
| upload_artifact "$artifact" | ||
| done | ||
|
|
||
| # bun-standalone-* zips ship alongside the regular zips. Derived from the | ||
| # main artifact list so a new platform can't be forgotten here. Best-effort: | ||
| # a missing standalone artifact warns but doesn't abort the release | ||
| # (download_buildkite_artifact's `exit 1` only kills the subshell). | ||
| for artifact in "${artifacts[@]}"; do | ||
| local standalone="${artifact/bun-/bun-standalone-}" | ||
| ( upload_artifact "$standalone" ) || echo "warn: skipping missing standalone artifact: $standalone" | ||
| done | ||
|
|
||
|
Comment on lines
+288
to
+296
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Two mutually-exclusive approaches for uploading standalone artifacts are both active: line 269 appends Extended reasoning...What the bug is
The comment on the second loop says "Derived from the main artifact list so a new platform can't be forgotten here" — but the main artifact list is no longer just the 30 regular zips; it's the 52-element combined array. Step-by-step traceAfter line 269, First loop (284-286) —
Second loop (292-295) — iterates the same 52 entries and applies
Net per release: 22 redundant download+upload cycles (~hundreds of MB to S3/GitHub) and 30 spurious "warn: skipping missing standalone artifact" lines. Why existing code doesn't prevent it
Impact
How to fixPick one approach: Option A (keep the explicit list): delete the second loop (lines 288-295) entirely. The first loop already handles everything. If best-effort semantics are desired for standalone, wrap those entries in a subshell or iterate Option B (keep derivation): delete Option A is simpler given the explicit list already exists and matches |
||
| update_github_release "$tag" | ||
| create_sentry_release "$tag" | ||
| send_discord_announcement "$tag" | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Centralize standalone triplet derivation.
The standalone artifact prefix is derived twice with
triplet.replace(/^bun-/, "bun-standalone-"). Please route both call sites through a helper such asgetTargetTriplet(platform, { standalone: true })so signing, size metadata, and packaging stay on one naming contract. As per coding guidelines, “One source of truth; update every consumer atomically.”Also applies to: 1020-1027
🤖 Prompt for AI Agents
Source: Coding guidelines