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
dart 2.19 beta.4 reports incorrect version range #3738
Comments
Yeah - this is because we decided to extend the compatibility forwards, such that We only do this for constraints that enable null-safety: The logic was implemented here: #3572 Original issue here: #3554 The intent is that you will not see the rewritten constraint in error messages (after dart 3 such a constraint is always matched with the current sdk) but for dart 2.19 this can happen... I think I did not really consider that case. I wonder if this is serious enough that we should try to hotfix it for 2.19? The hotfix would probably be to revert #3572 such that it only takes effect in dart 3. It will never cause a resolution to fail that would otherwise have succeeded, only it will have a confusing error message. @mit-mit WDYT? |
@sigurdm, won't this also be a source of confusion in 3.x? I think at one-point we considered doing:
I don't recall why we abandoned it, probably it was messy to carry the information around. Maybe, we could do something like:
Maybe, we can do a better message. But as I recall the "The current Dart SDK version is 2.19.0-444.4.beta." part comes from a "hint" on the incompatibility... Maybe there is a way we can provide another hint. |
It is much harder to achieve the error message in dart 3 (because dart 3 is part of the extended range) We are actually carrying the information around. I implemented this here https://github.com/dart-lang/pub/blob/master/lib/src/pubspec.dart#L659 . But due to the way we calculate a union of sdk constraints here: pub/lib/src/solver/package_lister.dart Line 347 in 12a2af4
pub/lib/src/solver/incompatibility.dart Line 134 in 12a2af4
We could probably fix this |
I think this is breaking my package score in pub.dev: https://pub.dev/packages/isolate_current_directory/score
My pubspec says:
|
Or maybe pub.dev's score system needs to upgrade its Dart SDK given it seems to be behind? |
@renatoathaydes I think this was fixed? I'm seeing 130/140 points on my end... |
@mit-mit ah great, they probably updated the Dart SDK, it was failing lots of things before! |
I'm getting a
My pubspec.yaml, post-
Is this linked to this issue? |
That is unrelated -- it looks like you are previewing the upcoming records feature? In that case you need the lower constraint to be |
Closing, as this has landed in a stable hotfix. |
I have the following pubspec.yaml
Note the max sdk is < 3.0.0
When I run dart pub get
Note the upper version is displayed as < 4.0.0 rather than the expected < 3.0.0
FYI:
The text was updated successfully, but these errors were encountered: