TODO for closing this issue: Add a check somewhere, or add documentation.
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.dart with the root package (package:my_app) package_config.json, and the build.dart invocation will fail, or
- (possible alternative behavior) the native assets builder will run
pub get inside the pub cache containing package:foo and use the resulting package config to run build.dart.
B. If package:foo adds package:http as a normal dependency, then
- (current behavior) the native assets builder will invoke the
build.dart with the root package (package:my_app) package_config.json, and the build.dart invocation 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!
TODO for closing this issue: Add a check somewhere, or add documentation.
hook/pub#4365hook/to strict dependencies check pub#4364Consider
package:my_appdepends onpackage:foo, andpackage:foohas abuild.dartusingpackage:httpto download a dylib from a CIDN.A. If
package:foowould only addpackage:httpas a dev dependency, thenbuild.dartwith the root package (package:my_app) package_config.json, and thebuild.dartinvocation will fail, orpub getinside the pub cache containingpackage:fooand use the resulting package config to runbuild.dart.B. If
package:fooaddspackage:httpas a normal dependency, thenbuild.dartwith the root package (package:my_app) package_config.json, and thebuild.dartinvocation will succeed.So with the current setup,
build.dartdependencies must be added as normal dependencies, not dev dependencies.@jonasfj would probably not enjoy us running
pub getinside thepub cache.Switching to the alternative behavior A.2. enables various
build.dartscripts to rely on incompatible versions ofpackage:http.However,
build.dartdoes not need all the other dev dependencies, nor possibly the main dependencies. So this sounds like another hint in the direction of introducingbuild_dependencies.Thanks for reporting @craiglabenz!