-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(plugin-pnpm): Content-addressable storage support #4533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to take some time to think about this; I may experiment myself with implementing some logic into the main copyPromise (perhaps it won't work anyway, but I'd like to better understand why).
} | { | ||
kind: DirEntryKind. DIRECTORY; | ||
} | { | ||
kind: DirEntryKind.SYMLINK; | ||
symlinkTo: PortablePath; | ||
}; | ||
|
||
const copyPromise = async (dstDir: PortablePath, srcDir: PortablePath, {baseFs, globalHardlinksStore, nmMode, packageChecksum}: {baseFs: FakeFS<PortablePath>, globalHardlinksStore: PortablePath | null, nmMode: {value: NodeModulesMode}, packageChecksum: string | null}) => { | ||
export const copyPromise = async (dstDir: PortablePath, srcDir: PortablePath, {baseFs, hardlinksStorePath, nmMode, packageChecksum}: {baseFs: FakeFS<PortablePath>, hardlinksStorePath: PortablePath | null, nmMode: {value: NodeModulesMode}, packageChecksum: string | null}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really not fan of having a separate copy
function... It was fine when it was bound to the nm linker, but if it leaks into the others it starts to become concerning imo 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review #4532 then, I've reopened it
This comment was marked as off-topic.
This comment was marked as off-topic.
Closed in favour of: #4586, although the latter has worse performance |
What's the problem this PR addresses?
This PR implements content-addressable storage support for
pnpm
linker vianmMode: hardlinks-global
config setting.Integrates PR: #4532
How did you fix it?
The PR is reusing
hardlinks-global
implementation fromnode-modules
linker.pnpm
linker link step timings on one of my rather big projects:master
(no hardlinks store): 18.9 secsnmMode: hardlinks-global
, empty store): 37.8 secsnmMode: hardlinks-global
, filled store): 15.2 secs, it is a bit slower than wihout hardlinks, because content addressable store needs more fs operations on packages without checksums, which is the case for conditional packages likefsevents
Checklist