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

[rush] installing "to" a workspace project still installs all packages for all projects (using pnpm v8) #4285

Closed
joelrbrandt opened this issue Aug 18, 2023 · 1 comment · Fixed by #4344
Assignees

Comments

@joelrbrandt
Copy link
Contributor

Summary

With rush v5.102.0 and pnpm v8.6.12, using the --to or -t flag with rush install seems to have no effect.

Dependencies for all projects are still installed.

Repro steps

  1. rush purge
  2. rush install -t @myscope/myproject where @myscope/myproject is a workspace project

Expected result: only @myscope/myproject and its rush project dependencies have a complete node_modules folder

Actual result: all rush projects have a complete node_modules folder

Details

I found the (very old) issue #1669 and thought that perhaps this feature wasn't implemented.

However, I ran rush --debug install -t [my packge] and saw output that indicated rush is passing a --filter option to pnpm.

So, I think this is intended to work?

Specifically, this is the pnpm install command that prints out when I add --debug

$ rush --debug install -t @myscope/myproject

...

Invoking package manager: /Users/jbrandt/.rush/node-v18.16.0/pnpm-8.6.12/node_modules/pnpm/bin/pnpm.cjs install --store /Users/jbrandt/.pnpmcache --config.cacheDir=/Users/jbrandt/.pnpmcache --config.stateDir=/Users/jbrandt/.pnpmcache --no-prefer-frozen-lockfile --strict-peer-dependencies --config.ignoreCompatibilityDb --recursive --link-workspace-packages false --filter @myscope/myproject...

The main reason I want this feature to work is to speed up dependency installation in our CI/CD build steps that only build a portion of our monorepo.

Thank you for all the great work you do on rush! It is a delight to use!

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.101.1
rushVersion from rush.json? 5.102.0
pnpmVersion from rush.json? 8.6.12
useWorkspaces from rush.json? true
Operating system? reproed on Mac and Linux
Would you consider contributing a PR? Yes, but not for this bug (no idea how to fix!)
Node.js version (node -v)? 18.16.0
@iclanton iclanton moved this to Needs triage in Bug Triage Aug 23, 2023
@iclanton iclanton moved this from Needs triage to High priority in Bug Triage Aug 23, 2023
@dmichon-msft
Copy link
Contributor

dmichon-msft commented Sep 20, 2023

This is a bug in pnpm@8. Our command to pnpm is correctly formatted and results in, e.g:

/workspaces/rushstack/common/temp (pnpm-latest) $ rush install --to @rushstack/heft
Running "pnpm install" in /workspaces/rushstack/common/temp

Scope: 14 of 130 workspace projects

However, pnpm itself then installs the dependencies in all projects.

See pnpm/pnpm#6300

Edit: looks like we may be able to work around this by passing --config.dedupe-peer-dependents=false when installing with --frozen-lockfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants