-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
System for making changes to package:macros without breaking the flutter engine roll #55870
Comments
Nit: not every change. Only changes to the APIs which are implemented by the analyzer, or breaking changes to APIs used by the analyzer. But yes, whenever a macros release requires a change in the analyzer, those packages have to be updated in lock step. The fact that one actually comes from the SDK means it has to happen as a part of the engine -> framework roll. |
How often do we have the situation where a change in the analyzer is required? |
One solution I proposed in the linked issue, is to allow version constraints for certain packages, instead of pinning them, in the framework. So for example |
It is difficult to predict, in the short term they will be more common, as we evolve the API. In the long term, we are looking into solutions to avoid the SDK vendored package entirely.
We could look into processes to ensure this, such as requiring an analyzer release to be prepared and landed together with any minor release of package:macros (analyzer depends on minor release versions because it implements the APIs, and that is the contract we have established). In theory we could also automate the publishing step, we have setups for that in GitHub repos already. I don't know what it would take to enable that for SDK packages. This hasn't been the pain point really though, it is the actual engine -> framework roll. There are already the required versions of things published and available. The issue is the framework pins to old versions which aren't compatible with the new SDK being rolled from the engine. |
I haven't really paid much attention to this in the past, but how do we ensure that the version of the analyzer that's pinned in flutter matches the version of the analyzer that's being used by the Dart SDK? Can we end up in a situation where |
I haven't seen the wiring in a while, but I'm 95% sure |
Then that begs the question of why there's a version of the analyzer package being rolled into flutter? What is it being used for? |
git grep shows the following:
The imports in (analysis.dart is separate; this is the code behind |
Thanks! I'm not seeing anything in that list that looks like it would cause problems for users if the two versions are out of date. The biggest risk I can see is if the pinned version of It still isn't clear why they aren't just depending on the version of the package in the SDK, but maybe because it would feel like a hack to add a dependency override? |
Flutter repo packages still do use pub so the solve will fail if version constraints are incompatible. So, assuming we version correctly this shouldn't be an issue.
If by "they" you mean the flutter/flutter repo, there is no version of |
We seem to have hit this issue again with the change https://dart-review.googlesource.com/c/sdk/+/370120 The engine to framework rolls have been failing for a day now, see flutter/flutter#150084 |
Does the More importantly, though, what process do we need to put in place to ensure that this doesn't happen again? |
Does the Dart SDK pin to an exact version of the analyzer package? Because if so, I think that is sufficient reason to simply unpin the analyzer in Flutter, as the whole reason for pinning in Flutter is to ensure everyone uses the same single version. |
The analyzer package is developed in the SDK ( Is there any way for Flutter to pin to the version in the vended in SDK? |
The only way I can imagine doing this is to use a |
This is a different kind of breakage, we did/do not need a new version of analyzer published. The issue was that the So, this recent blockage was not really the result of any process needing to be changed/improved, but instead the existing process (to publish package:macros after landing changes) was blocked on an unrelated issue so it couldn't be completed. |
Bug: #55870 Change-Id: Ic06f4c0a2cc5dc5f07f72335dd172f203b948cb1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371261 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
dart-lang/language#3904 for discussion of whether we should switch back to internal-SDK-hosted for the macros dep until we are through with breaking changes. |
See flutter/flutter#149093.
As I understand our system today: every change to the macros package requires a release. And every macros package release requires a specific, new companion analyzer package. And the analyzer package is pinned somewhere in flutter/flutter.
So any time the macros package, which is vendored with the Dart SDK, is changed, the flutter engine -> framework autoroll breaks. In order for it to not break, a new version of the analyzer package would need to be available on pub, and the flutter framework would need to be able to accept that new version.
CC @jakemac53 @scheglov @zanderso @a-siva
The text was updated successfully, but these errors were encountered: