feat(crust): add musl Linux targets, drop legacy -baseline names
Summary
Bun-compiled Linux binaries link against glibc and do not start on musl distributions (Alpine). Ship -musl targets alongside, following the convention used by Bun's own npm package, Biome, swc, oxlint, and sharp. While touching the target table, drop the legacy -baseline suffix that Bun now treats as an alias for the single x64 binary.
# before
crust build --target bun-linux-x64-baseline
# after (both in the default set)
crust build --target bun-linux-x64 --target bun-linux-x64-musl
Behavior
| Surface | Before | After |
|---|---|---|
| Default Bun targets | 6 | 8 (+bun-linux-x64-musl, +bun-linux-arm64-musl) |
| Binary filenames | my-cli-bun-linux-x64-baseline | my-cli-bun-linux-x64 |
--target bun-linux-x64-baseline | accepted | Unknown target |
--package Linux package.json | os, cpu | os, cpu, libc: ["glibc"] / ["musl"] |
| Node launcher platform key | linux-x64 | linux-x64 or linux-x64-musl via process.report.header.glibcVersionRuntime |
| Bash resolver | uname -s-uname -m | same, -musl appended when ldd --version reports musl |
hostTarget() | ignores libc | libc-aware (Deno table returns null on musl hosts: no musl deno compile target) |
| Bash resolver shebang | #!/usr/bin/env bash | #!/bin/sh (Alpine ships no Bash) |
Manifest / crust publish | verifies os, cpu, bin | also records and verifies libc |
| Bun compiler floor | engines.bun >=1.3.14 | >=1.4.0 |
| Deno / Node runtimes | ā | unchanged |
Why libc matters: the glibc and musl packages share os/cpu, so without the field npm and pnpm install both (~75 MB each). npm honors it through npm-install-checks; Bun's own @oven/bun-linux-* packages added it in 1.4.
Why Bun 1.4 is required
Bun 1.4.0: "x64 releases now ship only the baseline build. The separate build compiled with -march=haswell is gone." On 1.3.x, bun-linux-x64 selects the AVX2 build and -baseline the Nehalem one (release zips differ by ~370 KB; on 1.4.2 they're the same binary). So the canonical names are only safe on 1.4+. Declared in engines only; no runtime probe and no migration hints, by design. Library packages keep their 1.3.14 floor; only the compiler needs 1.4.
Verification
bun run lint,bun run format,bun run check:types: passpackages/crustbun test: 81 pass;CRUST_SMOKE_PM=npmsmoke (realnpm installof staged packages): passpodman run node:alpine:glibcVersionRuntimeisundefined; launcher and bash resolver both select the musl binary and run; glibc binary fails withnot found(missingld-linux)podman run alpine(bare): musl binary fails onlibstdc++.so.6untilapk add libstdc++ libgcc; documented in the guide calloutpodman run node:alpinewithout Bash: POSIXdist/cliruns, including through a symlink- Bun 1.4.2 locally:
-musl-baselineoutput is byte-identical to-musl, confirming the suffix is inert
Not covered
packages/create-crust/tests/cli.smoke.test.tskeeps its own hand-rolled host-target picker that ignores musl; only relevant if that CI ever runs on Alpine. Left for a follow-up.- Not run on arm64 musl hardware; same table-driven path.