Is there a way to install the virtual store but not create node_module symlinks? #7294
Unanswered
jfirebaugh
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Can you validate at all if this will work? You can validate it with the symlinks present too. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For CI optimization purposes, I would like to cache the virtual store. Yes, I know the content-addressable store is the recommended thing to cache. But in practice, in large monorepos, even cloning or hardlinking from CAS to virtual store can take upwards of 20 seconds or more if the virtual store is empty. In other words, caching the virtual store produces faster builds than caching the CAS. Symlinking a workspace package's node_modules to the virtual store is negligible in comparison and can be uncached.
Is there a way to install the virtual store but not create symlinked node_modules for any workspace packages?
The reason I want to avoid creating any node_module symlinks is that I would like to be able to create a fresh cache artifact in any CI job which detects that the checksum of pnpm-lock.yaml has changed. The job that ends up saving the cache artifact typically wants to do
pnpm install --filter ./package/foo
to avoid time spent symlinking anything but what's needed for that job. (Although unfortunatelypnpm install --filter
is currently not working.) The desired caching algorithm is:pnpm-virtual-store-$(checksum pnpm-lock.yaml)
exists, restore it.pnpm install --only-virtual-store
(hypothetical option that creates a fully populatednode_modules/.pnpm
but nothing else). Storenode_modules/.pnpm
to the keypnpm-virtual-store-$(checksum pnpm-lock.yaml)
.pnpm install --filter <desired filter>
. This should be fast as the only thing it needs to do is generate symlinks for a subset of workspace packages.Beta Was this translation helpful? Give feedback.
All reactions