[tool] Use flutter for pub commands when examples use Flutter#11830
Conversation
flutter#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.
There was a problem hiding this comment.
Code Review
This pull request updates the tooling to run flutter pub commands instead of dart pub for non-Flutter packages that contain Flutter examples, ensuring correct dependency resolution. This is implemented by adding a recursiveFlutterCheck flag to the pub utility functions. Feedback on the changes suggests updating startPubCommand to also support and forward this new flag for completeness, and explicitly passing examples: [] when creating a fake example package in the tests for consistency.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
srawlins
left a comment
There was a problem hiding this comment.
This makes sense to me; love that there are tests :D
|
autosubmit label was removed for flutter/packages/11830, because - The status or check suite Mac_arm64 custom_package_tests master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/packages/11830, because - The status or check suite Mac_arm64 macos_platform_tests master - packages has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/packages/11830, because - The status or check suite Mac_arm64 macos_platform_tests master - packages has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/packages/11830, because - The status or check suite Mac_arm64 macos_platform_tests master - packages has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…r#187612) flutter/packages@03352b5...61bdbb4 2026-06-04 stuartmorgan@google.com [tool] Use `flutter` for pub commands when examples use Flutter (flutter/packages#11830) 2026-06-04 stuartmorgan@google.com Sync analysis_options.yaml with flutter/flutter (flutter/packages#11823) 2026-06-04 stuartmorgan@google.com [path_provider] Create temp dir in tests if needed (flutter/packages#11841) 2026-06-04 jeff.ward@datadoghq.com [webview] Add new method for cross plugin webview access (flutter/packages#11714) 2026-06-04 47866232+chunhtai@users.noreply.github.com [ci] Renames the override post-release label for batch release (flutter/packages#11835) 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 flutter-ecosystem@google.com 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
…ter#11830) flutter#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.
…r#187612) flutter/packages@03352b5...61bdbb4 2026-06-04 stuartmorgan@google.com [tool] Use `flutter` for pub commands when examples use Flutter (flutter/packages#11830) 2026-06-04 stuartmorgan@google.com Sync analysis_options.yaml with flutter/flutter (flutter/packages#11823) 2026-06-04 stuartmorgan@google.com [path_provider] Create temp dir in tests if needed (flutter/packages#11841) 2026-06-04 jeff.ward@datadoghq.com [webview] Add new method for cross plugin webview access (flutter/packages#11714) 2026-06-04 47866232+chunhtai@users.noreply.github.com [ci] Renames the override post-release label for batch release (flutter/packages#11835) 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 flutter-ecosystem@google.com 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
#11797 changed the repo tooling to use
dartinstead offlutterfor more commands when the target package isn't a Flutter package, includepub downgradeandpub getinanalyze. However, sincepub getwill resolve any example apps, if any of them use Flutter,dart pub getwill fail unlessdartis 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-sdkflag, using that version of Dart for pub commands breaks things.This checks the example apps for Flutter dependencies to ensure that
dart pubwon'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.