Skip to content

Commit 15db101

Browse files
fix: Bun Feature Failure on Apple Silicon ARM64 + Comprehensive Feature Enhancements
1 parent da70168 commit 15db101

3 files changed

Lines changed: 382 additions & 53 deletions

File tree

src/bun/NOTES.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,41 @@ Pin a specific version:
3434
## Support
3535

3636
- Distros: `Debian` / `Ubuntu` and `Alpine`
37-
- Architectures: `x86_64` and `arm64`
37+
- Architectures: `x86_64` and `arm64` (based on available Bun releases)
3838

3939
## Tests
4040

41-
This feature is tested against various Distro:
41+
This feature is tested against various Distros:
4242

43-
- `Ubuntu` (latest)
44-
- `Debian` (latest)
45-
- `Alpine` (latest)
46-
- `Debian` with a pinned version of Bun (e.g., Bun `v1.1.38`)
43+
- `Ubuntu` (glibc)
44+
- `Debian` (glibc)
45+
- `Alpine` (musl)
46+
- `Debian` with a pinned version of Bun
47+
48+
*Note: Only architectures with actual Bun release assets are supported (x86_64 and arm64).* *
49+
50+
## Architecture and Asset Selection
51+
52+
This feature automatically selects the correct Bun release asset based on the detected architecture and libc:
53+
54+
- **x86_64**: Uses "baseline" builds for optimal CPU compatibility (e.g., `bun-linux-x64-baseline.zip`)
55+
- **arm64**: Uses standard builds since "baseline" variants are not published for ARM64 (e.g., `bun-linux-aarch64.zip`)
56+
57+
The installation includes robust fallback logic:
58+
59+
- Primary: Preferred asset pattern for the detected architecture/libc combination
60+
- Fallback: Alternative patterns if the primary asset is not found
61+
- Error handling: Clear error messages if no suitable asset is available
62+
63+
This approach ensures compatibility across different platforms while gracefully handling potential future changes to Bun's release asset naming.
4764

4865
## Considerations / Future Enhancements
4966

50-
- If Bun’s release assets ever require explicit filtering, we can wire an `assetRegex` or pass `additionalFlags` to the `gh-release` helper. The helper already auto-filters by platform/arch, so no extra flags are set currently.
5167
- Coexistence with Node.js: this feature only installs `bun` and a `bunx` shim and does not modify Node.js.
5268
- PATH/profile: installation to `/usr/local/bin` avoids profile changes.
69+
- Asset regex patterns: the fallback chain ensures compatibility even if Bun changes their release asset naming conventions.
70+
71+
## Debugging
72+
73+
- To enable additional debug logs during installation, set the environment variable `BUN_FEATURE_DEBUG=1`.
74+
- Diagnostic logs from detection functions are emitted to stderr to keep return values clean.

src/bun/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "bun",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"name": "Bun",
55
"documentationURL": "http://github.com/devcontainers-extra/features/tree/main/src/bun",
66
"description": "Bun is an all-in-one toolkit for JavaScript and TypeScript apps.",

0 commit comments

Comments
 (0)