Skip to content

[tool] Make more commands work without Flutter#11797

Merged
auto-submit[bot] merged 6 commits into
flutter:mainfrom
stuartmorgan-g:tool-reduce-flutter-requirement
May 28, 2026
Merged

[tool] Make more commands work without Flutter#11797
auto-submit[bot] merged 6 commits into
flutter:mainfrom
stuartmorgan-g:tool-reduce-flutter-requirement

Conversation

@stuartmorgan-g

@stuartmorgan-g stuartmorgan-g commented May 27, 2026

Copy link
Copy Markdown
Collaborator
  • Updates some cases where 'flutter' was used unconditionally, now that we need to support a repository without Flutter installed.
    • Removes some outdated comments and plumbing for forcing flutter pub over dart pub, as the reason we used to do it no longer applies now that dart pub also fetches examples by default.
  • Adds --skip-if-not-supporting-dart-version to support N-1 and N-2 testing in core-packages.

Updates some cases where 'flutter' was used unconditionally, now that we
need to support a repository without Flutter installed.

Removes some outdated comments and plumbing for forcing `flutter pub`
over `dart pub`, as the reason we used to do it no longer applies now
that `dart pub` also fetches examples by default.
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the tooling to use either flutter or dart for pub commands (including analyze, publish, and publish-check) depending on whether the package requires Flutter. It also removes the alwaysUseFlutter parameter from runPubGet and updates the corresponding tests. The reviewer suggested using _dartBinaryPath instead of the hardcoded 'dart' executable in AnalyzeCommand to respect the custom SDK path specified via the --analysis-sdk option.

Comment thread script/tool/lib/src/analyze_command.dart Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label May 27, 2026
@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label May 27, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label May 27, 2026
@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label May 27, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label May 27, 2026
@stuartmorgan-g

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the tooling to support non-Flutter-based repositories. It ensures that pub commands use either flutter or dart depending on whether the package requires Flutter for analysis and publishing. Additionally, it introduces the --skip-if-not-supporting-dart-version option to allow skipping packages based on Dart version constraints rather than Flutter versions. Relevant tests have been updated and added to verify these behaviors. I have no feedback to provide as there are no review comments.

@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label May 27, 2026

@chunhtai chunhtai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mostly looks good, just some suggestion that we should probably refactor some common logic out since they are used in multiple places

Comment thread script/tool/lib/src/common/pub_utils.dart Outdated
Comment thread script/tool/lib/src/analyze_command.dart
Comment thread script/tool/lib/src/publish_check_command.dart Outdated
Comment thread script/tool/lib/src/publish_command.dart Outdated
Comment thread script/tool/lib/src/common/pub_utils.dart
@stuartmorgan-g stuartmorgan-g added CICD Run CI/CD and removed CICD Run CI/CD labels May 28, 2026
@stuartmorgan-g stuartmorgan-g requested a review from chunhtai May 28, 2026 15:07
@github-actions github-actions Bot removed the CICD Run CI/CD label May 28, 2026
@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label May 28, 2026

@chunhtai chunhtai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
@auto-submit auto-submit Bot merged commit 81b5b2f into flutter:main May 28, 2026
87 checks passed
@stuartmorgan-g stuartmorgan-g deleted the tool-reduce-flutter-requirement branch May 28, 2026 18:25
pull Bot pushed a commit to Superoldman96/flutter that referenced this pull request May 29, 2026
…r#187306)

flutter/packages@10cbdc5...e930ced

2026-05-28 [email protected]
[vector_graphics_compiler]: Fix Stack Overflow and CPU/Memory DoS on
SVGs with circular references or exponential expansions
(flutter/packages#11740)
2026-05-28 [email protected] [tool] Make more commands work
without Flutter (flutter/packages#11797)
2026-05-28 [email protected] Roll Flutter from
c8f2f16 to e70534d (18 revisions) (flutter/packages#11799)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit Bot pushed a commit that referenced this pull request Jun 4, 2026
#11797 changed the repo tooling to use `dart` instead of `flutter` for more commands when the target package isn't a Flutter package, include `pub downgrade` and `pub get` in `analyze`. However, since `pub get` will resolve any example apps, if any of *them* use Flutter, `dart pub get` will fail unless `dart` is coming from the Flutter SDK. Normally this is fine since that's the expected setup, but for the head-head tests in dart-lang that run the repo analysis using the head version of Dart via the `--analysis-sdk` flag, using that version of Dart for pub commands breaks things.

This checks the example apps for Flutter dependencies to ensure that `dart pub` won't be used in cases where that can cause failures to resolve in the examples. This should be safe for core-packages, since core-packages should never use Flutter, even in examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants