@pnpm/fs.indexed-pkg-importer 1100.0.26 → 1100.0.27

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @pnpm/fs.indexed-pkg-importer
2
2
 
3
+ ## 1100.0.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Copying a built package to its other hoisted locations no longer replaces the destination directory. With `nodeLinker: hoisted`, that replacement deleted the dependencies nested inside the destination's `node_modules`, and made concurrent copies of the same build chunk fail with `ERR_PNPM_ENOENT: no such file or directory, rename '.../node_modules/_tmp_...'` [#12880](https://github.com/pnpm/pnpm/issues/12880).
8
+
9
+ - Updated dependencies:
10
+ - @pnpm/core-loggers@1100.3.4
11
+ - @pnpm/fs.graceful-fs@1100.2.0
12
+ - @pnpm/store.controller-types@1101.2.0
13
+
3
14
  ## 1100.0.26
4
15
 
5
16
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import util from 'node:util';
4
- import gfs from '@pnpm/fs.graceful-fs';
4
+ import gfs, { renameFileWithRetry } from '@pnpm/fs.graceful-fs';
5
5
  import { globalInfo, globalWarn, logger } from '@pnpm/logger';
6
6
  import { rimrafSync } from '@zkochan/rimraf';
7
7
  import fsx from 'fs-extra';
@@ -10,10 +10,7 @@ import { fastPathTemp as pathTemp } from 'path-temp';
10
10
  import { renameOverwriteSync } from 'rename-overwrite';
11
11
  import sanitizeFilename from 'sanitize-filename';
12
12
  const filenameConflictsLogger = logger('_filename-conflicts');
13
- const RENAME_RETRY_BUDGET_MS = 60_000;
14
- const RENAME_RETRY_BACKOFF_CAP_MS = 100;
15
13
  const FILE_COMPARE_BUFFER_SIZE = 64 * 1024;
16
- const renameRetrySleepBuffer = new Int32Array(new SharedArrayBuffer(4));
17
14
  export function importIndexedDir(importer, newDir, filenames, opts) {
18
15
  const dirImport = { importer, newDir, filenames, opts };
19
16
  // Content-addressed target (e.g. global virtual store): the path is shared
@@ -168,31 +165,6 @@ function replaceFileIfDifferent(importFile, src, dest) {
168
165
  throw err;
169
166
  }
170
167
  }
171
- // Retry a Windows sharing violation without rename-overwrite's fallback of
172
- // deleting the destination. Another install may still be reading that dirent.
173
- function renameFileWithRetry(src, dest) {
174
- const startedAt = Date.now();
175
- let backoffMs = 0;
176
- for (;;) {
177
- try {
178
- fs.renameSync(src, dest);
179
- return;
180
- }
181
- catch (err) {
182
- if (!isTransientRenameError(err) || Date.now() - startedAt >= RENAME_RETRY_BUDGET_MS)
183
- throw err;
184
- if (backoffMs > 0)
185
- Atomics.wait(renameRetrySleepBuffer, 0, 0, backoffMs);
186
- backoffMs = Math.min(backoffMs + 10, RENAME_RETRY_BACKOFF_CAP_MS);
187
- }
188
- }
189
- }
190
- function isTransientRenameError(err) {
191
- return process.platform === 'win32' &&
192
- util.types.isNativeError(err) &&
193
- 'code' in err &&
194
- (err.code === 'EPERM' || err.code === 'EACCES' || err.code === 'EBUSY');
195
- }
196
168
  // A rename cannot put a file where a directory is (EISDIR), so one standing in
197
169
  // the way has to go first. Only a damaged tree has one.
198
170
  function clearDirBlockingFile(dest) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/fs.indexed-pkg-importer",
3
- "version": "1100.0.26",
3
+ "version": "1100.0.27",
4
4
  "description": "Replicates indexed directories using hard links, copies, or cloning",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -37,9 +37,9 @@
37
37
  "test": "test"
38
38
  },
39
39
  "dependencies": {
40
- "@pnpm/core-loggers": "1100.3.3",
41
- "@pnpm/fs.graceful-fs": "1100.1.1",
42
- "@pnpm/store.controller-types": "1101.1.2",
40
+ "@pnpm/core-loggers": "1100.3.4",
41
+ "@pnpm/fs.graceful-fs": "1100.2.0",
42
+ "@pnpm/store.controller-types": "1101.2.0",
43
43
  "@reflink/reflink": "0.1.19",
44
44
  "@zkochan/rimraf": "^4.0.0",
45
45
  "fs-extra": "^11.4.0",
@@ -54,9 +54,9 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@jest/globals": "30.4.1",
57
- "@pnpm/fs.indexed-pkg-importer": "1100.0.26",
57
+ "@pnpm/fs.indexed-pkg-importer": "1100.0.27",
58
58
  "@pnpm/logger": "1100.0.0",
59
- "@pnpm/prepare": "1100.0.27",
59
+ "@pnpm/prepare": "1100.0.28",
60
60
  "@types/fs-extra": "^11.0.4"
61
61
  },
62
62
  "engines": {