Skip to content
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

[infra] Convert this mono_repo to use pub workspaces #1223

Open
dcharkes opened this issue Jun 25, 2024 · 7 comments · May be fixed by #1884
Open

[infra] Convert this mono_repo to use pub workspaces #1223

dcharkes opened this issue Jun 25, 2024 · 7 comments · May be fixed by #1884
Labels
type-infra A repository infrastructure change or enhancement

Comments

@dcharkes
Copy link
Collaborator

From Dart 3.5 on, pub supports single resolution for related packages.

This would be very useful for:

  • native_assets_cli
  • native_assets_builder
  • native_toolchain_c

We can get rid of all the path dependencies / overrides.

Also, having a single resolution ensures that package:jni for example doesn't have any dependency conflicts with package:native_assets_cli.

It might be a slight over-specification to have all packages in this repo as a single resolution, and it would mean bumping major versions needs to be done in PRs that touch all packages. But that might be a small price to pay.

We have to wait until Dart 3.5 reaches stable, the SDK constraint for the packages must be at least 3.5, and we don't want to push the packages to only work on beta/dev.

Thanks for the great work @sigurdm! ❤️

FYI @HosseinYousefi @liamappelbe @mosuem

@dcharkes dcharkes added the type-infra A repository infrastructure change or enhancement label Jun 25, 2024
@dcharkes
Copy link
Collaborator Author

dcharkes commented Jun 25, 2024

We might also need the resolution: local feature (dart-lang/pub#4317), we have some example/test projects with a pubspec.yaml that are intentionally a different resolution:

  • Flutter and non-Flutter test projects.
  • Some example projects that explicitly target published older version of packages in this repo to ensure that version skew doesn't crash things.

@sigurdm What about projects that have sdk: flutter how does that relate to the requirement to have sdk: 3.5.0?

@sigurdm
Copy link

sigurdm commented Jun 25, 2024

What about projects that have sdk: flutter how does that relate to the requirement to have sdk: 3.5.0?

If you have sdk:flutter you need to have a flutter sdk with a dart that includes that specific version.
(You might get away with pointing FLUTTER_ROOT to a flutter repo if you just want to resolve)

@sigurdm
Copy link

sigurdm commented Jun 25, 2024

flutter commands (flutter_tools) still don't support workspaces. We'll have to wait for flutter/flutter#150196

@Levi-Lesches
Copy link
Contributor

@dcharkes Would you like a PR for this?

@dcharkes
Copy link
Collaborator Author

@dcharkes Would you like a PR for this?

Yes please. It should work now that flutter is supporting pub workspaces as well.

Please note that we have a lot of test data which are projects as well, and some of those are explicitly pinned to older versions of dependencies. For example pkgs/native_assets_builder/test/build_runner/version_skew_test.dart. I'm not entirely sure how that fits into pub workspaces. Please let me know if that causes trouble.

@sigurdm
Copy link

sigurdm commented Jan 10, 2025

I'm not entirely sure how that fits into pub workspaces.

As long as they are not added to the workspace explicitly, they should not cause trouble.

@Levi-Lesches Levi-Lesches linked a pull request Jan 13, 2025 that will close this issue
9 tasks
@Levi-Lesches
Copy link
Contributor

Opened #1884, ready for review!

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

Successfully merging a pull request may close this issue.

3 participants