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

When using link-workspace-packages = deep, partially filtered installation does not fully install all dependencies #5034

Open
kenrick95 opened this issue Jul 14, 2022 · 1 comment · Fixed by #5220
Assignees

Comments

@kenrick95
Copy link
Member

kenrick95 commented Jul 14, 2022

pnpm version: 7.5.1

Also used 6.32.25 and issue exist too

Code to reproduce the issue:

Scenario:

In a monorepo, there are two packages: G & F

  • Package G has dependency on an external package E.
  • External package E has dependency on package F.
  • E, G, F are all published in registry

In that monorepo, we set link-workspace-packages = deep

This causes pnpm install to make E depends on internal version of F.

However if subsequently we clean the repo (remove all the node_modules) and we run pnpm install --filter G...", the dependencies of local version of F is not installed.

Repro here: https://github.com/kenrick95/pnpm-testing-repro-deep-install-issue

Expected behavior:

In that scenario, F's dependencies (direct & indirect too) are installed

Actual behavior:

F's dependencies are not installed

Additional information:

  • node -v prints: 14.19.0
  • Windows, macOS, or Linux?: macOS
@kenrick95 kenrick95 changed the title When using link-workspace-packages = deep, partial filter install does not fully install all dependencies When using link-workspace-packages = deep, partially filtered installation does not fully install all dependencies Jul 14, 2022
@kenrick95 kenrick95 self-assigned this Aug 16, 2022
zkochan pushed a commit that referenced this issue Oct 13, 2022
…kages at headless installation (#5220)

Co-authored-by: Zoltan Kochan <z@kochan.io>

close #5034
@kenrick95
Copy link
Member Author

Apologies for not verifying the fix, however seems like this is not totally fixed yet by that PR: #5220

That PR makes @pnpm/headless able to include missing project ids:

const missingIds = importerIds.filter((importerId) => !initialImporterIdSet.has(importerId))

However, opts.allProjects received here is the filtered project list, not the whole workspace projects

for (const project of Object.values(opts.allProjects)) {

The unit test of @pnpm/headless is passing because we are passing the all workspace projects to the headlessInstall function.

As I understand, when @pnpm/main calls @pnpm/core, it is passing the full workspace projects info at opts.allProjects, however when calling @pnpm/headlesss' headlessInstall, it is no longer the full workspace projects, but only the filtered ones

@kenrick95 kenrick95 reopened this Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant