Files
bun.sh/test/cli
Claude Bot 34d1c70d06 fix(install): filter optional dependencies by libc field (#26156)
Implement support for the `libc` field in package.json, which is used by
packages like @rollup/rollup-linux-x64-gnu and @rollup/rollup-linux-x64-musl
to specify which libc variant they require.

Changes:
- Add `libc` field to lockfile `Meta` struct
- Implement compile-time libc detection (glibc vs musl on Linux, .all elsewhere)
- Update `isDisabled()` to check libc in addition to cpu and os
- Add `--libc` CLI flag for manually overriding libc (like `--cpu` and `--os`)
- Add libc serialization/deserialization for bun.lock and pnpm lockfiles
- Parse `libc` field from package.json

The isMatch logic handles backwards compatibility by treating `.none` (unset)
the same as `.all`, so packages without a libc field match any system libc.

Fixes #26156

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:04:11 +00:00
..