mirror of
https://github.com/pnpm/pnpm.git
synced 2026-06-28 09:55:39 -04:00
* fix(importer): avoid partial package materialization under concurrent installs The fast import path destructively emptied the shared virtual-store directory before writing files directly into it. When multiple pnpm installs ran against the same workspace concurrently, one importer could wipe files another had already written; if the survivors included the package.json completion marker, every later install treated the broken directory as complete and never repaired it. The regular path now imports directly only when it can create the target directory exclusively (proving no concurrent importer), and otherwise builds the package in a private temp dir and atomically renames it into place. Close #12197 * fix(importer): clean up exclusively-created dir on failed import When the auto importer probes clone then falls back to hardlink/copy, the failed clone attempt left an empty exclusively-created directory behind, so the retry saw EEXIST and diverted to the staging path instead of writing directly. Since the directory was created exclusively (no other process writes into it), remove the partial result on failure so subsequent same-process method fallbacks can fast-path again.