Repository navigation
fix: a warmed npm worktree's Windows build is cached again - #6655
Merged
Merged
Conversation
Collaborator
Author
|
Native E2E |
This was referenced Nov 28, 2026
janicduplessis
force-pushed
the
fix/6633-windows-install-carry
branch
from
November 29, 2026 00:08
2c2a24a to
7f0b328
Compare
janicduplessis
marked this pull request as ready for review
November 29, 2026 00:42
janicduplessis
enabled auto-merge (squash)
November 29, 2026 00:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On Windows, a native build in a worktree warmed from an npm checkout is installed but never cached: both worktrees of the nightly
android bare (loop, windows)lane printpackage-lock.json changed after the last install; the build will be installed but not cached, so worktree 2 cannot hit what worktree 1 built (#6634, #6628).Two things combine:
50ec9959e) the Windows carry copiesnode_moduleswith Node'sfs.cpinstead of MSYScp -R(since feat: clone with cow-clone on macOS, Linux and Windows instead of a compiled helper #6550 that is the fallback after cow-clone, which on NTFS reportsunsupported).fs.cpcopies each file withcopyFile, which on Windows keeps the source's last-write time, and a cow-clone on ReFS or a Dev Drive keeps it too. The carriednode_modules/.package-lock.jsonnow predates thepackage-lock.jsongit just checked out, sonewerThanInstallno longer passes on time order and has to read thewarmed-installrecord. Before, the copy stamped fresh times and the record was never needed on Windows, which is why the 2026-11-26 nightly (6ed3dd662) stored fine.prepareInstallCarrywrites that record only when the target'spackage.json, lockfile and patches hash the same as the source's. Git for Windows checks them out with CRLF (core.autocrlf=trueon the runner image; the nightly log showsLF will be replaced by CRLF), while the source checkout's install read LF files. The digests never match, so the record is never written.Solution
installInputDigesthashes each install input with CRLF folded to LF. A line-ending-only difference is git's conversion of the same committed blob, and npm, pnpm and yarn parse these files the same either way. Patch files are folded too: they come from the same blob, and the carriednode_modulesalready holds what the source applied. The digest is only compared in memory during the warm; nothing on disk changes shape, and the fingerprint key is untouched.I did not go back to fresh copy times. That would pass the gate by time order without checking the inputs at all.
Test plan
CRLF checkoutrow inthe cache gate checks the carried install with %s(worktree-warm.integration.test.ts): the target'spackage.json, lockfile and patch are multi-line CRLF versions of the source's LF files. It fails onmain(the warning is printed) and passes with the fix, on every platform.windows-debug.ymlrunner (NTFSD:,core.autocrlf=truefromC:/Program Files/Git/etc/gitconfig): a git-committed npm fixture with LFpackage.json/package-lock.jsonand an older-stampednode_modules/.package-lock.json, thenstim worktree add.main(19292c0): the worktree'spackage-lock.jsonis CRLF and written at checkout time, the carried.package-lock.jsonkeeps the source's exact mtime (21:45:27.8054532), and nowarmed-install.jsonis written.workspaces\wt2--...\warmed-install.jsonis written.the cache gate checks the carried install with %spass there, includingmatching inputsandCRLF checkout, which accept the carried install through the record on NTFS. Those rows never ran on Windows before; the second commit adds them to the Windowsclone (ntfs)andclone (refs)lanes of the full suite.suite=loop, run ontmp/6633-e2e-with-6659(this branch plus fix: pin cross-spawn 7.0.6, whose 7.1.0 breaks npm on Windows #6660, which the Windows fixture needs since cross-spawn 7.1.0),android bare (loop, windows)job 141156135471:fingerprint a8677a.. miss,wt1 cold build: the restored cross-run cache held no matching fingerprint, launched;fingerprint a8677a.. hit,cacheHit="local",CACHE PROOF: second worktree installed from cache without compiling,PASS bare-android;changed after the last installanywhere in the log.The first attempt of that job also printed no warning after its cold build, but failed
STIM_LAUNCH_FAILED(monkey) on an emulator that took 12m48s to boot. The other loop lanes passed.Fixes #6633. Refs #6634, #6628.