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

Support for resolving package config and pubspec.lock in workspaces #3684

Merged
merged 8 commits into from
Jun 4, 2024

Conversation

sigurdm
Copy link
Contributor

@sigurdm sigurdm commented May 13, 2024

Instead of expecting pubspec.lock and .dart_tool/package_config.json to reside in the same folder as pubspec.yaml, we visit each parent of the current directory until we find a .dart_tool/package_config.json, and expect pubspec.lock to exist next to that.

Also invoke the generated scripts with an explicit packageConfig.

This is to support running build_runner build in a workspace package, as implemented in dart-lang/pub#4127

@sigurdm
Copy link
Contributor Author

sigurdm commented May 13, 2024

The CI failures seem unrelated.

@sigurdm sigurdm requested a review from jakemac53 May 13, 2024 10:07
@sigurdm
Copy link
Contributor Author

sigurdm commented May 17, 2024

I added a test of the package graph creation.

And support for .packages.

@sigurdm
Copy link
Contributor Author

sigurdm commented May 17, 2024

Not sure what goes wrong in the community test. I am not able to reproduce the failures locally.

@jakemac53
Copy link
Contributor

Not sure what goes wrong in the community test. I am not able to reproduce the failures locally.

I can look into that, but probably not until next week. Or possibly @simolus3 would have some idea, but it seems like the code just isn't getting generated for some reason.

@simolus3
Copy link
Contributor

The failure looks surprising to me as well. I commit generated code into the repository and the build integrity test shows that re-running build_runner does not alter the state of the checkout. So the generated code should be there.

My best guess is that we hit a race condition where the build integrity test started running (and thus deleting previous generated sources) while the other tests were being loaded, thus causing these errors? I have disabled concurrency for the community tests in the drift repository, I hope that resolves the problem.

@jakemac53
Copy link
Contributor

I have disabled concurrency for the community tests in the drift repository, I hope that resolves the problem.

I restarted the job and it passed 👍

@sigurdm sigurdm requested a review from jakemac53 May 21, 2024 09:40
@sigurdm
Copy link
Contributor Author

sigurdm commented May 23, 2024

Anything more blocking this?

@jonasfj
Copy link
Member

jonasfj commented May 27, 2024

This is really another good case for adding the dependency types and relationships in package_config.json. That would much parsing all pubspec.yaml files unnecessary in this case.

@sigurdm
Copy link
Contributor Author

sigurdm commented May 28, 2024

This is really another good case for adding the dependency types and relationships in package_config.json. That would much parsing all pubspec.yaml files unnecessary in this case.

Yeah - lets do that another time!

dart-lang/pub#3795

@sigurdm
Copy link
Contributor Author

sigurdm commented May 31, 2024

Gentle ping

@jakemac53
Copy link
Contributor

I can upload a change to address my two nits

@jakemac53 jakemac53 merged commit b6b4a21 into dart-lang:master Jun 4, 2024
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants