Initialize default-flavor in FlutterCommand, adds integration test.#169298
Merged
auto-submit[bot] merged 8 commits intomasterfrom May 28, 2025
Merged
Initialize default-flavor in FlutterCommand, adds integration test.#169298auto-submit[bot] merged 8 commits intomasterfrom
default-flavor in FlutterCommand, adds integration test.#169298auto-submit[bot] merged 8 commits intomasterfrom
Conversation
bkonyi
reviewed
May 22, 2025
| 'set using --${FlutterOptions.kDartDefinesOption} or --${FlutterOptions.kDartDefineFromFileOption}', | ||
| ); | ||
| } | ||
| dartDefines.add('$kAppFlavor=$flavor'); |
Contributor
There was a problem hiding this comment.
Do we still need to add the flavor here now that we're doing it in flutter_command.dart?
Contributor
Author
There was a problem hiding this comment.
My understanding is yes because this is special-case handling for special Xcode-y things, but I will need to ask @vashworth to be sure.
Contributor
There was a problem hiding this comment.
Yeah this is still needed for when you launch the app from Xcode instead of the CLI. I think we may also need to check if the flavor is already in the dartDefines here and skip the parsing and adding if it is, otherwise it'll get added twice I think
bkonyi
approved these changes
May 26, 2025
Contributor
bkonyi
left a comment
There was a problem hiding this comment.
Thanks for getting this over the line. LGTM!
flutteractionsbot
pushed a commit
to flutteractionsbot/flutter
that referenced
this pull request
May 28, 2025
flutteractionsbot
pushed a commit
to flutteractionsbot/flutter
that referenced
this pull request
May 28, 2025
Contributor
Author
|
reason for revert: Broke mac/iOS integration tests. |
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 28, 2025
…ation test. (#169298)" (#169581) <!-- start_original_pr_link --> Reverts: #169298 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: matanlurey <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: Broke mac/iOS integration tests. <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: matanlurey <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {vashworth, bkonyi} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: Closes #169160. Closes #165803. <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 28, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 28, 2025
auto-submit bot
pushed a commit
to flutter/packages
that referenced
this pull request
May 28, 2025
flutter/flutter@4372bfb...0e536eb 2025-05-28 [email protected] Introduces FlutterPluginRegistrant protocol. (flutter/flutter#169399) 2025-05-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Initialize `default-flavor` in `FlutterCommand`, adds integration test. (#169298)" (flutter/flutter#169581) 2025-05-28 [email protected] Initialize `default-flavor` in `FlutterCommand`, adds integration test. (flutter/flutter#169298) 2025-05-28 [email protected] Update DEPS to add dart-lang/ai repo (flutter/flutter#169540) 2025-05-28 [email protected] Roll Skia from 92311f2ba0b7 to 82d326fc2148 (1 revision) (flutter/flutter#169552) 2025-05-28 [email protected] dev/bots: improve service worker test code (flutter/flutter#169231) 2025-05-28 [email protected] Make Android team platform view TESTOWNERS (flutter/flutter#169297) 2025-05-28 [email protected] Roll Skia from 044f58f78a73 to 92311f2ba0b7 (9 revisions) (flutter/flutter#169542) 2025-05-27 [email protected] Roll Skia from 443f5257f382 to 044f58f78a73 (16 revisions) (flutter/flutter#169530) 2025-05-27 [email protected] [web] Fix unresponsive input above SelectionArea in Safari and Firefox. (flutter/flutter#167275) 2025-05-27 [email protected] Set pause_isolates_on_start flag if --start-paused (flutter/flutter#169392) 2025-05-27 [email protected] Roll Packages from af0b9a9 to 6eebe72 (24 revisions) (flutter/flutter#169514) 2025-05-27 [email protected] Roll Fuchsia Linux SDK from 5mpmPsuD8rpeiJizT... to nC9hLWjYVlChDTEPh... (flutter/flutter#169498) 2025-05-27 [email protected] Split hint from label and expose it via aria-description or aria-describedby (flutter/flutter#169157) 2025-05-26 [email protected] 🐛 Normalize generated file paths for the l10n generator (flutter/flutter#169467) 2025-05-26 [email protected] Roll Dart SDK from d811152316e4 to 6aeb798bdbe2 (2 revisions) (flutter/flutter#169478) 2025-05-26 [email protected] [Cupertino] Apply RSuperellipse to most Cupertino widgets (flutter/flutter#167784) 2025-05-26 [email protected] Roll `package:dds` to 5.0.2 (flutter/flutter#169471) 2025-05-26 [email protected] Use `.flutter-plugins-dependencies` for crash reporting. (flutter/flutter#169319) 2025-05-26 [email protected] Remove now disabled code that would generate `.flutter-plugins`. (flutter/flutter#169320) 2025-05-26 [email protected] Roll Dart SDK from 7dab9bffe1f7 to d811152316e4 (1 revision) (flutter/flutter#169473) 2025-05-26 [email protected] Precise browser resizing with integration_test and driver (flutter/flutter#160678) 2025-05-26 [email protected] Add `/coverage/` to `.gitignore.tmp` (flutter/flutter#169387) 2025-05-26 [email protected] Make test output with encoded `dart-defines=...` human readable. (flutter/flutter#169353) 2025-05-26 [email protected] Use at most `PROC~/2` tasks to transform assets. (flutter/flutter#169386) 2025-05-26 [email protected] Forward exit code from dart test to flutter test (flutter/flutter#168604) 2025-05-26 [email protected] Fix warning when building for macOS desktop (flutter/flutter#165996) 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 Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
matanlurey
added a commit
to matanlurey/flutter
that referenced
this pull request
May 28, 2025
…s integration test. (flutter#169298)" (flutter#169581)" This reverts commit 5d013c7.
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 28, 2025
Closes #169598 (which explains the integration test failure). Closes #169160. Closes #165803. This is the only diff from 5d013c7: ```diff diff --git a/packages/flutter_tools/lib/src/build_system/targets/common.dart b/packages/flutter_tools/lib/src/build_system/targets/common.dart index 6158321..6773101 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/common.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/common.dart @@ -308,10 +308,18 @@ class KernelSnapshot extends Target { if (flavor == null) { return; } - if (!dartDefines.any((String element) => element.startsWith(kAppFlavor))) { - // If the flavor is not already in the dart defines, add it. - dartDefines.add('$kAppFlavor=$flavor'); - } + + // It is possible there is a flavor already in dartDefines, from another + // part of the build process, but this should take precedence as it happens + // last (xcodebuild execution). + // + // See #169598. + + // If the flavor is already in the dart defines, remove it. + dartDefines.removeWhere((String define) => define.startsWith(kAppFlavor)); + + // Then, add it to the end. + dartDefines.add('$kAppFlavor=$flavor'); } } ```
flutteractionsbot
pushed a commit
to flutteractionsbot/flutter
that referenced
this pull request
May 28, 2025
…er#169602) Closes flutter#169598 (which explains the integration test failure). Closes flutter#169160. Closes flutter#165803. This is the only diff from 5d013c7: ```diff diff --git a/packages/flutter_tools/lib/src/build_system/targets/common.dart b/packages/flutter_tools/lib/src/build_system/targets/common.dart index 6158321..6773101 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/common.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/common.dart @@ -308,10 +308,18 @@ class KernelSnapshot extends Target { if (flavor == null) { return; } - if (!dartDefines.any((String element) => element.startsWith(kAppFlavor))) { - // If the flavor is not already in the dart defines, add it. - dartDefines.add('$kAppFlavor=$flavor'); - } + + // It is possible there is a flavor already in dartDefines, from another + // part of the build process, but this should take precedence as it happens + // last (xcodebuild execution). + // + // See flutter#169598. + + // If the flavor is already in the dart defines, remove it. + dartDefines.removeWhere((String define) => define.startsWith(kAppFlavor)); + + // Then, add it to the end. + dartDefines.add('$kAppFlavor=$flavor'); } } ```
flutteractionsbot
pushed a commit
to flutteractionsbot/flutter
that referenced
this pull request
May 28, 2025
…er#169602) Closes flutter#169598 (which explains the integration test failure). Closes flutter#169160. Closes flutter#165803. This is the only diff from 5d013c7: ```diff diff --git a/packages/flutter_tools/lib/src/build_system/targets/common.dart b/packages/flutter_tools/lib/src/build_system/targets/common.dart index 6158321..6773101 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/common.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/common.dart @@ -308,10 +308,18 @@ class KernelSnapshot extends Target { if (flavor == null) { return; } - if (!dartDefines.any((String element) => element.startsWith(kAppFlavor))) { - // If the flavor is not already in the dart defines, add it. - dartDefines.add('$kAppFlavor=$flavor'); - } + + // It is possible there is a flavor already in dartDefines, from another + // part of the build process, but this should take precedence as it happens + // last (xcodebuild execution). + // + // See flutter#169598. + + // If the flavor is already in the dart defines, remove it. + dartDefines.removeWhere((String define) => define.startsWith(kAppFlavor)); + + // Then, add it to the end. + dartDefines.add('$kAppFlavor=$flavor'); } } ```
auto-submit bot
pushed a commit
that referenced
this pull request
May 29, 2025
…169623) This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request) Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request. ### Issue Link: What is the link to the issue this cherry-pick is addressing? #169602 ### Changelog Description: Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples Fixes a bug where `appFlavor` is `null` when being run with `flutter test` or being hot-restarted. ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch) Cannot reliably use `appFlavor` without rebuilding the app from scratch. ### Workaround: Is there a workaround for this issue? Do not use hot restart, do not use `flutter test`. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? Automated test coverage.
auto-submit bot
pushed a commit
that referenced
this pull request
May 30, 2025
…9624) This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request) Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request. ### Issue Link: What is the link to the issue this cherry-pick is addressing? #169602 ### Changelog Description: Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples Fixes a bug where `appFlavor` is `null` when being run with `flutter test` or being hot-restarted. ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch) Cannot reliably use `appFlavor` without rebuilding the app from scratch. ### Workaround: Is there a workaround for this issue? Do not use hot restart, do not use `flutter test`. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? Automated test coverage.
FMorschel
pushed a commit
to FMorschel/packages
that referenced
this pull request
Jun 9, 2025
flutter/flutter@4372bfb...0e536eb 2025-05-28 [email protected] Introduces FlutterPluginRegistrant protocol. (flutter/flutter#169399) 2025-05-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Initialize `default-flavor` in `FlutterCommand`, adds integration test. (#169298)" (flutter/flutter#169581) 2025-05-28 [email protected] Initialize `default-flavor` in `FlutterCommand`, adds integration test. (flutter/flutter#169298) 2025-05-28 [email protected] Update DEPS to add dart-lang/ai repo (flutter/flutter#169540) 2025-05-28 [email protected] Roll Skia from 92311f2ba0b7 to 82d326fc2148 (1 revision) (flutter/flutter#169552) 2025-05-28 [email protected] dev/bots: improve service worker test code (flutter/flutter#169231) 2025-05-28 [email protected] Make Android team platform view TESTOWNERS (flutter/flutter#169297) 2025-05-28 [email protected] Roll Skia from 044f58f78a73 to 92311f2ba0b7 (9 revisions) (flutter/flutter#169542) 2025-05-27 [email protected] Roll Skia from 443f5257f382 to 044f58f78a73 (16 revisions) (flutter/flutter#169530) 2025-05-27 [email protected] [web] Fix unresponsive input above SelectionArea in Safari and Firefox. (flutter/flutter#167275) 2025-05-27 [email protected] Set pause_isolates_on_start flag if --start-paused (flutter/flutter#169392) 2025-05-27 [email protected] Roll Packages from af0b9a9 to 6eebe72 (24 revisions) (flutter/flutter#169514) 2025-05-27 [email protected] Roll Fuchsia Linux SDK from 5mpmPsuD8rpeiJizT... to nC9hLWjYVlChDTEPh... (flutter/flutter#169498) 2025-05-27 [email protected] Split hint from label and expose it via aria-description or aria-describedby (flutter/flutter#169157) 2025-05-26 [email protected] 🐛 Normalize generated file paths for the l10n generator (flutter/flutter#169467) 2025-05-26 [email protected] Roll Dart SDK from d811152316e4 to 6aeb798bdbe2 (2 revisions) (flutter/flutter#169478) 2025-05-26 [email protected] [Cupertino] Apply RSuperellipse to most Cupertino widgets (flutter/flutter#167784) 2025-05-26 [email protected] Roll `package:dds` to 5.0.2 (flutter/flutter#169471) 2025-05-26 [email protected] Use `.flutter-plugins-dependencies` for crash reporting. (flutter/flutter#169319) 2025-05-26 [email protected] Remove now disabled code that would generate `.flutter-plugins`. (flutter/flutter#169320) 2025-05-26 [email protected] Roll Dart SDK from 7dab9bffe1f7 to d811152316e4 (1 revision) (flutter/flutter#169473) 2025-05-26 [email protected] Precise browser resizing with integration_test and driver (flutter/flutter#160678) 2025-05-26 [email protected] Add `/coverage/` to `.gitignore.tmp` (flutter/flutter#169387) 2025-05-26 [email protected] Make test output with encoded `dart-defines=...` human readable. (flutter/flutter#169353) 2025-05-26 [email protected] Use at most `PROC~/2` tasks to transform assets. (flutter/flutter#169386) 2025-05-26 [email protected] Forward exit code from dart test to flutter test (flutter/flutter#168604) 2025-05-26 [email protected] Fix warning when building for macOS desktop (flutter/flutter#165996) 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 Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
Ortes
pushed a commit
to Ortes/packages
that referenced
this pull request
Jun 25, 2025
flutter/flutter@4372bfb...0e536eb 2025-05-28 [email protected] Introduces FlutterPluginRegistrant protocol. (flutter/flutter#169399) 2025-05-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Initialize `default-flavor` in `FlutterCommand`, adds integration test. (#169298)" (flutter/flutter#169581) 2025-05-28 [email protected] Initialize `default-flavor` in `FlutterCommand`, adds integration test. (flutter/flutter#169298) 2025-05-28 [email protected] Update DEPS to add dart-lang/ai repo (flutter/flutter#169540) 2025-05-28 [email protected] Roll Skia from 92311f2ba0b7 to 82d326fc2148 (1 revision) (flutter/flutter#169552) 2025-05-28 [email protected] dev/bots: improve service worker test code (flutter/flutter#169231) 2025-05-28 [email protected] Make Android team platform view TESTOWNERS (flutter/flutter#169297) 2025-05-28 [email protected] Roll Skia from 044f58f78a73 to 92311f2ba0b7 (9 revisions) (flutter/flutter#169542) 2025-05-27 [email protected] Roll Skia from 443f5257f382 to 044f58f78a73 (16 revisions) (flutter/flutter#169530) 2025-05-27 [email protected] [web] Fix unresponsive input above SelectionArea in Safari and Firefox. (flutter/flutter#167275) 2025-05-27 [email protected] Set pause_isolates_on_start flag if --start-paused (flutter/flutter#169392) 2025-05-27 [email protected] Roll Packages from af0b9a9 to 6eebe72 (24 revisions) (flutter/flutter#169514) 2025-05-27 [email protected] Roll Fuchsia Linux SDK from 5mpmPsuD8rpeiJizT... to nC9hLWjYVlChDTEPh... (flutter/flutter#169498) 2025-05-27 [email protected] Split hint from label and expose it via aria-description or aria-describedby (flutter/flutter#169157) 2025-05-26 [email protected] 🐛 Normalize generated file paths for the l10n generator (flutter/flutter#169467) 2025-05-26 [email protected] Roll Dart SDK from d811152316e4 to 6aeb798bdbe2 (2 revisions) (flutter/flutter#169478) 2025-05-26 [email protected] [Cupertino] Apply RSuperellipse to most Cupertino widgets (flutter/flutter#167784) 2025-05-26 [email protected] Roll `package:dds` to 5.0.2 (flutter/flutter#169471) 2025-05-26 [email protected] Use `.flutter-plugins-dependencies` for crash reporting. (flutter/flutter#169319) 2025-05-26 [email protected] Remove now disabled code that would generate `.flutter-plugins`. (flutter/flutter#169320) 2025-05-26 [email protected] Roll Dart SDK from 7dab9bffe1f7 to d811152316e4 (1 revision) (flutter/flutter#169473) 2025-05-26 [email protected] Precise browser resizing with integration_test and driver (flutter/flutter#160678) 2025-05-26 [email protected] Add `/coverage/` to `.gitignore.tmp` (flutter/flutter#169387) 2025-05-26 [email protected] Make test output with encoded `dart-defines=...` human readable. (flutter/flutter#169353) 2025-05-26 [email protected] Use at most `PROC~/2` tasks to transform assets. (flutter/flutter#169386) 2025-05-26 [email protected] Forward exit code from dart test to flutter test (flutter/flutter#168604) 2025-05-26 [email protected] Fix warning when building for macOS desktop (flutter/flutter#165996) 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 Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 14, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 14, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 15, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 15, 2025
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Aug 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #169160.
Closes #165803.