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

Implement --resume-from [package-name] #4690

Closed
tiagobento opened this issue May 6, 2022 · 3 comments · Fixed by #5856
Closed

Implement --resume-from [package-name] #4690

tiagobento opened this issue May 6, 2022 · 3 comments · Fixed by #5856
Milestone

Comments

@tiagobento
Copy link

pnpm version: 7.0.0

Code to reproduce the issue:

pnpm -r exec 'pwd' | md5

Expected behavior:

If I ran the above command infinite times, I would expect to see the same result over and over.

Actual behavior:

There are slight variations between the executions. I get that the order can vary some times, since topologically, they're all correct, but this inconsistent behavior is very annoying for taking control over your dependency graph and creating some automations on top of it.

Additional information:

Last week we've had an important issue with windows-latest on GitHub Actions, where installing Lerna stopped working for a few hours. I guess they reverted it, since it went back to working again, but still, this made me and my team at https://github.com/kiegroup/kie-tools remeber that Lerna has been deprecated and unmaintained for a while now, so we started researching alternatives and pnpm was kind of an obvious choice, mostly due to the control it gives the developers to really own their node_modules.

The motivation for this issue comes exactly from this migration. We work on a medium-sized monorepo, and due to the differences between yarn workspaces installs and pnpm installs, some adjustments that expanded through all the codebase had to be made. We fixed some issues along the way and even found some peer problems (!) too. Right now, I'm fixing all of our unit tests, and it's really annoying to pass a full build after each fix without being able to start a build from the last failure on.

Maven has the very useful -rf :module-name (where "rf" stands for "resume from") option, that lets you start a build from an arbitrary package within your topologically sorted list of dependencies.

I can only imagine that being possible only if pnpm -r exec 'pwd' produces consistent outputs.

If you like the idea, consider this a suggestion for implementing something like -rf [package-name], that can work together with multiple --filters, as long as the package-name to resume from exists on the filtered list.

Cheers and thanks for this amazing tool!

  • node -v prints: v16.13.2
  • Windows, macOS, or Linux?: macOS
@zkochan
Copy link
Member

zkochan commented May 6, 2022

They are sorted but scripts are executed asynchronously, so when a script is executed on several projects at the same time, the order in which they print output is random.

@zkochan
Copy link
Member

zkochan commented May 6, 2022

--resume-from [package-name] I don't have objections to add such feature. Looks like it is not hard to implement.

@tiagobento
Copy link
Author

@zkochan Great to hear that! Should we transform this issue into a feature request to implement this?

@zkochan zkochan changed the title pnpm -r exec 'pwd' non-consistent package sorting Implement --resume-from [package-name] Jun 6, 2022
zkochan pushed a commit that referenced this issue Jan 2, 2023
gluxon pushed a commit to gluxon/pnpm that referenced this issue Jan 3, 2023
@zkochan zkochan added this to the v7.22 milestone Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants