-
Notifications
You must be signed in to change notification settings - Fork 214
build_resolvers error with latest analyzer + next flutter stable #2763
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
Comments
Note that when the next flutter stable lands any time a user runs The only recommendation we can give those users as far as i know is to pin their analyzer version to something older. |
Ok, summarizing some discussion.
As a result of the above, build_runner users (and any other users who use the analyzer package to analyzer the flutter sdk) will get broken unless they pin to an older version of the analyzer package. Options to proceed:
|
Another wrinkle I just realized here is all the allow listed packages will also have a problem. They have a 2.9 language version as well (as specified by their sdk constraint) and will not be properly opted in. So just fixing the flutter libraries won't fully resolve the issue, although it will allow us to summarize the SDK properly. Any imports to |
Posting here so I don't forget, but I noticed that build_resolvers also relies on the existing experiments spec which says they only work on the current version. We need to remember to remove that check if the behavior changes. |
this seems like a bug. can it be fixed and published?
it would have to be ready to go (tested on branch) by Thursday of this week. but based on @jakemac53's comments below I'm not sure if it's going to solve us.
|
We need to think more about how this interacts with the old versions that are published and have wide sdk constraints. Because those do exist the concern is that people end up with really old analyzer versions which puts you in a similar situation. At least as far as the immediate issue is concerned, it wouldn't help because there is a current published version whose current language version is We could possibly however do the following, and it might work for more users than not:
This would make it so most users would not get the "bad" 0.39.15 version, pub would instead choose one of the newer versions, at least until |
To paraphrase the last solution a bit:
This helps us because we want people on the 2.9 SDK to be able to use If that's correct, the dual publish of package:analyzer sounds like a reasonable solution (solves the issue, and low-risk for further complications). edit: thinking about this more, I'd be concerned about how we'd get package:analyzer api changes or fixes to users on dart 2.9; that'll be the stable version for ~3 months We could publish the experiments flag info as a package, and put sdk constraints (^2.9, ^2.10) on that? |
We are going to do a temporary fix here to pin the analyzer, longer term we have a plan to change how experiment language versions work, such that they can be pinned to a certain version instead of the "current" version which caused a lot of pain when switching from 2.9 -> 2.10. |
A new version of build_runner has been published which pins analyzer, so a I am going to leave this open until we implement the long term fix though. |
Note that this won't necessarily help if you have another transitive dependency on analyzer (like I think we should probably additionally work on the two analyzer releases that I described to resolve the issue more thoroughly. We could always expand the constraint later on if so desired. |
This is fine by me. |
You're suggesting an analyzer which works (solves) for 2.9, and one which works for 2.10? The 2nd one I'd have concerns about - that would mean we wouldn't be able to get changes or fixes to people on 2.9 (the upcoming stable release) going forward. |
This would not have to be a long term thing, just temporary releases to resolve this issue. Once the longer term solution is implemented analyzer could widen the constraint later on, if we think that is the right thing to do (spoiler alert I don't haha but that is orthogonal and it isn't my project). |
Do we still need two version of analyzer for |
I'm fine with option 4 given the understanding that the allow list is taken from the end users SDK. That is, if package collection is added to the allow list in Dart 2.9, it is important that when run on a Dart 2.8 SDK, the analyzer package not treat package collection as being in the allow list, since otherwise versions of package collection which were intended to be opted out will be treated as opted in. |
If we go with option 4 and can implement it relatively quickly, then I would be ok without publishing two new analyzer versions (for 2.9 and 2.10). But some users were already broken, and not all of them will be fixed by the change we made in build_runner to pin analyzer (they may end up getting the previous build_runner version instead of the previous analyzer depending on their pub solve) |
I started working on a CL to access the language version from SDK, but I hit issues that analyzer is given incomplete SDK (no I think it is not reasonable to expect that analyzer works with incomplete SDK. But now it will take some time when, or if, these additional changes will be made by other people. |
Bug: dart-lang/build#2763 (comment) Change-Id: I8232bd395abc9efea0e5c27716450d6a5442b3bb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156489 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: William Hesse <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
Actually ~/github/iOS/vid_flutter_plugin/packages/vid_flutter_core ~/github/iOS/vid_flutter_plugin
And we are using |
@Sauraus A |
As stated in flutter/flutter#62240 (comment), if @jakemac53 Is this intended? Or is it a bug with pubspec resolution? |
This is likely just a reflection of how the pub solve algorithm works, but not a bug. Basically, if it starts trying to solve for analyzer versions before solving for build_runner versions this could happen. Either way you won't be getting the latest of one or the other, so it is somewhat arbitrary which it would choose to downgrade. Re-ordering your dependencies so that We do have a larger fix coming soon hopefully which will resolve this from the analyzer side of things. |
'pub upgrade' may need to be run to ensure the latest version of build_runners is fetched. See dart-lang/build#2763
'pub upgrade' may need to be run to ensure the latest version of build_resolvers is fetched. See dart-lang/build#2763
cc @scheglov does the analyzer now read the version from the sdk being analyzed or were you still blocked on that? |
I'm currently blocked on https://dart-review.googlesource.com/c/sdk/+/122483 to make use this language version in the analyzer. |
Hi ! I tried
|
@EskAere does the latest analyzer work for you now? I think it may resolve the original issues stated here. Otherwise the latest dart_style requires the latest analyzer so overriding it to an earlier version now results in this error. You could set your analyzer version via |
Yes i confirm, it's working for me with latest analyzer now ! Thank you ! |
Ok, I am going to close this issue as I believe the root cause is in fact resolved now, please try removing your dependency overrides, upgrading to the latest analyzer, and confirming it fixes things (if you haven't already). If it doesn't please respond here with the issues you are still encountering. |
It is still not working
also the error is
earlier overriding did work , but now that also doesnt work |
@amanv8060 you need to have a wider constraint on |
i don't know what was wrong ,at last i was able to get the desired thing , deleted my old project , created a new project , then copied the old pubspec in new one and it worked . both did not have dependency override .. We can lock this now , i guess |
It didn't work before because some dependencies were locked to a fixed version in The easy fix is to delete the |
Uh oh!
There was an error while loading. Please reload this page.
The flutter SDK has
// @dart=2.9
comments in it, meant to opt it in, but the latest analyzer now requires language version 2.10 (regardless of the current sdk version).I don't know the best way to resolve this, soon flutter will presumably have the
// @dart=2.10
comments (it will have to), but all old flutter sdks would be broken with build_runner if users get the latest analyzer.cc @scheglov @leafpetersen @natebosch
The text was updated successfully, but these errors were encountered: