Repository navigation
[pull] main from pnpm:main - #518
Merged
Merged
Conversation
The optimistic-repeat-install fast path compares filesystem mtimes against the `lastValidatedTimestamp` recorded in `node_modules/.pnpm-workspace-state-v1.json`. That value is itself a filesystem mtime, so production keeps both sides of the comparison on one clock. The tests did not: they seeded the timestamp from `now_millis()` and ordered writes with `sleep(20ms)`, so every assertion depended on the wall clock and the kernel's coarse mtime clock staying close, and on sub-second mtimes existing at all. A whole-second-mtime filesystem collapses that gap to nothing. The tests now set mtimes explicitly instead. `backdate_existing_files` backdates a workspace tree and returns the matching timestamp, so earlier files read as validated and later ones as modified without sleeping. `bump_mtime` derives from the recorded timestamp rather than `SystemTime::now() + 2s`, which a baseline an earlier bump pushed into the future could outrank. Both keep a full second of separation, wider than any supported filesystem's mtime granularity. `build_workspace_state` keeps one wall-clock read, the fallback used when no lockfile and no manifest can be stat'd. It now goes through the `Clock` capability that `pnpm-modules-yaml` already exposes, so a `FrozenClock` fake drives it. That seam is the whole of the production diff and changes no behavior. Resolves #12730
…13982) Config drift the fast lockfile rewrites cannot absorb (a changed override, packageExtensions, patches) used to withhold the lockfile reuse seed entirely, leaving the walk with only the name-global preferred-versions bias. With several versions of one package locked, every open range (jest's @types/node: "*") then collapsed onto the highest locked version, churning unrelated lockfile entries - the mechanism behind the churn investigated in #13975. Two changes, mirroring the TypeScript resolver's split between forcing the walk (proceed) and unpinning (update): 1. The walk now takes the prior lockfile even when subtree reuse must be denied, via the new reuse_lockfile_subtrees flag: false keeps the lockfile as a per-edge version-pin source only. 2. The fresh-resolve path hard-pins a transitive edge whose recorded version still satisfies its hook-rewritten manifest range (the counterpart of replaceVersionInBareSpecifier under !update). Edges a changed override or extension actually reaches fail the satisfies gate and re-resolve; pacquet update targets and the stale-pin refresh keep re-picking. The TypeScript CLI already behaves this way, so nothing needs mirroring there.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )