PNPM cache not working on Workers build
Have not been able to make caching work for pnpm in workers build. Couple of issues I found:
- looking at the docs it states that the caching folder for pnpm is
- When outputting the location using
- Setting
- Set manually a cache location
- Set script to manually install
- Blasted the build cache
- Run a couple of builds to populate cache.
I'd expect the output of CI to be something like:
-
(Notice the
- Still seeing:
- Even when running this a couple of time with the same build-command
Not sure what heuristic is used for caching (I imagine
)
- On the docs, I see a section for
- Thought this might be the case. But could not find that option anywhere on my workers.
----
FWIW ...I'm using this in a mono-repo setup with a
Confusing docs:
- looking at the docs it states that the caching folder for pnpm is
.pnpm-store- When outputting the location using
pnpm store path it says it is /opt/buildhome/.local/share/pnpm/store/v3Forcing a location still downloads files
Tried debugging it by:- Setting
SKIP_DEPENDENCY_INSTALL true (I can see it working)- Set manually a cache location
pnpm config set store-dir ~/.pnpm-store (Validated it is set with an echo before and after)- Set script to manually install
Manually run pnpm install --prefer-offline - Blasted the build cache
- Run a couple of builds to populate cache.
I'd expect the output of CI to be something like:
-
Progress: resolved 2476, reused 2459, downloaded 0, added 2476, done(Notice the
downloaded 0)- Still seeing:
- Even when running this a couple of time with the same build-command
Not sure what heuristic is used for caching (I imagine
pnpm-lock.yaml ? Would be great to know that No build system options on workers setting
- On the docs, I see a section for
v2 to v3 Migration (here)- Thought this might be the case. But could not find that option anywhere on my workers.
----
FWIW ...I'm using this in a mono-repo setup with a
pnpm-workspace.yaml file