@pnpm/installing.deps-restorer 1101.1.2 → 1101.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -6,7 +6,7 @@ import { createAllowBuildFunction, isBuildExplicitlyDisallowed } from '@pnpm/bui
6
6
  import { LAYOUT_VERSION, WANTED_LOCKFILE, } from '@pnpm/constants';
7
7
  import { packageManifestLogger, progressLogger, stageLogger, statsLogger, summaryLogger, } from '@pnpm/core-loggers';
8
8
  import { lockfileToDepGraph, } from '@pnpm/deps.graph-builder';
9
- import { calcDepState } from '@pnpm/deps.graph-hasher';
9
+ import { calcDepState, findRuntimeNodeVersion } from '@pnpm/deps.graph-hasher';
10
10
  import * as dp from '@pnpm/deps.path';
11
11
  import { PnpmError } from '@pnpm/error';
12
12
  import { makeNodeRequireOption, runLifecycleHooksConcurrently, } from '@pnpm/exec.lifecycle';
@@ -625,6 +625,14 @@ async function linkAllPkgs(storeController, depNodes, opts) {
625
625
  needsBuildMarkerSrc = path.join(opts.storeDir, '.pnpm-needs-build-marker');
626
626
  await fs.writeFile(needsBuildMarkerSrc, '');
627
627
  }
628
+ // Resolved `engines.runtime` Node version (when present) anchors
629
+ // the side-effects-cache key prefix to the script-runner Node, not
630
+ // pnpm's own `process.version`. The restorer's `depGraph` is keyed
631
+ // by install directory, so scanning `Object.keys(opts.depGraph)`
632
+ // would never see a `node@runtime:<version>` entry — pull the
633
+ // depPath off each node instead. Computed once outside the
634
+ // per-node loop.
635
+ const nodeVersion = findRuntimeNodeVersion(depNodes.map((node) => node.depPath));
628
636
  await Promise.all(depNodes.map(async (depNode) => {
629
637
  if (!depNode.fetching)
630
638
  return;
@@ -645,6 +653,7 @@ async function linkAllPkgs(storeController, depNodes, opts) {
645
653
  includeDepGraphHash: !opts.ignoreScripts && depNode.requiresBuild, // true when is built
646
654
  patchFileHash: depNode.patch?.hash,
647
655
  supportedArchitectures: opts.supportedArchitectures,
656
+ nodeVersion,
648
657
  });
649
658
  }
650
659
  }
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import { linkBins } from '@pnpm/bins.linker';
3
3
  import { progressLogger, removalLogger, statsLogger, } from '@pnpm/core-loggers';
4
- import { calcDepState } from '@pnpm/deps.graph-hasher';
4
+ import { calcDepState, findRuntimeNodeVersion } from '@pnpm/deps.graph-hasher';
5
5
  import { logger } from '@pnpm/logger';
6
6
  import { rimraf } from '@zkochan/rimraf';
7
7
  import pLimit from 'p-limit';
@@ -17,6 +17,13 @@ export async function linkHoistedModules(storeController, graph, prevGraph, hier
17
17
  // We should avoid removing unnecessary directories while simultaneously adding new ones.
18
18
  // Doing so can sometimes lead to a race condition when linking commands to `node_modules/.bin`.
19
19
  await Promise.all(dirsToRemove.map((dir) => tryRemoveDir(dir)));
20
+ // Resolve the project's pinned runtime Node version once, before
21
+ // the recursive walk. The graph is keyed by install directory in
22
+ // this module, so scanning `Object.keys(graph)` would miss every
23
+ // `node@runtime:<version>` entry — pull the depPath off each
24
+ // node instead. Threading it down via `opts` also avoids a
25
+ // re-scan at every recursion level.
26
+ const nodeVersion = findRuntimeNodeVersion(Object.values(graph).map((node) => node.depPath));
20
27
  await Promise.all(Object.entries(hierarchy)
21
28
  .map(([parentDir, depsHierarchy]) => {
22
29
  function warn(message) {
@@ -27,6 +34,7 @@ export async function linkHoistedModules(storeController, graph, prevGraph, hier
27
34
  }
28
35
  return linkAllPkgsInOrder(storeController, graph, depsHierarchy, parentDir, {
29
36
  ...opts,
37
+ nodeVersion,
30
38
  warn,
31
39
  });
32
40
  }));
@@ -67,6 +75,7 @@ async function linkAllPkgsInOrder(storeController, graph, hierarchy, parentDir,
67
75
  includeDepGraphHash: !opts.ignoreScripts && depNode.requiresBuild, // true when is built
68
76
  patchFileHash: depNode.patch?.hash,
69
77
  supportedArchitectures: opts.supportedArchitectures,
78
+ nodeVersion: opts.nodeVersion,
70
79
  });
71
80
  }
72
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/installing.deps-restorer",
3
- "version": "1101.1.2",
3
+ "version": "1101.1.4",
4
4
  "description": "Fast installation using only pnpm-lock.yaml",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -35,37 +35,37 @@
35
35
  "path-exists": "^5.0.0",
36
36
  "ramda": "npm:@pnpm/ramda@0.28.1",
37
37
  "realpath-missing": "^2.0.0",
38
- "@pnpm/building.during-install": "1101.0.10",
39
- "@pnpm/config.package-is-installable": "1100.0.4",
40
- "@pnpm/bins.linker": "1100.0.6",
38
+ "@pnpm/bins.linker": "1100.0.8",
39
+ "@pnpm/building.during-install": "1101.0.12",
40
+ "@pnpm/config.package-is-installable": "1100.0.6",
41
+ "@pnpm/building.policy": "1100.0.6",
42
+ "@pnpm/core-loggers": "1100.1.1",
41
43
  "@pnpm/constants": "1100.0.0",
42
- "@pnpm/deps.graph-builder": "1100.0.9",
43
- "@pnpm/building.policy": "1100.0.4",
44
- "@pnpm/deps.path": "1100.0.3",
45
- "@pnpm/exec.lifecycle": "1100.0.10",
46
- "@pnpm/deps.graph-hasher": "1100.1.5",
44
+ "@pnpm/deps.graph-builder": "1100.0.11",
45
+ "@pnpm/deps.graph-hasher": "1100.2.1",
46
+ "@pnpm/deps.path": "1100.0.4",
47
47
  "@pnpm/error": "1100.0.0",
48
- "@pnpm/fs.symlink-dependency": "1100.0.3",
49
- "@pnpm/installing.linking.hoist": "1100.0.6",
50
- "@pnpm/installing.linking.direct-dep-linker": "1100.0.3",
51
- "@pnpm/installing.linking.modules-cleaner": "1100.1.1",
52
- "@pnpm/installing.linking.real-hoist": "1100.0.7",
53
- "@pnpm/lockfile.filtering": "1100.1.0",
54
- "@pnpm/lockfile.fs": "1100.0.8",
55
- "@pnpm/lockfile.utils": "1100.0.7",
56
- "@pnpm/pkg-manifest.reader": "1100.0.3",
57
- "@pnpm/patching.config": "1100.0.3",
58
- "@pnpm/core-loggers": "1100.0.2",
59
- "@pnpm/workspace.project-manifest-reader": "1100.0.5",
60
- "@pnpm/installing.modules-yaml": "1100.0.4",
61
- "@pnpm/lockfile.to-pnp": "1100.0.8",
62
- "@pnpm/types": "1101.1.0",
63
- "@pnpm/store.controller-types": "1100.0.7",
64
- "@pnpm/installing.package-requester": "1101.0.6"
48
+ "@pnpm/exec.lifecycle": "1100.0.12",
49
+ "@pnpm/fs.symlink-dependency": "1100.0.5",
50
+ "@pnpm/installing.linking.direct-dep-linker": "1100.0.5",
51
+ "@pnpm/installing.linking.real-hoist": "1100.0.9",
52
+ "@pnpm/installing.modules-yaml": "1100.0.5",
53
+ "@pnpm/installing.linking.hoist": "1100.0.8",
54
+ "@pnpm/installing.linking.modules-cleaner": "1100.1.3",
55
+ "@pnpm/installing.package-requester": "1101.0.8",
56
+ "@pnpm/lockfile.filtering": "1100.1.2",
57
+ "@pnpm/lockfile.to-pnp": "1100.0.10",
58
+ "@pnpm/lockfile.utils": "1100.0.9",
59
+ "@pnpm/pkg-manifest.reader": "1100.0.4",
60
+ "@pnpm/patching.config": "1100.0.4",
61
+ "@pnpm/lockfile.fs": "1100.1.1",
62
+ "@pnpm/types": "1101.1.1",
63
+ "@pnpm/store.controller-types": "1100.1.1",
64
+ "@pnpm/workspace.project-manifest-reader": "1100.0.7"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@pnpm/logger": ">=1001.0.0 <1002.0.0",
68
- "@pnpm/worker": "^1100.1.5"
68
+ "@pnpm/worker": "^1100.1.7"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@jest/globals": "30.3.0",
@@ -77,18 +77,18 @@
77
77
  "load-json-file": "^7.0.1",
78
78
  "tempy": "3.0.0",
79
79
  "write-json-file": "^7.0.0",
80
- "@pnpm/installing.deps-restorer": "1101.1.2",
80
+ "@pnpm/assert-project": "1100.0.10",
81
81
  "@pnpm/crypto.object-hasher": "1100.0.0",
82
- "@pnpm/installing.read-projects-context": "1100.0.9",
82
+ "@pnpm/installing.deps-restorer": "1101.1.4",
83
+ "@pnpm/installing.read-projects-context": "1100.0.11",
83
84
  "@pnpm/logger": "1100.0.0",
84
- "@pnpm/store.cafs": "1100.1.4",
85
- "@pnpm/prepare": "1100.0.8",
85
+ "@pnpm/prepare": "1100.0.10",
86
+ "@pnpm/store.cafs": "1100.1.6",
86
87
  "@pnpm/store.index": "1100.1.0",
87
- "@pnpm/test-ipc-server": "1100.0.0",
88
88
  "@pnpm/store.path": "1100.0.1",
89
- "@pnpm/testing.temp-store": "1100.0.16",
90
- "@pnpm/assert-project": "1100.0.8",
91
- "@pnpm/test-fixtures": "1100.0.0"
89
+ "@pnpm/test-ipc-server": "1100.0.0",
90
+ "@pnpm/test-fixtures": "1100.0.0",
91
+ "@pnpm/testing.temp-store": "1100.1.1"
92
92
  },
93
93
  "engines": {
94
94
  "node": ">=22.13"