Repository navigation
Fix pnpm installs of read-only package files - #347
aghiles-dd wants to merge 1 commit into
Conversation
👷 Deploy request for yarn-v6 pending review.Visit the deploys page to approve it
|
⏱️ Benchmark Resultsgatsby install-full-cold
📊 Raw benchmark data (gatsby install-full-cold)Base times: 4.279s, 4.304s, 4.399s, 4.352s, 4.341s, 4.441s, 4.447s, 4.368s, 4.413s, 4.346s, 4.385s, 4.423s, 4.440s, 4.436s, 4.341s, 4.350s, 4.350s, 4.460s, 4.357s, 4.422s, 4.333s, 4.342s, 4.369s, 4.439s, 4.378s, 4.329s, 4.456s, 4.330s, 4.470s, 4.424s Head times: 4.367s, 4.298s, 4.319s, 4.375s, 4.291s, 4.330s, 4.397s, 4.281s, 4.266s, 4.348s, 4.375s, 4.440s, 4.351s, 4.343s, 4.348s, 4.331s, 4.316s, 4.314s, 4.368s, 4.308s, 4.279s, 4.311s, 4.259s, 4.305s, 4.374s, 4.301s, 4.408s, 4.349s, 4.389s, 4.382s gatsby install-cache-only
📊 Raw benchmark data (gatsby install-cache-only)Base times: 1.321s, 1.319s, 1.311s, 1.291s, 1.294s, 1.314s, 1.311s, 1.314s, 1.303s, 1.311s, 1.300s, 1.301s, 1.323s, 1.326s, 1.301s, 1.313s, 1.304s, 1.301s, 1.298s, 1.289s, 1.301s, 1.302s, 1.305s, 1.306s, 1.302s, 1.295s, 1.304s, 1.302s, 1.299s, 1.311s Head times: 1.296s, 1.305s, 1.289s, 1.296s, 1.300s, 1.323s, 1.315s, 1.308s, 1.324s, 1.319s, 1.316s, 1.322s, 1.317s, 1.316s, 1.314s, 2.146s, 1.329s, 1.330s, 1.317s, 1.340s, 1.317s, 1.309s, 1.320s, 1.320s, 1.298s, 1.308s, 1.316s, 1.310s, 1.332s, 1.323s gatsby install-cache-and-lock (warm, with lockfile)
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))Base times: 0.366s, 0.378s, 0.367s, 0.371s, 0.376s, 0.372s, 0.370s, 0.371s, 0.374s, 0.384s, 0.373s, 0.371s, 0.378s, 0.380s, 0.381s, 0.369s, 0.368s, 0.374s, 0.382s, 0.378s, 0.373s, 0.373s, 0.419s, 0.367s, 0.366s, 0.366s, 0.363s, 0.367s, 0.372s, 0.374s Head times: 0.365s, 0.367s, 0.373s, 0.370s, 0.371s, 0.370s, 0.380s, 0.370s, 0.370s, 0.363s, 0.371s, 0.366s, 0.374s, 0.382s, 0.370s, 0.371s, 0.373s, 0.369s, 0.381s, 0.381s, 0.380s, 0.376s, 0.378s, 0.379s, 0.379s, 0.369s, 0.372s, 0.378s, 0.371s, 0.383s |
| // Write through the existing path: cross-project hardlinks | ||
| // inherit the repair without losing inode identity. | ||
| if index_path.fs_exists() { | ||
| index_path.fs_set_permissions(Permissions::from_mode(mode_bits | 0o200))?; |
There was a problem hiding this comment.
rather than checking for existence we should rather tolerate enoent errors (see ok_missing)
Problem
With Yarn 6.0.0-rc.22 and
nodeLinker: pnpm, installing a tarball containing a file with mode0555fails withPermission deniedinfs_extract_archive_impl.link_into_casapplies the read-only mode beforeset_safe_mtimereopens the entry for writing. The failed install leaves a read-only cache entry that subsequent installs cannot rewrite.Changes
Set the timestamp before restoring archive permissions. When repairing an existing cache entry, temporarily allow owner writes and repair it in place, preserving its inode and existing cross-project hardlinks.
Add one regression case to the existing content-addressed index suite covering installation and repair of a read-only file, including its final permissions.
Validation
git diff --checkpass.install --immutablepass in the affected monorepo with the patched binary.A fresh install of the affected monorepo with released Yarn 6.0.0-rc.22 and
nodeLinker: pnpmfails withPermission denied. Reproduced using a newYARN_GLOBAL_FOLDERwith an empty cache and content-addressed index.