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

request: dynamic runPubGetInParallel #546

Open
1 task done
tomassasovsky opened this issue Jul 18, 2023 · 4 comments · May be fixed by #731
Open
1 task done

request: dynamic runPubGetInParallel #546

tomassasovsky opened this issue Jul 18, 2023 · 4 comments · May be fixed by #731

Comments

@tomassasovsky
Copy link

Is there an existing feature request for this?

  • I have searched the existing issues.

Command

No response

Description

The flag runPubGetInParallel should accept:

  • true
  • false
  • auto

The option "auto" would fallback to false when the machine is a CI instance. This can be checked with the environment variable CI

Resources:

Reasoning

Locally, running pub get in parallel is very useful and not at all prone to resulting in a broken pubspec.lock. On CI processes, however, it can break easily. Modifying this manually is very annoying.

Additional context and comments

No response

@tomassasovsky tomassasovsky added feature request Needs: Triage The issue needs triaging labels Jul 18, 2023
@szugyi
Copy link

szugyi commented Jun 18, 2024

I would also add that the current default value of true can cause a lot of headaches for everyone who starts using melos and starts running into issues on the CI as the errors caused by parallel pub get runs at first glance seem to have nothing to do with melos.

This "auto" option could be the default option solving the above problem elegantly.

@spydon spydon added Type: Accepted and removed Needs: Triage The issue needs triaging labels Jun 18, 2024
@spydon
Copy link
Collaborator

spydon commented Jun 18, 2024

It sounds like a good idea, if anyone is keen on implementing it, feel free to submit a PR. :)

@tomassasovsky tomassasovsky linked a pull request Jun 19, 2024 that will close this issue
7 tasks
@szugyi
Copy link

szugyi commented Jul 1, 2024

@spydon I was thinking about this issue.

The reason we want a flag like this is the fact that on CI machines melos seem to get into weird race conditions during running pub get in parallel. But why is that? What makes running pub get in parallel on a local machine safe, and fragile on CI?

I think this is what should be fixed. Adding this auto flag is like accepting this as a fact, like it was anticipated to have issues on CI.

@spydon
Copy link
Collaborator

spydon commented Jul 1, 2024

But why is that? What makes running pub get in parallel on a local machine safe, and fragile on CI?

If you want to investigate it, feel free, I haven't been able to come to any conclusions about when it is failing and when it is not (it works most of the time).
There are multiple other packages suffering from the same problem too, like spec for example.

Once the workspace feature lands I'm sure this won't be a problem anymore: http://flutter.dev/go/pub-workspace

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.

3 participants