-
Couldn't load subscription status.
- Fork 82
Description
TODO for closing this issue: Add a check somewhere, or add documentation.
- lib/src/validator/strict_dependencies.dart should check dependencies in
hook/pub#4365 - Add
hook/to strict dependencies check pub#4364 - https://dart-review.googlesource.com/c/sdk/+/383301
Consider package:my_app depends on package:foo, and package:foo has a build.dart using package:http to download a dylib from a CIDN.
A. If package:foo would only add package:http as a dev dependency, then
- (current behavior) the native assets builder will invoke the
build.dartwith the root package (package:my_app) package_config.json, and thebuild.dartinvocation will fail, or - (possible alternative behavior) the native assets builder will run
pub getinside the pub cache containingpackage:fooand use the resulting package config to runbuild.dart.
B. If package:foo adds package:http as a normal dependency, then
- (current behavior) the native assets builder will invoke the
build.dartwith the root package (package:my_app) package_config.json, and thebuild.dartinvocation will succeed.
So with the current setup, build.dart dependencies must be added as normal dependencies, not dev dependencies.
@jonasfj would probably not enjoy us running pub get inside the pub cache.
Switching to the alternative behavior A.2. enables various build.dart scripts to rely on incompatible versions of package:http.
However, build.dart does not need all the other dev dependencies, nor possibly the main dependencies. So this sounds like another hint in the direction of introducing build_dependencies.
Thanks for reporting @craiglabenz!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status