Skip to content

[infra] Use path dependencies between native_assets_cli and native_assets_builder in Flutter tools #949

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

Closed
dcharkes opened this issue Jan 23, 2024 · 2 comments
Labels
package:hooks_runner package:hooks type-infra A repository infrastructure change or enhancement

Comments

@dcharkes
Copy link
Collaborator

Once pub supports path dependencies in pubspecs of git dependencies, we should change over the dependency on native_assets_builder and native_assets_cli to be git dependencies.

Blocked by:

This would enable doing breaking changes to native_assets_cli and consuming these breaking changes in native_assets_builder in a single atomic atomic step. cc @jonasfj @sigurdm

In turn this means we could stop building against both published and path dependencies on the repo here. cc @mosuem

It also means we completely stop publishing native_assets_builder (it's already listed hidden currently).

cc @mkustermann before addressing dart-lang/pub#449, we can't have a path dependency on from one package to another in a mono-repo and succeed resolving. (Unless we use dependency_overrides in flutter_tools.)

Alternatives:

  • Merge packge_native_assets_builder into native_assets_cli but in a private library. (Downside: pub get will pull in all the builder code when users have build.dart scripts.)
  • Use dependency overrides in flutter_tools.
  • Stop letting native_assets_builder depend on native_assets_cli. Duplicate code where necessary. (Downsides: duplicated code. Harder to test serialization/deserialization. The _builder will serialize BuildConfig and deserialize BuildOutput, while the _cli will deserialize BuildConfig and serialize BuildOutput)

This does not yet solve the issue of flutter_tools rolling into g3 separately from dartdev and g3 only having one copy of native_assets_builder (which force us to do any breaking changes in a multi step multi roll fashion). https://github.com/dart-lang/native/blob/main/pkgs/native_assets_builder/CONTRIBUTING.md#rolling

@dcharkes
Copy link
Collaborator Author

  • Stop letting native_assets_builder depend on native_assets_cli. Duplicate code where necessary. (Downsides: duplicated code. Harder to test serialization/deserialization. The _builder will serialize BuildConfig and deserialize BuildOutput, while the _cli will deserialize BuildConfig and serialize BuildOutput)

@jonasfj suggested to do this. Add a script in tool/ to do the duplication, and a script in tool/ to verify that the files are copied on the CI.

@dcharkes
Copy link
Collaborator Author

In turn this means we could stop building against both published and path dependencies on the repo here.

We have already stopped this.

I don't believe we can use git dependencies in flutter_tools at this point, so we'll have to keep staggered publishing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:hooks_runner package:hooks type-infra A repository infrastructure change or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant