-
Notifications
You must be signed in to change notification settings - Fork 53
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] build.dart
dependencies cannot be dev dependencies.
#160
Comments
@jonasfj Do we have logic for checking somewhere that if you use a |
Yes, See: |
@dcharkes it's possible that we do what to check this for |
I was going to suggest this! |
Filed dart-lang/pub#4365 |
lol 🤣 |
I ...think we have something corresponding in the analyzer as well... Specifically https://dart.dev/tools/linter-rules/depend_on_referenced_packages most likely need adjusting too. I think the definition of and referenced here: needs an update to include files in the hooks folder. |
`hook/` is a reserved directory. #54334 And the two hooks currently in existence require to be invoked with the same dependencies as the root package. Hence the dependencies of the hooks should be normal dependencies and not dev dependencies. Bug: dart-lang/native#160 Change-Id: I7cf48659bd240c2e46b5bdede2a336763301b8c5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383301 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Daco Harkes <[email protected]> Reviewed-by: Hossein Yousefi <[email protected]>
TODO for closing this issue: Add a check somewhere, or add documentation.
hook/
pub#4365hook/
to strict dependencies check pub#4364Consider
package:my_app
depends onpackage:foo
, andpackage:foo
has abuild.dart
usingpackage:http
to download a dylib from a CIDN.A. If
package:foo
would only addpackage:http
as a dev dependency, thenbuild.dart
with the root package (package:my_app
) package_config.json, and thebuild.dart
invocation will fail, orpub get
inside the pub cache containingpackage:foo
and use the resulting package config to runbuild.dart
.B. If
package:foo
addspackage:http
as a normal dependency, thenbuild.dart
with the root package (package:my_app
) package_config.json, and thebuild.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 thepub cache
.Switching to the alternative behavior A.2. enables various
build.dart
scripts to rely on incompatible versions ofpackage: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 introducingbuild_dependencies
.Thanks for reporting @craiglabenz!
The text was updated successfully, but these errors were encountered: