Skip to content

[staging] prefetch-npm-deps: exclude deprecated field from packument whitelist - #481866

Merged
philiptaron merged 1 commit into
NixOS:stagingfrom
Mic92:prefetch-npm-deps-no-deprecated
Jan 20, 2026
Merged

philiptaron merged 1 commit into
NixOS:stagingfrom
Mic92:prefetch-npm-deps-no-deprecated

Conversation

@Mic92

@Mic92 Mic92 commented Jan 20, 2026 •

Copy link
Copy Markdown
Member

The 'deprecated' field can be modified by package maintainers at any time via 'npm deprecate', even for already-published versions. This causes hash mismatches when the npm registry adds deprecation notices to packages that were previously not deprecated.

For lockfile-based installs, the version is already resolved, so the deprecation hint used by npm-pick-manifest for version selection is not needed. The only behavioral change is that users won't see deprecation warnings during 'npm install', which is an acceptable tradeoff for reproducible builds.

This was discovered when [email protected] was deprecated upstream, breaking builds in downstream projects using fetcherVersion=2.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@Mic92 Mic92 changed the title prefetch-npm-deps: exclude deprecated field from packument whitelist [staging] prefetch-npm-deps: exclude deprecated field from packument whitelist Jan 20, 2026
The 'deprecated' field can be modified by package maintainers at any time
via 'npm deprecate', even for already-published versions. This causes
hash mismatches when the npm registry adds deprecation notices to packages
that were previously not deprecated.

For lockfile-based installs, the version is already resolved, so the
deprecation hint used by npm-pick-manifest for version selection is not
needed. The only behavioral change is that users won't see deprecation
warnings during 'npm install', which is an acceptable tradeoff for
reproducible builds.

This was discovered when [email protected] was deprecated upstream, breaking
builds in downstream projects using fetcherVersion=2.
@Mic92
Mic92 force-pushed the prefetch-npm-deps-no-deprecated branch from e8e6a18 to e11702f Compare January 20, 2026 08:11
@Mic92

Mic92 commented Jan 20, 2026

Copy link
Copy Markdown
Member Author

I have checked for safety also the other fields again in npm cli, if there is any registry endpoint that can be mutated and couldn't find anything that allows mutations of those.

@Mic92

Mic92 commented Jan 20, 2026

Copy link
Copy Markdown
Member Author

Since the fetcher change was only merged yesterday into staging, I don't think anyone uses it yet and we don't need to have another version bump if we merge this one quickly.

@nixpkgs-ci
nixpkgs-ci Bot requested a review from winterqt January 20, 2026 08:17
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment labels Jan 20, 2026
@philiptaron
philiptaron added this pull request to the merge queue Jan 20, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 20, 2026
Merged via the queue into NixOS:staging with commit d2fa26b Jan 20, 2026
@Mic92
Mic92 deleted the prefetch-npm-deps-no-deprecated branch January 20, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants