Skip to content

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

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

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

Conversation

@owlstronaut

@owlstronaut owlstronaut commented Feb 24, 2026

Copy link
Copy Markdown

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
nrslib added a commit to nrslib/takt that referenced this pull request May 15, 2026
Codex 環境の npm が v11.11.0 未満だったため、@anthropic-ai/claude-agent-sdk-linux-*
の libc フィールド (glibc/musl) が package-lock.json から剥がれていた。
npm 11.12.1 で main 同等に手動復元。

これは npm < 11.11.0 の既知バグで、npm/cli#9025 で 2026-02-24 に修正済み。
arborist v9.4.0 を同梱する npm v11.11.0 以降では libc 行を正しく保存する。
nrslib added a commit to nrslib/takt that referenced this pull request May 15, 2026
* feat: add opt-in observability foundation

* fix: stabilize observability foundation lifecycle

* fix: keep observability foundation scoped

* fix: preserve workflow errors during observability shutdown

* fix(deps): package-lock.json の libc 行を復元

Codex 環境の npm が v11.11.0 未満だったため、@anthropic-ai/claude-agent-sdk-linux-*
の libc フィールド (glibc/musl) が package-lock.json から剥がれていた。
npm 11.12.1 で main 同等に手動復元。

これは npm < 11.11.0 の既知バグで、npm/cli#9025 で 2026-02-24 に修正済み。
arborist v9.4.0 を同梱する npm v11.11.0 以降では libc 行を正しく保存する。

---------

Co-authored-by: nrslib <38722970+nrslib@users.noreply.github.com>
r2cuerdame pushed a commit to r2cuerdame/CodeSampleX that referenced this pull request Aug 14, 2026
Both claims were adversarially verified before filing them as upstream bug
reports: three independent agents each told to refute them, six out of six
refuted. Nothing was filed — and the same evidence showed that the samples
already published carried the overstatement.

npm-lightningcss-musl-prebuild attributed the lockfile fix to npm 12. It
shipped in npm 11.11.0 on 2026-02-24 (npm/cli#9025, closing npm/cli#8514),
which added libc to pkgMetaKeys in the shrinkwrap writer. Bisected on the
image: 10.9.8 through 11.10.1 omit it, 11.11.0 onward record it. The fix is
in the writer alone, so upgrading npm does not help — the lockfile has to be
regenerated. Also noted that a plain `npm install` from a libc-less lock
installs both variants too, and that rollup behaves identically, so neither
`npm ci` nor lightningcss is the boundary.

rs-serde-flatten-deny-unknown framed deny_unknown_fields with flatten as a
combination the derive lets through unchecked. serde_derive implements it
deliberately and serde's own test suite covers it, so the empty stderr means
the pair is supported rather than overlooked. The sample's assertions were
all correct — the flattened-map and flattened-struct behaviours are exactly
what it measured — so only the framing changed: serde's doc note is
over-broad, and the two broken shapes are known upstream (#1547, #2384).

Every assertion in both files still passes.

Also gitignore seeds/*/target: a cargo build directory is never published
and is a hundred megabytes of noise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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