turbo: `turbo prune` is broken when not using pnpm workspace protocol for workspace packages

Verify canary release

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

Link to code that reproduces this issue

https://github.com/gegenschall/turbo-bug-repro

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

1.12.0

Describe the Bug

When using a monorepo and linking packages without the use of the workspace protocol and setting link-workspace-packages=false in .npmrc the pruned output from turbo prune is broken. The generated pnpm-lock.yaml file does not include any valid references to the packages from the workspace, s.t. pnpm install will fail with the following message:

Scope: all 3 workspace projects
Lockfile is up to date, resolution step is skipped
 WARN  Broken lockfile: no entry for '/@gegenschall/some-package/1.0.0' in pnpm-lock.yaml
 ERR_PNPM_ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY  The lockfile is broken! Resolution step will be performed to fix it.
services/some-service                    |  WARN  Could not find preferred package /@gegenschall/some-package/1.0.0 in lockfile

For reference, here’s the generated and original pnpm-lock.yaml:

Pruned pnpm-lock.yaml
lockfileVersion: '6.0'
settings:
autoInstallPeerDeps: null
excludeLinksFromLockfile: false
importers:
.:
  devDependencies:
    ts-node:
      specifier: ^10.9.2
      version: 10.9.2(@types/node@20.11.13)(typescript@5.3.3)
    turbo:
      specifier: ^1.12.0
      version: 1.12.0
packages/some-package: {}
services/some-service:
  dependencies:
    '@gegenschall/some-package':
      specifier: ^1.0.0
      version: 1.0.0
packages:
/@cspotcode/source-map-support@0.8.1:
  resolution:
    integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==
  dependencies:
    '@jridgewell/trace-mapping': 0.3.9
  dev: true
  engines:
    node: '>=12'
/@jridgewell/resolve-uri@3.1.1:
  resolution:
    integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==
  dev: true
  engines:
    node: '>=6.0.0'
/@jridgewell/sourcemap-codec@1.4.15:
  resolution:
    integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
  dev: true
/@jridgewell/trace-mapping@0.3.9:
  resolution:
    integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==
  dependencies:
    '@jridgewell/resolve-uri': 3.1.1
    '@jridgewell/sourcemap-codec': 1.4.15
  dev: true
/@tsconfig/node10@1.0.9:
  resolution:
    integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==
  dev: true
/@tsconfig/node12@1.0.11:
  resolution:
    integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==
  dev: true
/@tsconfig/node14@1.0.3:
  resolution:
    integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==
  dev: true
/@tsconfig/node16@1.0.4:
  resolution:
    integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
  dev: true
/@types/node@20.11.13:
  resolution:
    integrity: sha512-5G4zQwdiQBSWYTDAH1ctw2eidqdhMJaNsiIDKHFr55ihz5Trl2qqR8fdrT732yPBho5gkNxXm67OxWFBqX9aPg==
  dependencies:
    undici-types: 5.26.5
  dev: true
/acorn-walk@8.3.2:
  resolution:
    integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==
  dev: true
  engines:
    node: '>=0.4.0'
/acorn@8.11.3:
  resolution:
    integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==
  dev: true
  engines:
    node: '>=0.4.0'
  hasBin: true
/arg@4.1.3:
  resolution:
    integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
  dev: true
/create-require@1.1.1:
  resolution:
    integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
  dev: true
/diff@4.0.2:
  resolution:
    integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
  dev: true
  engines:
    node: '>=0.3.1'
/make-error@1.3.6:
  resolution:
    integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
  dev: true
/ts-node@10.9.2(@types/node@20.11.13)(typescript@5.3.3):
  resolution:
    integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==
  dependencies:
    '@cspotcode/source-map-support': 0.8.1
    '@tsconfig/node10': 1.0.9
    '@tsconfig/node12': 1.0.11
    '@tsconfig/node14': 1.0.3
    '@tsconfig/node16': 1.0.4
    '@types/node': 20.11.13
    acorn: 8.11.3
    acorn-walk: 8.3.2
    arg: 4.1.3
    create-require: 1.1.1
    diff: 4.0.2
    make-error: 1.3.6
    typescript: 5.3.3
    v8-compile-cache-lib: 3.0.1
    yn: 3.1.1
  dev: true
  hasBin: true
  peerDependencies:
    '@swc/core': '>=1.2.50'
    '@swc/wasm': '>=1.2.50'
    '@types/node': '*'
    typescript: '>=2.7'
  peerDependenciesMeta:
    '@swc/core':
      optional: true
    '@swc/wasm':
      optional: true
/turbo-darwin-64@1.12.0:
  resolution:
    integrity: sha512-z3zZPFQAPO+vBks7Ybir33ovaJP8U/Ikr/NMGsewHsL5SjetHsd9ZAs6G1zBbAgWXcy7COpgWZbQF0Giq/6hJA==
  cpu:
  - x64
  dev: true
  optional: true
  os:
  - darwin
  requiresBuild: true
/turbo-darwin-arm64@1.12.0:
  resolution:
    integrity: sha512-vVDDjw7rjVHB+S/CrHiDoAMXWsqjG7mVCCXWvL8AhDhTT1u4a3KS2dWsqUFprbzC1X4cHnzmGktXfAo8ro5Mng==
  cpu:
  - arm64
  dev: true
  optional: true
  os:
  - darwin
  requiresBuild: true
/turbo-linux-64@1.12.0:
  resolution:
    integrity: sha512-CQMr/B9T1d5JCOgCQk/EX3oUzlNlgUdMaH1is7eU8lBz+NIc1vbC9bunNwgFcM+WsjZORk4ffvYjKx49VtmOkQ==
  cpu:
  - x64
  dev: true
  optional: true
  os:
  - linux
  requiresBuild: true
/turbo-linux-arm64@1.12.0:
  resolution:
    integrity: sha512-sDHezEXcZjZ+aRIN5gzCH0qQjfSnHvnmN5Rr/V+TAk+SeyALh7uRcUxzTrWcl85sK4qDLna9o7bkllgtXXy8LA==
  cpu:
  - arm64
  dev: true
  optional: true
  os:
  - linux
  requiresBuild: true
/turbo-windows-64@1.12.0:
  resolution:
    integrity: sha512-yPkL+mRmG22q5V1qRWJkt/U/qK3dYUUiw4aHrmaNm9+5vzDxcZo2Ft60AZsyrl2HMFI6aHBZOjCct/a2Jmc14g==
  cpu:
  - x64
  dev: true
  optional: true
  os:
  - win32
  requiresBuild: true
/turbo-windows-arm64@1.12.0:
  resolution:
    integrity: sha512-v0O71TaAja9l3W7DEnHRhehUatgNfu4B24QNBEkHyR6B0w8pxNB1Vorv9auubXMcZzP/nhwtsQTM6U2ZINAd6A==
  cpu:
  - arm64
  dev: true
  optional: true
  os:
  - win32
  requiresBuild: true
/turbo@1.12.0:
  resolution:
    integrity: sha512-gOrh05sU7Njws7MMklBH71TZNx0LLGD+sjp+o4d/m4cngQ6r9/l7/+fZichXd4suh8Id700p9aTMiF80uh69Xg==
  optionalDependencies:
    turbo-darwin-64: 1.12.0
    turbo-darwin-arm64: 1.12.0
    turbo-linux-64: 1.12.0
    turbo-linux-arm64: 1.12.0
    turbo-windows-64: 1.12.0
    turbo-windows-arm64: 1.12.0
  dev: true
  hasBin: true
/typescript@5.3.3:
  resolution:
    integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==
  dev: true
  engines:
    node: '>=14.17'
  hasBin: true
/undici-types@5.26.5:
  resolution:
    integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
  dev: true
/v8-compile-cache-lib@3.0.1:
  resolution:
    integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==
  dev: true
/yn@3.1.1:
  resolution:
    integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
  dev: true
  engines:
    node: '>=6'

Original `pnpm-lock.yaml`
lockfileVersion: '6.0'

settings:
autoInstallPeers: true
excludeLinksFromLockfile: false

importers:

.:
  devDependencies:
    ts-node:
      specifier: ^10.9.2
      version: 10.9.2(@types/node@20.11.13)(typescript@5.3.3)
    turbo:
      specifier: ^1.12.0
      version: 1.12.0

packages/some-package: {}

services/some-service:
  dependencies:
    '@gegenschall/some-package':
      specifier: ^1.0.0
      version: 1.0.0

packages:

/@cspotcode/source-map-support@0.8.1:
  resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
  engines: {node: '>=12'}
  dependencies:
    '@jridgewell/trace-mapping': 0.3.9
  dev: true

/@gegenschall/some-package@1.0.0:
  resolution: {integrity: sha512-QGhyALB12VWMz/kSUbam4wdju/GPBNnBsIfsj3EeGhECG1hLjr6pf9xfh/OTExxuhj23CHBzK9ZIdN/DNZ9bHA==, tarball: https://npm.pkg.github.com/download/@gegenschall/some-package/1.0.0/3a8a555fab913951e7a373e5482497951852b9bb}
  dev: false

/@jridgewell/resolve-uri@3.1.1:
  resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==}
  engines: {node: '>=6.0.0'}
  dev: true

/@jridgewell/sourcemap-codec@1.4.15:
  resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
  dev: true

/@jridgewell/trace-mapping@0.3.9:
  resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
  dependencies:
    '@jridgewell/resolve-uri': 3.1.1
    '@jridgewell/sourcemap-codec': 1.4.15
  dev: true

/@tsconfig/node10@1.0.9:
  resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
  dev: true

/@tsconfig/node12@1.0.11:
  resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
  dev: true

/@tsconfig/node14@1.0.3:
  resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
  dev: true

/@tsconfig/node16@1.0.4:
  resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
  dev: true

/@types/node@20.11.13:
  resolution: {integrity: sha512-5G4zQwdiQBSWYTDAH1ctw2eidqdhMJaNsiIDKHFr55ihz5Trl2qqR8fdrT732yPBho5gkNxXm67OxWFBqX9aPg==}
  dependencies:
    undici-types: 5.26.5
  dev: true

/acorn-walk@8.3.2:
  resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==}
  engines: {node: '>=0.4.0'}
  dev: true

/acorn@8.11.3:
  resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==}
  engines: {node: '>=0.4.0'}
  hasBin: true
  dev: true

/arg@4.1.3:
  resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
  dev: true

/create-require@1.1.1:
  resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
  dev: true

/diff@4.0.2:
  resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
  engines: {node: '>=0.3.1'}
  dev: true

/make-error@1.3.6:
  resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
  dev: true

/ts-node@10.9.2(@types/node@20.11.13)(typescript@5.3.3):
  resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
  hasBin: true
  peerDependencies:
    '@swc/core': '>=1.2.50'
    '@swc/wasm': '>=1.2.50'
    '@types/node': '*'
    typescript: '>=2.7'
  peerDependenciesMeta:
    '@swc/core':
      optional: true
    '@swc/wasm':
      optional: true
  dependencies:
    '@cspotcode/source-map-support': 0.8.1
    '@tsconfig/node10': 1.0.9
    '@tsconfig/node12': 1.0.11
    '@tsconfig/node14': 1.0.3
    '@tsconfig/node16': 1.0.4
    '@types/node': 20.11.13
    acorn: 8.11.3
    acorn-walk: 8.3.2
    arg: 4.1.3
    create-require: 1.1.1
    diff: 4.0.2
    make-error: 1.3.6
    typescript: 5.3.3
    v8-compile-cache-lib: 3.0.1
    yn: 3.1.1
  dev: true

/turbo-darwin-64@1.12.0:
  resolution: {integrity: sha512-z3zZPFQAPO+vBks7Ybir33ovaJP8U/Ikr/NMGsewHsL5SjetHsd9ZAs6G1zBbAgWXcy7COpgWZbQF0Giq/6hJA==}
  cpu: [x64]
  os: [darwin]
  requiresBuild: true
  dev: true
  optional: true

/turbo-darwin-arm64@1.12.0:
  resolution: {integrity: sha512-vVDDjw7rjVHB+S/CrHiDoAMXWsqjG7mVCCXWvL8AhDhTT1u4a3KS2dWsqUFprbzC1X4cHnzmGktXfAo8ro5Mng==}
  cpu: [arm64]
  os: [darwin]
  requiresBuild: true
  dev: true
  optional: true

/turbo-linux-64@1.12.0:
  resolution: {integrity: sha512-CQMr/B9T1d5JCOgCQk/EX3oUzlNlgUdMaH1is7eU8lBz+NIc1vbC9bunNwgFcM+WsjZORk4ffvYjKx49VtmOkQ==}
  cpu: [x64]
  os: [linux]
  requiresBuild: true
  dev: true
  optional: true

/turbo-linux-arm64@1.12.0:
  resolution: {integrity: sha512-sDHezEXcZjZ+aRIN5gzCH0qQjfSnHvnmN5Rr/V+TAk+SeyALh7uRcUxzTrWcl85sK4qDLna9o7bkllgtXXy8LA==}
  cpu: [arm64]
  os: [linux]
  requiresBuild: true
  dev: true
  optional: true

/turbo-windows-64@1.12.0:
  resolution: {integrity: sha512-yPkL+mRmG22q5V1qRWJkt/U/qK3dYUUiw4aHrmaNm9+5vzDxcZo2Ft60AZsyrl2HMFI6aHBZOjCct/a2Jmc14g==}
  cpu: [x64]
  os: [win32]
  requiresBuild: true
  dev: true
  optional: true

/turbo-windows-arm64@1.12.0:
  resolution: {integrity: sha512-v0O71TaAja9l3W7DEnHRhehUatgNfu4B24QNBEkHyR6B0w8pxNB1Vorv9auubXMcZzP/nhwtsQTM6U2ZINAd6A==}
  cpu: [arm64]
  os: [win32]
  requiresBuild: true
  dev: true
  optional: true

/turbo@1.12.0:
  resolution: {integrity: sha512-gOrh05sU7Njws7MMklBH71TZNx0LLGD+sjp+o4d/m4cngQ6r9/l7/+fZichXd4suh8Id700p9aTMiF80uh69Xg==}
  hasBin: true
  optionalDependencies:
    turbo-darwin-64: 1.12.0
    turbo-darwin-arm64: 1.12.0
    turbo-linux-64: 1.12.0
    turbo-linux-arm64: 1.12.0
    turbo-windows-64: 1.12.0
    turbo-windows-arm64: 1.12.0
  dev: true

/typescript@5.3.3:
  resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==}
  engines: {node: '>=14.17'}
  hasBin: true
  dev: true

/undici-types@5.26.5:
  resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
  dev: true

/v8-compile-cache-lib@3.0.1:
  resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
  dev: true

/yn@3.1.1:
  resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
  engines: {node: '>=6'}
  dev: true

Expected Behavior

Expect the generated pnpm-lock.yaml file to contain valid references to the dependent packages, resolving to the registry version.

To Reproduce

  1. Clone git@github.com:gegenschall/turbo-bug-repro.git
  2. Run pnpm i
  3. Run pnpm turbo prune some-service --docker
  4. Run cd out/json
  5. RUn pnpm i --prod --frozen-lockfile

Additional context

Note, I’ve used turbo@1.12.0 because the canary version was older at the time of writing. I have tested with turbo@1.11.4-canary.4 and the issue persists.

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Reactions: 3
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

same here, forcing version 1.11.3 we dont have this issue.

but we use yarn.