Skip to content

[flutter_tools] Fix arm64e incorrectly matching arm64 in regex check#184057

Merged
auto-submit[bot] merged 9 commits into
flutter:masterfrom
trizin:fix/arm64e-regex-match
Apr 10, 2026
Merged

[flutter_tools] Fix arm64e incorrectly matching arm64 in regex check#184057
auto-submit[bot] merged 9 commits into
flutter:masterfrom
trizin:fix/arm64e-regex-match

Conversation

@trizin

@trizin trizin commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #184056

The regex EXCLUDED_ARCHS.*arm64 in pluginsSupportArmSimulator() matches
arm64e as a substring, causing Flutter to incorrectly exclude arm64 from
simulator builds when plugins only exclude arm64e.

This adds a word boundary (\barm64\b) so that arm64e is no longer a false
positive match, fixing simulator builds on Apple Silicon Macs.

Also strengthens the existing test assertion to verify arm64 is NOT added
to EXCLUDED_ARCHS when only arm64e is excluded by plugins.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • 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].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@trizin trizin requested a review from a team as a code owner March 24, 2026 10:39
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

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. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@google-cla

google-cla Bot commented Mar 24, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. team-ios Owned by iOS platform team labels Mar 24, 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 fixes a bug where a regular expression was incorrectly matching arm64e when checking for arm64. The change correctly adds a word boundary to the regex to ensure only the arm64 architecture is matched. This prevents arm64 from being incorrectly excluded from simulator builds when only arm64e is specified as excluded.

}

return !buildSettings.contains(RegExp('EXCLUDED_ARCHS.*arm64'));
return !buildSettings.contains(RegExp(r'EXCLUDED_ARCHS.*\barm64\b'));

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.

critical

While this change correctly fixes the regular expression for the project's buildSettings, the same faulty regex appears to be used earlier in the pluginsSupportArmSimulator function when checking podBuildSettings inside a for loop. To completely fix the bug, the regex in the loop should also be updated with a word boundary (\barm64\b) to ensure consistent behavior for both project settings and pod settings.

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.

is this a concern?

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.

Nope, there is no faulty regex in the loop. There is only one instance of the EXCLUDED_ARCHS.*arm64 regex and it's already been fixed

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

@trizin lg but can you address gemini's feedback?

@okorohelijah okorohelijah self-requested a review April 2, 2026 21:09
@trizin

trizin commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

@okorohelijah done!

okorohelijah
okorohelijah previously approved these changes Apr 3, 2026
hellohuanlin
hellohuanlin previously approved these changes Apr 3, 2026
@okorohelijah okorohelijah added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 3, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 3, 2026
@auto-submit

auto-submit Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/184057, Failed to enqueue flutter/flutter/184057 with HTTP 400: GraphQL mutate failed.

@okorohelijah okorohelijah added the CICD Run CI/CD label Apr 3, 2026
@okorohelijah

Copy link
Copy Markdown
Contributor

@trizin Linux Analyze seems to be failing:

Found 1 Dart file which was formatted incorrectly.
To fix, run `dart format packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart` or:

@trizin trizin dismissed stale reviews from hellohuanlin and okorohelijah via 19883d0 April 4, 2026 08:09
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 4, 2026
@trizin trizin requested a review from okorohelijah April 4, 2026 08:11
@reidbaker reidbaker mentioned this pull request Apr 8, 2026
4 tasks
@LongCatIsLooong

Copy link
Copy Markdown
Contributor

/cc @hellohuanlin from ios triage for re-review.

@hellohuanlin hellohuanlin added the CICD Run CI/CD label Apr 9, 2026
@okorohelijah okorohelijah added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 10, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 10, 2026
Merged via the queue into flutter:master with commit bf18e39 Apr 10, 2026
157 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 10, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 10, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 10, 2026
flutter/flutter@81c87ea...bf18e39

2026-04-10 [email protected] [flutter_tools] Fix arm64e incorrectly matching arm64 in regex check (flutter/flutter#184057)
2026-04-10 [email protected] Specify GitHub Repo in GH CLI calls for revert workflow. (flutter/flutter#184878)
2026-04-10 [email protected] Don't use `git add -N` in the sync engine workflow. (flutter/flutter#184882)
2026-04-10 [email protected] Roll Skia from af67d5555e35 to 25b01e5f4ea0 (14 revisions) (flutter/flutter#184865)
2026-04-10 [email protected] [Dot shorthands] Finish examples/api migration (flutter/flutter#183967)
2026-04-10 [email protected] Roll Dart SDK from 98a143f8873e to e715805ddbd3 (1 revision) (flutter/flutter#184864)
2026-04-10 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Disable async mode with LLDB (#184768)" (flutter/flutter#184868)
2026-04-09 [email protected] Skip freeze check in the merge queue (flutter/flutter#184854)
2026-04-09 [email protected] Remove unused variable in `ProcessTextPlugin.java` (flutter/flutter#184161)
2026-04-09 [email protected] Roll Fuchsia Linux SDK from pDXMXRIjEHTw7B0sk... to lZcRfPoCLnDttrf9P... (flutter/flutter#184842)
2026-04-09 [email protected] Roll Dart SDK from bd6280c3e8e9 to 98a143f8873e (5 revisions) (flutter/flutter#184824)
2026-04-09 [email protected] Remove `linux_android_emu_unstable android_engine_vulkan_tests` (flutter/flutter#184787)
2026-04-09 [email protected] Roll Packages from 0e0a032 to 1aa892c (9 revisions) (flutter/flutter#184829)
2026-04-09 [email protected] [record_use] Add experimental flag and test project (flutter/flutter#184719)
2026-04-09 [email protected] Disable async mode with LLDB (flutter/flutter#184768)
2026-04-09 [email protected] Update link for rolling forward to aligned Dart hash (flutter/flutter#184780)
2026-04-09 [email protected] Roll Skia from 4d0f5389e131 to af67d5555e35 (3 revisions) (flutter/flutter#184825)
2026-04-09 [email protected] UberSDFContent refactoring and handle stroke miter limit for stroked rects (flutter/flutter#184603)

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
mbcorona pushed a commit to mbcorona/flutter that referenced this pull request Apr 15, 2026
…lutter#184057)

Fixes flutter#184056

The regex `EXCLUDED_ARCHS.*arm64` in `pluginsSupportArmSimulator()`
matches
`arm64e` as a substring, causing Flutter to incorrectly exclude arm64
from
simulator builds when plugins only exclude arm64e.

This adds a word boundary (\\barm64\\b) so that arm64e is no longer a
false
positive match, fixing simulator builds on Apple Silicon Macs.

Also strengthens the existing test assertion to verify arm64 is NOT
added
to EXCLUDED_ARCHS when only arm64e is excluded by plugins.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flutter_tools] Fix arm64e incorrectly matching arm64 in EXCLUDED_ARCHS regex check

4 participants