Skip to content
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

Cache issue in pnpm 7 #479

Closed
2 of 5 tasks
ai opened this issue May 1, 2022 · 9 comments
Closed
2 of 5 tasks

Cache issue in pnpm 7 #479

ai opened this issue May 1, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@ai
Copy link

ai commented May 1, 2022

Description:

If we are using pnpm 7 with cache: pnpm in actions/setup-node@v3 and avoid installing dependencies we will have error:

Error: Cache folder path is retrieved for pnpm but doesn't exist on disk: /home/runner/.local/share/pnpm/store/v3

Action version: 3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

pnpm 7.0.0

Repro steps:

jobs:
  repro:
    - name: Install pnpm
        uses: pnpm/action-setup@v2
        with:
          version: latest
      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 18
          registry-url: "https://registry.npmjs.org"
          scope: caniuse-lite
          cache: pnpm

Example

Expected behavior:

No error

Actual behavior:

> Post Install Node.js
1s
Post job cleanup.
/home/runner/setup-pnpm/node_modules/.bin/pnpm store path
/home/runner/.local/share/pnpm/store/v3
Error: Cache folder path is retrieved for pnpm but doesn't exist on disk: /home/runner/.local/share/pnpm/store/v3
@ai ai added bug Something isn't working needs triage labels May 1, 2022
@dmitry-shibanov
Copy link
Contributor

Hello @ai. Thank you for your report. It looks like the step with installation dependencies was skipped, that is why the error was thrown, because it was nothing to save.

@ai
Copy link
Author

ai commented May 1, 2022

@dmitry-shibanov yes. I temporary enable pnpm install for every case.

But it doesn’t look like a proper solution for me.

@dmitry-shibanov
Copy link
Contributor

The setup-node action does not cache node_modules. It caches global cache directory. Besides, you're using latest version for the pnpm action and I think it has started to use the latest 7th version of pnpm, that is why path to global dependencies path could change and the setup-node action can't use the previous cache.

@dmitry-shibanov
Copy link
Contributor

Hello @ai, just a gentle ping.

@ai
Copy link
Author

ai commented May 2, 2022

@dmitry-shibanov yes, I understand it. I just do not understand why we fail CI in this case and do not ignore the missed folder?

@dmitry-shibanov
Copy link
Contributor

Hello @ai. Thank you for your response. It's an expected behaviour. For more information please refer to these issues:

For now I'm going to close the issue.

@riderx
Copy link

riderx commented Oct 17, 2022

@dmitry-shibanov we still have the issue in pnpm and i don't find any solution who work for pnpm in your 2 issues linked.
if you look there : https://github.com/Cap-go/capgo/actions/runs/3262889396/jobs/5360721055
You can see your actions use /home/runner/.local/share/pnpm/store/v3 and pnpm also.
So i don't understand why no cache

@dmitry-shibanov
Copy link
Contributor

Hello @riderx. I took a look at the build. Could you please create a separate issue to describe it more ? It does not fail for setup-node steps. Besides, it does not use cache in other jobs because they run in parallel that is why cache is not saved. Moreover, dependency file can be changed in every job that is why the action resaves cache.

@riderx riderx mentioned this issue Oct 18, 2022
5 tasks
@riderx
Copy link

riderx commented Oct 18, 2022

Thanks a lot @dmitry-shibanov !
i created the issue #597
i tried to explain it better, feel free to ask more if needed.
i totally understand parallel job don't use the same cache, but in my case a same job between run don't reuse cache, what i expect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants