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

[pnpm] turbo prune removes pnpmfileChecksum from lockfile #9947

Closed
1 task done
jlowcs opened this issue Feb 12, 2025 · 1 comment · Fixed by #9960
Closed
1 task done

[pnpm] turbo prune removes pnpmfileChecksum from lockfile #9947

jlowcs opened this issue Feb 12, 2025 · 1 comment · Fixed by #9960
Labels
area: prune turbo prune kind: bug Something isn't working

Comments

@jlowcs
Copy link

jlowcs commented Feb 12, 2025

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

N/A

Which canary version will you have in your reproduction?

2.4.1

Enviroment information


Expected behavior

When running turbo prune on a pnpm monorepo, the output should include a pnpm-lock.yaml that allows running pnpm i --frozen-lockfile, even if there is a .pnpmfile.cjs file and a pnpmfileChecksum within the original lockfile.

Actual behavior

pnpm prune generates a partial lockfile that is missing pnpmfileChecksum, resulting in pnpm i --frozen-lockfile failing to run.

Image

To Reproduce

  1. add a .pnpmfile.cjs file to the pnpm project
  2. run pnpm prune xxx --docker
  3. notice the missing pnpmfileChecksum in the output's lockfile

Additional context

No response

@jlowcs jlowcs added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Feb 12, 2025
@chris-olszewski chris-olszewski added area: prune turbo prune and removed needs: triage New issues get this label. Remove it after triage labels Feb 12, 2025
@jlowcs
Copy link
Author

jlowcs commented Feb 12, 2025

As a temporary fix, I'm running the following script in my dockerfile after the call to turbo prune:

if ! grep pnpmfileChecksum out/json/pnpm-lock.yaml > /dev/null; then
	grep pnpmfileChecksum pnpm-lock.yaml >> out/json/pnpm-lock.yaml
fi

It unblocks me for now.

chris-olszewski added a commit that referenced this issue Feb 13, 2025
### Description

Closes #9947

### Testing Instructions

```
[0 olszewski@macbookpro] /tmp/pnpmcjs $ turbo_dev --skip-infer prune web
turbo 2.4.2

Generating pruned monorepo for web in /private/tmp/pnpmcjs/out
 - Added @repo/eslint-config
 - Added @repo/typescript-config
 - Added @repo/ui
 - Added web
[0 olszewski@macbookpro] /tmp/pnpmcjs $ cd out 
[0 olszewski@macbookpro] /tmp/pnpmcjs/out $ cp ../.pnpmfile.cjs ./
[0 olszewski@macbookpro] /tmp/pnpmcjs/out $ pnpm i --frozen-lockfile
Scope: all 5 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +452
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 452, reused 452, downloaded 0, added 452, done

devDependencies:
+ prettier 3.5.0
+ turbo 2.4.2
+ typescript 5.7.3

Done in 3.4s
[0 olszewski@macbookpro] /tmp/pnpmcjs/out $ rg 'pnpmfileChecksum'
pnpm-lock.yaml
5:pnpmfileChecksum: kpphteni3rdug2puxczjfk5mle
```
joshnuss pushed a commit to joshnuss/turborepo that referenced this issue Feb 15, 2025
### Description

Closes vercel#9947

### Testing Instructions

```
[0 olszewski@macbookpro] /tmp/pnpmcjs $ turbo_dev --skip-infer prune web
turbo 2.4.2

Generating pruned monorepo for web in /private/tmp/pnpmcjs/out
 - Added @repo/eslint-config
 - Added @repo/typescript-config
 - Added @repo/ui
 - Added web
[0 olszewski@macbookpro] /tmp/pnpmcjs $ cd out 
[0 olszewski@macbookpro] /tmp/pnpmcjs/out $ cp ../.pnpmfile.cjs ./
[0 olszewski@macbookpro] /tmp/pnpmcjs/out $ pnpm i --frozen-lockfile
Scope: all 5 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +452
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 452, reused 452, downloaded 0, added 452, done

devDependencies:
+ prettier 3.5.0
+ turbo 2.4.2
+ typescript 5.7.3

Done in 3.4s
[0 olszewski@macbookpro] /tmp/pnpmcjs/out $ rg 'pnpmfileChecksum'
pnpm-lock.yaml
5:pnpmfileChecksum: kpphteni3rdug2puxczjfk5mle
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: prune turbo prune kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants