From f472a6385bfaf1a479dd9108d74b631e9bd5272e Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Sat, 9 May 2026 14:43:47 +0300 Subject: [PATCH] fetchPnpmDeps: deprecate fetcherVersion = 2 Extend the existing v1 deprecation warning to also fire for `fetcherVersion = 2`, since callers should migrate directly to `fetcherVersion = 3`. Both pre-v3 versions now share a single `lib.warnIf` keyed on `fetcherVersion < 3` and produce a message parameterised by the offending version. Consolidate the manual's version-history entries: the per-item **Deprecated** and **Recommended** labels are replaced by a single sentence above the list noting that v3 is recommended and v1/v2 are scheduled for removal. Add a release note mirroring the existing v1 entry. --- doc/languages-frameworks/javascript.section.md | 6 ++++-- doc/release-notes/rl-2605.section.md | 11 ++++++----- pkgs/build-support/node/fetch-pnpm-deps/default.nix | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index 362130e5ba5f..24581774482b 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -503,9 +503,11 @@ Changes can include workarounds or bug fixes to existing PNPM issues. ##### Version history {#javascript-pnpm-fetcherVersion-versionHistory} -- 1: Initial version, nothing special. **Deprecated: Scheduled for removal in the 26.11 release.**. New packages must not use this value. +Version 3 is the recommended value for new packages. Versions 1 and 2 are deprecated and scheduled for removal in the 26.11 release; existing packages must migrate. + +- 1: Initial version, nothing special. - 2: [Ensure consistent permissions](https://github.com/NixOS/nixpkgs/pull/422975) -- 3: [Build a reproducible tarball](https://github.com/NixOS/nixpkgs/pull/469950). **Recommended** +- 3: [Build a reproducible tarball](https://github.com/NixOS/nixpkgs/pull/469950) ### Yarn {#javascript-yarn} diff --git a/doc/release-notes/rl-2605.section.md b/doc/release-notes/rl-2605.section.md index 5953d676210c..3fc280aaf548 100644 --- a/doc/release-notes/rl-2605.section.md +++ b/doc/release-notes/rl-2605.section.md @@ -330,11 +330,12 @@ - `fetchPnpmDeps` and `pnpmConfigHook` were added as top-level attributes, replacing the now deprecated `pnpm.fetchDeps` and `pnpm.configHook` attributes. -- `fetchPnpmDeps`' `fetcherVersion = 1` is deprecated and scheduled for removal - in the 26.11 release. A deprecation warning has been added. Packages still on - `fetcherVersion = 1` should migrate to `fetcherVersion = 3` and regenerate - their hashes. See the [pnpm `fetcherVersion` - section](#javascript-pnpm-fetcherVersion) of the manual for details. +- `fetchPnpmDeps`' `fetcherVersion = 1` and `fetcherVersion = 2` are deprecated + and scheduled for removal in the 26.11 release. A deprecation warning has + been added. Packages still on `fetcherVersion = 1` or `fetcherVersion = 2` + should migrate to `fetcherVersion = 3` and regenerate their hashes. See the + [pnpm `fetcherVersion` section](#javascript-pnpm-fetcherVersion) of the + manual for details. - `buildNpmPackage` now supports `npmDepsFetcherVersion` (and `fetchNpmDeps` now supports `fetcherVersion`). Set to `2` to enable packument caching, which fixes builds for projects using npm workspaces. diff --git a/pkgs/build-support/node/fetch-pnpm-deps/default.nix b/pkgs/build-support/node/fetch-pnpm-deps/default.nix index 6b33c263b895..8547e222db5b 100644 --- a/pkgs/build-support/node/fetch-pnpm-deps/default.nix +++ b/pkgs/build-support/node/fetch-pnpm-deps/default.nix @@ -61,8 +61,8 @@ in "fetchPnpmDeps `fetcherVersion` is not set to a supported value (${lib.concatStringsSep ", " (map toString supportedFetcherVersions)}), see https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm-fetcherVersion." ) true; - lib.warnIf (fetcherVersion == 1) - "fetchPnpmDeps: `fetcherVersion = 1` is deprecated and scheduled for removal in the 26.11 release. Please migrate `${pname}` to `fetcherVersion = 3` and regenerate the hash. See https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm-fetcherVersion." + lib.warnIf (fetcherVersion < 3) + "fetchPnpmDeps: `fetcherVersion = ${toString fetcherVersion}` is deprecated and scheduled for removal in the 26.11 release. Please migrate `${pname}` to `fetcherVersion = 3` and regenerate the hash. See https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm-fetcherVersion." stdenvNoCC.mkDerivation (