Skip to content

fix: save libc field to package-lock.json#9025

Merged
owlstronaut merged 1 commit intolatestfrom
libc-fix
Feb 24, 2026
Merged

fix: save libc field to package-lock.json#9025
owlstronaut merged 1 commit intolatestfrom
libc-fix

Conversation

@owlstronaut
Copy link
Contributor

@owlstronaut owlstronaut commented Feb 24, 2026

Fixes: #8514

The libc field was missing from pkgMetaKeys in shrinkwrap.js, so it was never written to package-lock.json. This meant that on reinstall from a lockfile, checkPlatform couldn't distinguish between glibc and musl variants of optional dependencies — both would be installed instead of just the one matching the current platform.

The fix adds libc to pkgMetaKeys alongside os and cpu. This is purely additive — packages without libc are unaffected, and older npm versions will silently ignore the new field in lockfiles.

@owlstronaut owlstronaut requested a review from a team as a code owner February 24, 2026 19:29
@owlstronaut owlstronaut merged commit 07e6edd into latest Feb 24, 2026
16 checks passed
@owlstronaut owlstronaut deleted the libc-fix branch February 24, 2026 20:30
@github-actions github-actions bot mentioned this pull request Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] libc field is missing in package-lock.json

2 participants