@pnpm/building.after-install 1101.0.21 → 1102.0.1

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.
@@ -18,6 +18,7 @@ export type StrictBuildOptions = {
18
18
  scriptsPrependNodePath: boolean | 'warn-only';
19
19
  shellEmulator: boolean;
20
20
  skipIfHasSideEffectsCache?: boolean;
21
+ frozenStore?: boolean;
21
22
  storeDir: string;
22
23
  storeController: StoreController;
23
24
  force: boolean;
@@ -43,6 +44,7 @@ export type StrictBuildOptions = {
43
44
  allowBuilds?: Record<string, boolean | string>;
44
45
  enableGlobalVirtualStore?: boolean;
45
46
  globalVirtualStoreDir?: string;
47
+ virtualStoreDir?: string;
46
48
  virtualStoreDirMaxLength: number;
47
49
  peersSuffixMaxLength: number;
48
50
  strictStorePkgContentCheck: boolean;
@@ -47,6 +47,16 @@ export async function extendBuildOptions(opts) {
47
47
  storeDir: defaultOpts.storeDir,
48
48
  };
49
49
  extendedOpts.registries = normalizeRegistries(extendedOpts.registries);
50
+ // Mirror extendInstallOptions: under a global virtual store, the virtual
51
+ // store directory is `<storeDir>/links`, not the per-project
52
+ // `node_modules/.pnpm`. Without this, getContext() in the build step
53
+ // defaults virtualStoreDir to the local `.pnpm` and writeModulesManifest
54
+ // overwrites the correct value the install step recorded — which makes the
55
+ // next install in that project detect a virtual-store mismatch and prompt
56
+ // to purge node_modules.
57
+ if (extendedOpts.enableGlobalVirtualStore && extendedOpts.virtualStoreDir == null) {
58
+ extendedOpts.virtualStoreDir = extendedOpts.globalVirtualStoreDir ?? path.join(extendedOpts.storeDir, 'links');
59
+ }
50
60
  return extendedOpts;
51
61
  }
52
62
  //# sourceMappingURL=extendBuildOptions.js.map
package/lib/index.js CHANGED
@@ -20,7 +20,7 @@ import { logger, streamParser } from '@pnpm/logger';
20
20
  import npa from '@pnpm/npm-package-arg';
21
21
  import { safeReadPackageJsonFromDir } from '@pnpm/pkg-manifest.reader';
22
22
  import { createStoreController } from '@pnpm/store.connection-manager';
23
- import { pickStoreIndexKey, StoreIndex } from '@pnpm/store.index';
23
+ import { pickStoreIndexKey, ReadOnlyStoreIndex, StoreIndex } from '@pnpm/store.index';
24
24
  import { hardLinkDir } from '@pnpm/worker';
25
25
  import pLimit from 'p-limit';
26
26
  import { runGroups } from 'run-groups';
@@ -243,7 +243,16 @@ async function _rebuild(ctx, opts) {
243
243
  return false;
244
244
  };
245
245
  const builtDepPaths = new Set();
246
- const storeIndex = opts.skipIfHasSideEffectsCache ? new StoreIndex(opts.storeDir) : undefined;
246
+ // This handle is read-only in practice (only `.get()` below); the
247
+ // side-effects upload writes through `storeController`, not here. Open it
248
+ // immutable under `frozenStore` so the read works against a read-only store
249
+ // — a writable open would fail creating the WAL/`-shm` sidecar there. The
250
+ // immutable open is gated on `frozenStore` because on a normal install the
251
+ // concurrent side-effects uploads mutate `index.db`, which immutable reads
252
+ // would not see.
253
+ const storeIndex = opts.skipIfHasSideEffectsCache
254
+ ? (opts.frozenStore ? new ReadOnlyStoreIndex(opts.storeDir) : new StoreIndex(opts.storeDir))
255
+ : undefined;
247
256
  // Under GVS, packages live at `<globalVirtualStoreDir>/<hash>/node_modules/<name>`,
248
257
  // not the classic virtualStoreDir layout. The hash is computed with the same inputs
249
258
  // as the installer so rebuild resolves the exact directory the install created.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/building.after-install",
3
- "version": "1101.0.21",
3
+ "version": "1102.0.1",
4
4
  "description": "Rebuild packages that are already installed by running their lifecycle scripts",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -32,38 +32,38 @@
32
32
  "load-json-file": "^7.0.1",
33
33
  "p-limit": "^7.3.0",
34
34
  "run-groups": "^5.0.0",
35
- "semver": "^7.8.1",
36
- "@pnpm/bins.linker": "1100.0.13",
37
- "@pnpm/building.pkg-requires-build": "1100.0.7",
38
- "@pnpm/building.policy": "1100.0.9",
39
- "@pnpm/config.normalize-registries": "1100.0.7",
40
- "@pnpm/config.reader": "1101.8.0",
41
- "@pnpm/core-loggers": "1100.2.0",
35
+ "semver": "^7.8.4",
36
+ "@pnpm/building.policy": "1100.0.10",
37
+ "@pnpm/config.normalize-registries": "1100.0.8",
38
+ "@pnpm/building.pkg-requires-build": "1100.0.8",
42
39
  "@pnpm/constants": "1100.0.0",
43
- "@pnpm/deps.graph-hasher": "1100.2.4",
44
- "@pnpm/deps.graph-sequencer": "1100.0.0",
45
- "@pnpm/deps.path": "1100.0.7",
46
- "@pnpm/exec.lifecycle": "1100.0.17",
40
+ "@pnpm/deps.graph-hasher": "1100.2.5",
41
+ "@pnpm/core-loggers": "1100.2.1",
42
+ "@pnpm/bins.linker": "1100.0.15",
43
+ "@pnpm/exec.lifecycle": "1100.1.0",
44
+ "@pnpm/installing.context": "1100.0.19",
45
+ "@pnpm/config.reader": "1101.10.0",
47
46
  "@pnpm/error": "1100.0.0",
48
- "@pnpm/installing.context": "1100.0.17",
49
- "@pnpm/installing.modules-yaml": "1100.0.8",
50
- "@pnpm/lockfile.types": "1100.0.10",
51
- "@pnpm/lockfile.walker": "1100.0.10",
52
- "@pnpm/lockfile.utils": "1100.0.12",
53
- "@pnpm/pkg-manifest.reader": "1100.0.7",
54
- "@pnpm/store.cafs": "1100.1.9",
55
- "@pnpm/store.connection-manager": "1100.2.8",
56
- "@pnpm/store.controller-types": "1100.1.4",
57
- "@pnpm/store.index": "1100.1.0",
58
- "@pnpm/types": "1101.3.1"
47
+ "@pnpm/installing.modules-yaml": "1100.0.9",
48
+ "@pnpm/lockfile.types": "1100.0.11",
49
+ "@pnpm/lockfile.utils": "1100.0.13",
50
+ "@pnpm/pkg-manifest.reader": "1100.0.8",
51
+ "@pnpm/store.cafs": "1100.1.10",
52
+ "@pnpm/deps.graph-sequencer": "1100.0.0",
53
+ "@pnpm/types": "1101.3.2",
54
+ "@pnpm/store.connection-manager": "1100.3.1",
55
+ "@pnpm/store.index": "1100.2.0",
56
+ "@pnpm/deps.path": "1100.0.8",
57
+ "@pnpm/lockfile.walker": "1100.0.11",
58
+ "@pnpm/store.controller-types": "1100.1.5"
59
59
  },
60
60
  "peerDependencies": {
61
- "@pnpm/logger": "^1001.0.1",
62
- "@pnpm/worker": "^1100.1.11"
61
+ "@pnpm/logger": "^1100.0.0",
62
+ "@pnpm/worker": "^1100.2.1"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@types/semver": "7.7.1",
66
- "@pnpm/building.after-install": "1101.0.21"
66
+ "@pnpm/building.after-install": "1102.0.1"
67
67
  },
68
68
  "engines": {
69
69
  "node": ">=22.13"