Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[tool] Upgrade repo to support Dart super parameters feature #5279

Closed

Conversation

ditman
Copy link
Member

@ditman ditman commented Apr 15, 2022

Ensure the Dart SDK is recent enough so the apps generated with a new language feature (super parameters) work; in our case, the "all_plugins" app.

*Should allow landing this flutter/flutter roll (included): #5278

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • [~] I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@ditman
Copy link
Member Author

ditman commented Apr 15, 2022

Yikes, dart is too old, it seems we don't use the dart coming alongside flutter :/

@ditman
Copy link
Member Author

ditman commented Apr 15, 2022

Aha, Dart is coming from flutter; but from the flutter version that the dockerfile installs:

 ENV PATH=/usr/local/sbin:...:/sdks/flutter/bin/cache/dart-sdk/bin

(from here (See Layer 16))

For this to pass we need to either update the dockerfile to something more recent (they're all ~11 days old, maybe enough) or tweak our PATH so we use dart from the flutter version we pin, instead of the one from the dockerfile.

🚨 Roller Stopped 🚨

@ditman ditman changed the title [tool] Fix all plugins for superparameters [tool] Upgrade repo to support Dart super parameters feature Apr 15, 2022
@stuartmorgan-g
Copy link
Contributor

Aha, Dart is coming from flutter; but from the flutter version that the dockerfile installs

That's the version of Flutter we update to whatever version we are testing against.

I think the actual problem is that you're trying to unconditionally use a new language feature, which breaks our stable tests.

@@ -155,7 +155,7 @@ class CreateAllPluginsAppCommand extends PluginCommand {
version: Version.parse('1.0.0+1'),
environment: <String, VersionConstraint>{
'sdk': VersionConstraint.compatibleWith(
Version.parse('2.12.0'),
Version.parse('2.17.0'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what we'll want to do is read flutter --version --machine and then conditionally set this to 12 or 17 depending on the dartSDKVersion we get.

Actually, come to think of it we could probably future-proof this command against this kind of thing by just always using the dartSdkVersion as this version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that wouldn't be quite right either; it would break us in cases like when Dart supported NNBD, but the template hadn't been updated yet and was still using an older version constraints so as not to opt in. #5281 should be the fully future-proof version.

@stuartmorgan-g
Copy link
Contributor

Closing in favor of #5281

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants