fix(npm): add libc:glibc to linux-x64 and linux-arm64 packages (closes #116)#161
Merged
proggeramlug merged 1 commit intomainfrom Apr 23, 2026
Merged
fix(npm): add libc:glibc to linux-x64 and linux-arm64 packages (closes #116)#161proggeramlug merged 1 commit intomainfrom
proggeramlug merged 1 commit intomainfrom
Conversation
npm 9.4+ uses the `libc` field for optional-dependency filtering. When one package in a cpu/os group declares a `libc` (e.g. `perry-linux-x64-musl` with `libc:["musl"]`), npm 9.4+ expects the companion glibc package to also carry an explicit `libc:["glibc"]` — without it, glibc-x64 systems receive neither package and the wrapper errors with "The @perryts/perry-linux-x64 package is not installed". Add `"libc": ["glibc"]` to the two affected templates. The musl packages already have `"libc": ["musl"]`, so this makes the matrix symmetric. npm < 9.4 ignores the libc field entirely, so the change is backwards compatible. NOTE: a republish is required to push packages with the corrected package.json fields — the current @perryts/perry-linux-x64 and @perryts/perry-linux-arm64 on npm are missing the field. https://claude.ai/code/session_01U8z7eJFTmCu1LBxwzPjuty
4781a52 to
7043756
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #116 —
@perryts/perryon Linux x64 glibc fails with "The @perryts/perry-linux-x64 package is not installed".Root cause
npm 9.4+ introduced the
libcoptional-dependency field. When any package in acpu+osgroup carries an explicitlibcselector (here:@perryts/perry-linux-x64-musldeclares"libc": ["musl"]), npm 9.4+ expects the companion glibc package to also carry"libc": ["glibc"]. Without it, npm skips the untagged package on glibc systems, leaving no binary installed, and theperry.jswrapper throws:The user's npm 11.3.0 is a clean glibc install — the selector mismatch is entirely on the package side. This is the same problem esbuild and Bun ran into when they added musl variants: their fix was to add
"libc": ["glibc"]to the glibc packages, making the matrix symmetric.Changes
npm/perry-linux-x64/package.json.tmpl: add"libc": ["glibc"]npm/perry-linux-arm64/package.json.tmpl: add"libc": ["glibc"]The musl templates already have
"libc": ["musl"]. No other files changed.Backwards compatibility: npm < 9.4 ignores the
libcfield entirely, so the change has no effect on older npm versions — both glibc and musl packages install on all Linux x64/arm64, andperry.js'sisMusl()runtime check picks the right binary.Action required after merge
A republish is needed. The currently-published
@perryts/perry-linux-x64and@perryts/perry-linux-arm64on npmjs.com are missing thelibcfield. Triggeringrelease-packages.yml(workflow_dispatch withpublish_npm: true) against the current release tag will re-publish both packages with the correctedpackage.json.Test plan
npm install @perryts/perryon glibc Linux x64 (Ubuntu/Debian) with npm ≥ 9.4 —@perryts/perry-linux-x64should be selected and installednpm install @perryts/perryon musl Linux x64 (Alpine) —@perryts/perry-linux-x64-muslshould be selected; glibc package should be skippednpm install @perryts/perryon glibc Linux arm64 —@perryts/perry-linux-arm64should be selectednpm install @perryts/perryon npm < 9 (e.g. npm 8) on Linux x64 glibc — both glibc + musl packages install; wrapper picks glibc viaisMusl()returning falsehttps://claude.ai/code/session_01U8z7eJFTmCu1LBxwzPjuty
Generated by Claude Code