Skip to content

Sharing code between dartdev and flutter_tools #142041

@dcharkes

Description

@dcharkes

Currently, it is quite hard to share implementation between dartdev and flutter_tools.

  • Dartdev outside g3 uses path dependencies via a DEPS file. Meaning that changes in multiple packages can be made in an atomic way.
  • Dartdev inside g3 uses the same dependencies in g3, the packages in DEPS are rolled into g3 with the Dart roll.
  • flutter_tools outside g3 uses published dependencies. This means that two helper packages in a mono_repo cannot be updated atomically. (For example native_asset_cli is imported by native_assets_builder but they are in the same mono repo, meaning one always need to commit dependency, publish, commit dependee, publish.)
  • flutter_tools inside g3 uses the same packages as are rolled by the Dart SDK. Meaning that no breaking changes can be rolled in the Dart roll rolling these packages if the API is also used in flutter_tools.

This means that two helper packages in a mono_repo cannot be updated atomically.

We could solve this, if we would depend packages in mono repos by git dependencies and use dependency overrides or use path dependencies inside the mono repo after dart-lang/native#949 is addressed.

@stuartmorgan @christopherfujino So far I only see published dependencies in flutter_tools pubspec.yaml. Is git dependencies on mono repos something the Flutter team would consider?

flutter_tools inside g3 uses the same packages as are rolled by the Dart SDK. Meaning that no breaking changes can be rolled in the Dart roll rolling these packages if the API is also used in flutter_tools.

This could possibly be solved by either (a) having two copies of the packages in google3 @iinozemtsev, or (b) not building flutter_tools at all in g3, or (c) rolling Dart as part of the Flutter roll instead of separately [probably not feasible].

Maybe I'm holding it wrong, and code between dartdev and flutter_tools should be shared in a different way. I'm open to suggestions.

Relevant issue for native_assets_builder and native_assets_cli:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.r: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtriaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions