Skip to content

Print the Intel Mac deprecation warning on every command - #194071

Merged
auto-submit[bot] merged 5 commits into
flutter:masterfrom
ishaquehassan:fix/193729-intel-mac-warning-every-command
Nov 25, 2026
Merged

auto-submit[bot] merged 5 commits into
flutter:masterfrom
ishaquehassan:fix/193729-intel-mac-warning-every-command

Conversation

@ishaquehassan

Copy link
Copy Markdown
Contributor

The Intel Mac deprecation warning added in #188835 is gated on PersistentToolState.shouldShowIntelMacWarning in FlutterCommand.verifyThenRunCommand, and the first command that prints it sets that flag to false in the tool's persistent state. So each user sees the warning once and then never again, which is easy to miss for a deprecation that is still coming.

This removes the gate, so the warning is printed on every command on an Intel (darwin_x64) host. The message and the host check are unchanged, so Apple Silicon hosts still print nothing.

Printing it every time also means it would trip the fatal-warnings flag on every build, run and test on an Intel host instead of only the first one. runFlutterTest in dev/bots/utils.dart passes that flag by default and the Mac_x64 builders still run on beta and stable, so the warning is now printed with fatal: false, same as the FLUTTER_STORAGE_BASE_URL warning in cache.dart. It's about the host machine rather than the project, so it shouldn't fail a command by itself.

With the gate gone, shouldShowIntelMacWarning and its displayed-intel-warning-message key in PersistentToolState have no readers or writers left, and neither do the private _persistentToolState getter and the persistent_tool_state.dart import in flutter_command.dart, so they're removed instead of being kept around as dead state. _DefaultPersistentToolState is the only implementation of the interface. A displayed-intel-warning-message entry that is already in someone's tool state file is simply never read again.

The existing prints Intel Mac warning on macOS X64 once test already ran the command twice and checked that the second run stayed quiet. It's now prints Intel Mac warning on macOS X64 on every command and checks that the warning shows up twice. The new Intel Mac warning on macOS X64 is not fatal test checks that the warning doesn't set hadWarningOutput, which is what checkForFatalLogs reads. does not print Intel Mac warning on macOS ARM64 is unchanged. Locally flutter_command_test.dart (92/92) and persistent_tool_state_test.dart (2/2) pass, and both Intel tests fail with the two lib/ files reverted.

Fixes #193729

Pre-launch Checklist

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 9, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request removes the persistent state tracking for the Intel Mac deprecation warning, making the warning display on every command execution on Intel-based Macs and ensuring it is non-fatal. The tests are updated to reflect these changes. A review comment points out a syntax error in the test file where the HostPlatform prefix is missing.

overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: .darwin_x64),

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.

high

There is a typo here: .darwin_x64 is missing the HostPlatform prefix. This will cause a compilation error in Dart since Dart does not support leading dot shorthand for enum values.

Suggested change
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: .darwin_x64),
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_x64),

@jmagman jmagman added the CICD Run CI/CD label Oct 15, 2026
@bkonyi
bkonyi requested review from a team October 15, 2026 20:58

@bkonyi bkonyi 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.

Thanks for the contribution! Overall this looks good, just a couple of small comments around migrating the tests to testWithoutContext and using a dot shorthand. Also, you can ignore the gemini-code-assist comment on .darwin_x64 as dot shorthands are valid in Dart 3.10+.

It also looks like there's some merge conflicts that need to be fixed before this lands.

(Review assisted by an AI coding agent)

final PersistentToolState? persistentToolState = _persistentToolState;
if (_os.hostPlatform == HostPlatform.darwin_x64 &&
(persistentToolState?.shouldShowIntelMacWarning ?? true)) {
if (_os.hostPlatform == HostPlatform.darwin_x64) {

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.

Nit: can use dot shorthand here (_os.hostPlatform == .darwin_x64).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, switched it to .darwin_x64 👍


testUsingContext(
'prints Intel Mac warning on macOS X64 once',
'prints Intel Mac warning on macOS X64 on every command',

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.

Do we need testUsingContext here and for the other Intel Mac warning tests? We can pass FakeToolContext to DummyFlutterCommand and use testWithoutContext instead:

    testWithoutContext('prints Intel Mac warning on macOS X64 on every command', () async {
      final flutterCommand = DummyFlutterCommand(
        noUsagePath: true,
        toolContext: FakeToolContext(
          fs: fileSystem,
          logger: logger,
          os: FakeOperatingSystemUtils(hostPlatform: .darwin_x64),
          processManager: processManager,
        ),
      );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good call, moved all three Intel Mac tests (the arm64 one too) to testWithoutContext with FakeToolContext like you suggested. also rebased on master so the conflicts are gone

The warning in FlutterCommand.verifyThenRunCommand was gated on
PersistentToolState.shouldShowIntelMacWarning, so it only printed once
per user. Drop the gate along with the persistent state that only
existed to back it, and update the existing test to expect the warning
on every run.

Since the warning now shows up on every command, print it with
fatal: false so an Intel host alone does not fail commands that treat
warnings as fatal.

Fixes flutter#193729
Pass a FakeToolContext to DummyFlutterCommand instead of overriding
globals through testUsingContext, and use a dot shorthand for the
darwin_x64 check.
@ishaquehassan
ishaquehassan force-pushed the fix/193729-intel-mac-warning-every-command branch from 0330f9f to 01c3e21 Compare November 9, 2026 21:42
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 9, 2026
@cbracken cbracken added the CICD Run CI/CD label Nov 24, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 24, 2026
@cbracken cbracken added the CICD Run CI/CD label Nov 24, 2026
VerboseLogger ignored the fatal argument, so in verbose mode a non-fatal
warning still set hadWarningOutput and failed --fatal-warnings runs. It
also forwarded every warning to its parent logger with the default
fatal: true, which set the shared flag again.

Use hadWarningOutput || fatal like StdoutLogger and BufferLogger, and
pass fatal through _emit to the parent logger.
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Nov 24, 2026

@bkonyi bkonyi 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!

@cbracken cbracken added the CICD Run CI/CD label Nov 24, 2026
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 24, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Nov 25, 2026
Merged via the queue into flutter:master with commit cda12e6 Nov 25, 2026
24 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 25, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Nov 25, 2026
Roll Flutter from b75c5b30406a to 06f1c24345a2 (37 revisions)

flutter/flutter@b75c5b3...06f1c24

2026-11-25 [email protected] Roll Skia from a60d883b3fe3 to e84ecd98d9f2 (2 revisions) (flutter/flutter#197375)
2026-11-25 [email protected] Roll Skia from ca229e319550 to a60d883b3fe3 (4 revisions) (flutter/flutter#197371)
2026-11-25 [email protected] Roll Skia from 6f75212e5a23 to ca229e319550 (2 revisions) (flutter/flutter#197369)
2026-11-25 [email protected] Roll Skia from 75d95595f14e to 6f75212e5a23 (1 revision) (flutter/flutter#197364)
2026-11-25 [email protected] [Windows] Fix Korean 3-beolsik IME dropping space, digits and punctuation (flutter/flutter#194270)
2026-11-25 [email protected] [flutter_tools] Strip embedded credentials from repository URLs (flutter/flutter#197219)
2026-11-25 [email protected] [flutter_tools] Add structured extension.log notifications for tool extensions (flutter/flutter#196714)
2026-11-25 [email protected] [flutter_tools] Share Depfile in flutter_tools_core and make BuildTarget.targetPlatform optional (flutter/flutter#194965)
2026-11-25 [email protected] Reply null asynchronously to ignored web platform messages and unskip missing-asset tests (flutter/flutter#197267)
2026-11-25 [email protected] Roll Dart SDK from 87f515c52de9 to 5202130a51b8 (1 revision) (flutter/flutter#197363)
2026-11-25 [email protected] [web] Retain queued scene pictures via ContainerLayer render pinning (flutter/flutter#196748)
2026-11-25 [email protected] [flutter_tools] Include dependency manifests in copyAssets depfile (flutter/flutter#196596)
2026-11-25 [email protected] Print the Intel Mac deprecation warning on every command (flutter/flutter#194071)
2026-11-25 [email protected] Roll Skia from 243c0dc9f662 to 75d95595f14e (2 revisions) (flutter/flutter#197351)
2026-11-25 [email protected] iOS: Ignore platform messages after the engine is destroyed (flutter/flutter#197310)
2026-11-24 [email protected] Bump customer tests to pick up material_ui cache extent test updates (flutter/flutter#197266)
2026-11-24 [email protected] [flutter_tools] Use refreshed FlutterVersion for flutter doctor feature flags (flutter/flutter#196944)
2026-11-24 [email protected] [flutter_tools] Do not crash if buildXcodeProject temporary directory is deleted before cleanup (flutter/flutter#195918)
2026-11-24 [email protected] Fix some `parameter_assignments` warnings (flutter/flutter#196815)
2026-11-24 [email protected] [flutter_tools] Extract PlatformDebuggingOptions and move WebDebugConfig (flutter/flutter#197229)
2026-11-24 [email protected] Fix desktop apps installing to the system prefix after a failed build (flutter/flutter#196482)
2026-11-24 [email protected] [flutter_tools] Write flutter test native_assets.json outside targetDir (flutter/flutter#196300)
2026-11-24 [email protected] iOS: Check the presented composition order in platform view tests (flutter/flutter#197302)
2026-11-24 [email protected] Run the shared Vulkan embedder tests under Impeller as well as Skia (flutter/flutter#193004)
2026-11-24 [email protected] Roll Fuchsia Linux SDK from BOgXtIYxLYcCkRou2... to HtAKfFLbfAQ6g96RY... (flutter/flutter#197334)
2026-11-24 [email protected] Roll Skia from b3dec9325fe1 to 243c0dc9f662 (6 revisions) (flutter/flutter#197333)
2026-11-24 [email protected] [flutter_tools] Delete globals.dart and context_runner.dart (flutter/flutter#196095)
2026-11-24 [email protected] Update viewInsets docs for translucent and rounded system UI (flutter/flutter#196355)
2026-11-24 [email protected] [flutter_tools] Check that dartaotruntime can run before starting the frontend server (flutter/flutter#194206)
2026-11-24 [email protected] [framework] Fix DraggableScrollableSheet '_hold == null' assertion when touch lifts during snap (flutter/flutter#195771)
2026-11-24 [email protected] [web] Release ImageSource on GC and fix Picture finalizer cycles (flutter/flutter#197245)
2026-11-24 [email protected] [flutter_tools] Fix web compiler output tracking in web builds (flutter/flutter#196563)
2026-11-24 [email protected] Upgrade CI to Xcode 27.2 (flutter/flutter#196807)
2026-11-24 [email protected] Roll Packages from 5b93485 to f455dfa (6 revisions) (flutter/flutter#197316)
2026-11-24 [email protected] [Linux] Fix deadlock presenting to a Wayland subsurface (flutter/flutter#196945)
2026-11-24 [email protected] Roll Skia from 2140958ee284 to b3dec9325fe1 (1 revision) (flutter/flutter#197309)
2026-11-24 [email protected] Roll Fuchsia Test Scripts from oEU515sDqSTvD8Spx... to GPtykFNizlaauBqzs... (flutter/flutter#197313)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode 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

...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print a warning when using an Intel Mac on each command

4 participants