Unverified Commit 18dd4ff2 authored by Sefa Eyeoglu's avatar Sefa Eyeoglu Committed by GitHub
Browse files

fetchPnpmDeps: deprecate fetcherVersion = 1, schedule removal for 26.11 (#513215)

parents c993d2a2 6b6d15b8
Loading
Loading
Loading
Loading
+6 −17
Original line number Diff line number Diff line
@@ -483,40 +483,29 @@ In this example, `prePnpmInstall` will be run by both `pnpmConfigHook` and by th

#### pnpm `fetcherVersion` {#javascript-pnpm-fetcherVersion}

This is the version of the output of `fetchPnpmDeps`, if you haven't set it already, you can use `1` with your current hash:
This is the version of the output of `fetchPnpmDeps`. New packages should use `3`:

```nix
{
  # ...
  pnpmDeps = fetchPnpmDeps {
    # ...
    fetcherVersion = 1;
    hash = "..."; # you can use your already set hash here
  };
}
```

After upgrading to a newer `fetcherVersion`, you need to regenerate the hash:

```nix
{
  # ...
  pnpmDeps = fetchPnpmDeps {
    # ...
    fetcherVersion = 2;
    fetcherVersion = 3;
    hash = "..."; # clear this hash and generate a new one
  };
}
```

When upgrading to a newer `fetcherVersion`, you need to regenerate the hash.

This variable ensures that we can make changes to the output of `fetchPnpmDeps` without breaking existing hashes.
Changes can include workarounds or bug fixes to existing PNPM issues.

##### Version history {#javascript-pnpm-fetcherVersion-versionHistory}

- 1: Initial version, nothing special
- 1: Initial version, nothing special. **Deprecated: Scheduled for removal in the 26.11 release.**. New packages must not use this value.
- 2: [Ensure consistent permissions](https://github.com/NixOS/nixpkgs/pull/422975)
- 3: [Build a reproducible tarball](https://github.com/NixOS/nixpkgs/pull/469950)
- 3: [Build a reproducible tarball](https://github.com/NixOS/nixpkgs/pull/469950). **Recommended**

### Yarn {#javascript-yarn}

+6 −0
Original line number Diff line number Diff line
@@ -298,6 +298,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.

- `buildNpmPackage` now supports `npmDepsFetcherVersion` (and `fetchNpmDeps` now supports `fetcherVersion`). Set to `2` to enable packument caching, which fixes builds for projects using npm workspaces.

- Added `dell-bios-fan-control` package and service.
+133 −129
Original line number Diff line number Diff line
@@ -61,7 +61,11 @@ 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;

    stdenvNoCC.mkDerivation (
    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."

      stdenvNoCC.mkDerivation
      (
        finalAttrs:
        (
          args'