-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Evaluate using pub workspace feature, dropping custom package config generator #56220
Comments
Yes please! :) Dart-Code might require some changes (because we have some assumptions about having a There are some other minor niggles for some tests in VS Code (for ex. we don't understand (FWIW, how the package_config is generated is less important to me/Dart-Code, as long as the SDK is flagged in a way that means |
Have you tried the pub workspaces feature? Does it have the same issue or no? It would be worth fixing it to work with workspaces if it doesn't currently because that is now a more general feature. |
💯 I haven't looked at the impl. tool closely. The SDK+gclient is (mostly? completely?) hermetic currently. Can this work with running a You may try replacing this bootstrap into the dart setup code with the |
No, I thought it was still being designed/work in progress 😄 Are there instructions for trying it out? Does it need flags and/or a specific SDK version? |
If all dependencies are workspace packages I would think: yes. I don't even think you need to do There could be corner cases, but it's worth testing, and possibly fixing if it doesn't work. |
@jonasfj Would it be possible to add an |
I am not sure on instructions, but you can look at the build repo. Or the branch of the SDK I linked above. tldr;
|
cc @athomas I hear you might be a good person to discuss this with? |
@jakemac53 Happy to, I've wanted to use pub for a while to generate the package config and discussed it with sigurdm in the past (though this was pre-workspaces and never high enough priority). I see in DEPS you didn't remove the old package_config generator. It should be replaced running pub get from the checked-in SDK. We'd also need to ensure the bots manage their pub cache but that's a relatively simple change (we should do anyway). I would suggest we split "use workspaces" from the "run tests with the package:test runner". I'm broadly supportive of removing bespoke things, but I don't think these need to be coupled. I would assume that generating the package config in a different way can be made compatible with the SDK test runner relatively easily. |
Correct, my CL is not complete, just enough to get basic functionality working to test things out. I would be happy to complete it though if we want to move forward.
Agreed, I think running actual tests using the test runner on the bots might not be a task worth investing in. In particular I am not sure how that would interact with the test database. But, developers would be able to use the test runner locally still to run tests more easily. And the IDE tooling could use it to run tests, which would enable some nice functionality there.
Yes I don't believe anything has to be changed here, it should just work. |
Thanks! I grabbed I'll work on this (tracked via Dart-Code/Dart-Code#5067).
|
I updated my PR to change how I ran into a separate issue, which is This ends up needing many more transitive deps because In general, in the old world we had the ability to pull in only the transitive deps of packages that were used, which was a subset of their |
cc @srawlins have you considered splitting it out a |
I have not, I guess the primary benefit would be smaller, more targeted I am mostly surprised that mockito is in DEPS, and would 100% support an effort to get it out.
Those seem reconcilable... |
Right, it may not be worth it, idk. I didn't think mockito was useful for much without the codegen nowadays.
Yeah, this would be another approach, just don't allow it in the SDK. |
I don't have the full context here, but if we can't use |
I think we should be able to rewrite this test to not rely on mockito if we need to. |
I had a similar-ish request here: dart-lang/pub#4328 |
Note that I realized |
For context on workspaces, see flutter.dev/go/pub-workspace. cc @jonasfj @sigurdm in case you all had considered this, or think I am off my rocker 🤣.
Proposal
See my WIP branch, which gets package:analyzer working. More packages would have to be added to complete it.
Benefits
dart run
anddart test
(anddart pub get
) in SDK packages without negative consequence.Risks
pub get
, and also wouldn't be able to build a new SDK that is compatible, because that requires apub get
.pub get
ingclient runhooks
to resolve this issue.Additional work required
gclient runhooks
to runpub get
instead of invoking the custom tool.pub get
just like today.Other ideas
Trying out the example
Run
gclient sync -D
(need some extra deps for the test runner)Run
pub get
from the root of the SDK (creates the package config). Note that you should not rungclient runhooks
, that will currently bash over this package config.Note: You can also now run this from any workspace package, and it will not create a new package config for that package. It will only update the root one.
Actually, you will see some tests fail because they take command line arguments which isn't allowed in the test runner, this is called out above. It is rare but we would have to look into these.
The text was updated successfully, but these errors were encountered: