Replies: 1 comment
|
@zkochan I can work on this issue. Just want to clarify one detail: should both Happy to put together a PR for |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
--forceonpnpm installbundles two unrelated guarantees. Proposal: give each a name, and keep--forceas the documented union so nothing breaks.What
--forcemeans in pnpm v12 todaycpu/os/libc/enginesdo not match is materialized instead of skipped.These serve unrelated intents. (1) is "I am building a Linux image on a Mac." (2) is "my
node_modulesis wrong, rebuild it." Someone reaching for (2) also gets foreign-platform optional dependencies materialized into their tree, which they did not ask for and are unlikely to notice. Predictability is a core requirement in PHILOSOPHY.md, and one flag silently doing two things is in tension with it.Why this is smaller than it looks
pnpm v11's
--forcecarries at least six meanings:lockfileToDepGraph.ts:206packageRequester.ts:601install/index.ts:1931readLockfiles.ts:62node_modulespurge confirmationextendInstallOptions.ts:295link.ts:375v12 has already shed three of them. There is no
force_full_resolutionand noignore_incompatible, and store corruption is healed on the default path bycheck_pkg_files_integrity(verifyStoreIntegritydefaults totrue) rather than needing--force. So the decomposition only has to cover the two above.Prior art
Three patterns:
--force— npm, bun. npm's own documentation lists roughly ten unrelated effects.--force-depends,--force-overwrite,--force-confnew,--force-helpand--force-all.--force-reinstallrather than--force. composer has--ignore-platform-reqs. yarn berry has--check-cache,--refresh-lockfile,--immutable. cargo reserves--forceforcargo install, where it means exactly one thing.The useful signal is the direction of travel: tools that began with a blunt force have carved named flags out of it, not the reverse. npm added
--legacy-peer-depsbecause--forcewas too coarse for peer conflicts; composer split out--ignore-platform-reqs; git added--force-with-lease.Proposal
Not dpkg-style
--force-*namespacing — it keeps the word that means nothing and adds combinatorics. Name each concern:--ignore-platform-checksfor (1), or fold it into the existingsupportedArchitecturessetting, which already covers this ground at config level--reinstallfor (2)--forcestays, documented as the union of bothThis is additive, so it is not a breaking change, and it fits PHILOSOPHY.md's preference for expressing older features as cases of a new model rather than accumulating special cases. Existing CI scripts and npm muscle memory keep working.
Out of scope
pnpm storecurrently has onlyaddandstatus. If a "check my store and repair it" entry point is ever wanted it belongs there as a store subcommand, not as another meaning on--force.verify_fileskips re-hashing when a file's mtime is within 100 ms of its recordedchecked_at, so corruption that preserves mtime is not caught. Narrow, and unrelated to flag naming, but it is the one store-integrity case--forcecould in principle address and currently does not.Background
Came out of review on #15040, which fixed
--forcesuppressing the slot re-import that runs correctly by default (#15030). That fix belongs to meaning (2); this issue is about the naming, not the behavior.Written by an agent (Claude Code, claude-opus-5).
All reactions