-
Notifications
You must be signed in to change notification settings - Fork 64
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
[native_assets_builder] dart pub deps --json
and .package_config.json
could disagree
#1968
Comments
I think persisting something along the lines of pub deps --json into .dart_tool makes sense! We should probably go through that output and verify that it is the desired information we output. |
We have something close to this now in |
Thanks @sigurdm! 🙏 I'm going to keep this open until we consume this shiney new thing. 😄 |
Ah - this issue covered the discrepancy in native_assets_builder - not the feature request for pub - sorry for closing! |
We run
dart pub deps --json
internally to get a dependencies graph to determine in what order to run the build hooks.(And if we move forward with version-isolated output directories, we'll also start using it for figuring out if something is a published, git, or root dependency. #1962 (comment))
However,
dartdev
andflutter_tools
now need to guarantee that thepackage_config.json
they pass in is up to date with regards to thepubspec.yaml
. This seems fragile.It would be better if the information from
dart pub deps --json
would also be persisted.Proposed solution:
.dart_tool/pub_deps.json
We could make
pub get
output a json file next to the package config. This would make the files persist at the same time.Not proposed solution: embed inside
package_config.json
The
package_config.json
is a file needed for the Dart core language, and it should only contain information for the core language. The core language doesn't require additional information. The SDKs (Dart standalone and Flutter) contain pub and support for native assets. We shouldn't leak information from the outer layer into the inner layer.(I'm advocating against dart-lang/pub#3795)
cc @jonasfj @sigurdm for symbiotic relationship between
pub
and the native assets feature (both the dependencies graph and the 'source' hosted/git/root are needed).cc @bkonyi for the
pubspec.yaml
->package_config.json
"contract" in dartdev and flutter_tools.@bkonyi Should we consider forcibly running
pub get
if we notice the timestamp of thepubspec.yaml
is new than thepackage_config.json
. That's definitely not what we do in dartdev currently. We only runpub get
if can't find apackage_config.json
.The text was updated successfully, but these errors were encountered: