-
Notifications
You must be signed in to change notification settings - Fork 229
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
[API] full dependency graph in package_config.json
#3795
Comments
I think the best way currently is to run |
That requires us to do an extra process invocation, this could slow down things. A process invocation is likely slower than just a programmatic source code invocation. In which case I'd need to be able to have the pub-solver as a dependency. And a programmatic invocation is likely slower than reading a JSON file, because we run some of the pub code twice. Once on pub get and once on the programmatic invocation. But I can use |
I think that's a good way to get started. We can always improve performance by:
But I would prefer not to unnecessarily increase API surface until we're sure this is the path we want to commit to. |
Using the workaround adds a 250 ms slowdown to flutter app builds: |
We'd like to do build for native libraries, and these libraries might depend on each other. Therefore we need to know a dependency graph (or topological sort) to schedule building the libraries in the correct order.
For building native libraries the prototype has opted to rely on parsing
.dart_tool/package_config.json
rather than invokingpackage:pub
programmatically. Currently,.dart_tool/package_config.json
contains a resolved package version, but it does not contain a dependency graph between those packages. This means we cannot do the builds in the right order.An alternative solution might be to call the pub solver programmatically instead of relying on the package config as the API layer between pub and the native asset builds.
Context:
@jonasfj @sigurdm We discussed this before, and I believe we preferred using JSON as the API rather than programmatic invocation, but I can't find any meeting notes/docs.
Note that if we decide to go for
build_dependencies
, we would need a different topological sort based on those dependencies rather than the "main" dependencies:Without access to a dependency graph or topologic sort, packages doing native builds should not depend on any other package doing a native build. This effectively means we only support packages downloading dynamic libraries from from a CDN.
The text was updated successfully, but these errors were encountered: