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
[flutter_tools] pubspec.yaml environment.flutter constraint not respected by pub get #95472
Comments
@neiljaywarner |
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. |
@darshankawar sorry I didn't see your question. |
Specifically I would like it to behave as expected consistently in both
directions and enforce upper constraint as well as lower constraint.
Not just force/remind devs to upgrade when the team decides to but disallow
them to race ahead.
For example ci should not be able to make a build with a flutter version
never tested by qa
....sent from my phone
…On Mon, Jan 10, 2022, 8:58 AM github-actions[bot] ***@***.***> wrote:
Reopened #95472 <#95472>.
—
Reply to this email directly, view it on GitHub
<#95472 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXBGYPMMDPT4S5GKON7BRLUVLXY5ANCNFSM5KJIXPCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The current version with upper constraint I have is |
What you have should disallow 3.0
0 it fails the constraint of bring less than or equal to 3.0
In fact 3.0 would pass and be compile and build except for the fact that
3.0 is a major version and would have breaking changes.
Honestly I want to be able to constrain to 2.8.1 for example so 2.8.0 fails
and 2.8.2 fails.
I don't ever want the project upgraded silently by random dev or random
server with no pr review or discussion.
This concept weeks with the lower constraint but upper constraint is broken
and as far as I could tell does nothing.
Thanks
....sent from my phone
…On Tue, Jan 11, 2022, 12:00 AM darshankawar ***@***.***> wrote:
The current version with upper constraint I have is sdk: ">=2.8.1 <3.0.0"
which works well, indicating the min lower and max upper version
constraint, so I am not entirely sure what your request here is.
—
Reply to this email directly, view it on GitHub
<#95472 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXBGYND6UZTHEZFVZSECILUVPBPTANCNFSM5KJIXPCQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Keeping it open and labeling for further input. |
@darshankawar is it clear my goal now? I want to pin a specific version so neither ci/cd nor a new dev "accidentally" upgrades the flutter version for any builds they distribute to anybody and it won't compile at all on an incorrect flutter version. + @goderbauer |
I am quite not sure if this is currently supported. I ran dependencies:
flutter:
sdk: ">=2.5.1 <2.8.1" and pub get fails with Because test_app depends on flutter from SDK which doesn't exist (unknown SDK ">=2.5.1 <2.8.1"), version solving failed. and using the below constraints still fails, so it makes me wonder if its a bug or is it not supported dependencies:
flutter:
sdk: ">=2.10.2 <2.13.0" Because test_app depends on flutter from sdk which doesn't exist (unknown SDK ">=2.10.2 <2.13.0"), version solving failed.
pub get failed (server unavailable) -- attempting retry 9 in 64 seconds... |
Per https://dart.dev/tools/pub/pubspec#sdk-constraints, the way to do this is via the
From the link:
However, this doesn't seem to be enforced when I locally try this. I believe this function call should be validating this: https://github.com/dart-lang/pub/blob/master/lib/src/validator/sdk_constraint.dart#L81 |
@christopherfujino @darshankawar @maheshmnj yes, that's the whole point, it is supposed to work but doesn't. |
@neiljaywarner you don't need to get snippy with me, I'm just documenting more context, to help solve this. |
I am so sorry.
I did not mean to be snippy I was just concerned about clarity and I think
we are in agreement.
I love flutter and dart and I appreciate the response and I'm very sorry
please forgive me .
....sent from my phone
(I appreciate you providing the context)
…On Mon, Apr 11, 2022, 11:43 AM Christopher Fujino ***@***.***> wrote:
@christopherfujino <https://github.com/christopherfujino> @darshankawar
<https://github.com/darshankawar> @maheshmnj
<https://github.com/maheshmnj> yes, that's the whole point, it is
supposed to work but doesn't.
@neiljaywarner <https://github.com/neiljaywarner> you don't need to get
snippy with me, I'm just documenting more context, to help solve this.
—
Reply to this email directly, view it on GitHub
<#95472 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXBGYIBNR6N6T5LJQN7BG3VERJEPANCNFSM5KJIXPCQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Another filing of this in #80610 |
Ok, in playing around with this further, it seems that lower bounds are respected (e.g. I believe there is a historical reason for this. Also, I imagine it would be difficult to enable upper bounds, as this would be a breaking change. However, it seems exact pins would be very useful, and would be relatively safe to enable. |
Yeah, I remember. We changed this to enable the roll-out of Flutter 2; prior to that we had both a lower and upper bound, but when we went to Flutter 2 -- which wasn't a major breaking release from a semver perspective -- we would have "broken the world", so we removed the upper-constraint. Pinning to a single SDK is a request I've heard fairly often. It can be useful for teams that want to ensure all team members are on the same SDK. Unfortunately a constraint like |
Is the blocker to enabling |
i also notice becomes |
It is also a technical issue. eg: => the flutter_localizations of flutter 3.7.0 had breaking changes adding parameters. so when I want to use a string from the localisation it changed from being Therefore a dev should be infomed when he uses a flutter version which is "too new" hope that helps :) |
Using a fixed Flutter version would be enough for cases that force CI/CD not to accidentally upgrade to a newer version of Flutter (mostly happened during a new stable version released but the project has not been migrated). However, enabling version constraints like |
Adding a note that the flutter version constraint is not fully enforced -- see [this issue](flutter/flutter#95472) --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. - [x] This PR doesn’t contain automatically generated corrections or text (Grammarly, LLMs, and similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide](https://github.com/dart-lang/site-www/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Code changes should generally follow the [Dart style guide](https://dart.dev/effective-dart) and use `dart format`. - Updates to [code excerpts](https://github.com/dart-lang/site-shared/blob/main/doc/code-excerpts.md) indicated by `<?code-excerpt` need to be updated in their source `.dart` file as well. </details> --------- Co-authored-by: Anthony Sansone <atsansone@users.noreply.github.com> Co-authored-by: Parker Lougheed <parlough@gmail.com>
Adding a note that the flutter version constraint is not fully enforced -- see [this issue](flutter/flutter#95472) --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. - [x] This PR doesn’t contain automatically generated corrections or text (Grammarly, LLMs, and similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide](https://github.com/dart-lang/site-www/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Code changes should generally follow the [Dart style guide](https://dart.dev/effective-dart) and use `dart format`. - Updates to [code excerpts](https://github.com/dart-lang/site-shared/blob/main/doc/code-excerpts.md) indicated by `<?code-excerpt` need to be updated in their source `.dart` file as well. </details> --------- Co-authored-by: Anthony Sansone <atsansone@users.noreply.github.com> Co-authored-by: Parker Lougheed <parlough@gmail.com>
Hi. The main issue is that it is not obvious if I specify |
We migrated to flutter recently and flutter version installed among team was one of the first team issues we hit. Setting up a new machine, or coordinating version upgrades among team would be difficult. I can also foresee debugging weirdness in CI if it silently gets a breaking version of flutter. In our case, we don't essentially need a range but locking to a wildcard version could be nice (e.g. 3.19.x or 3.x.x). Also, the range silently failing is hard to notice unless you notice the difference in the diff:
|
steps to reproduce
Expected behaviour - flutter pub get error
Actual behaviour: pub get succeeds; vesrion constraint fails, overzealous dev or build server just ugpraded to a newer version of flutter without discussion or any testing at all or possibly even an easy OOTB way to see what version was built with
The text was updated successfully, but these errors were encountered: