Skip to content

Commit bf18e39

Browse files
authored
[flutter_tools] Fix arm64e incorrectly matching arm64 in regex check (#184057)
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 - [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.
1 parent b716540 commit bf18e39

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

packages/flutter_tools/lib/src/xcode_project.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def __lldb_init_module(debugger: lldb.SBDebugger, _):
572572
}
573573
}
574574

575-
return !buildSettings.contains(RegExp('EXCLUDED_ARCHS.*arm64'));
575+
return !buildSettings.contains(RegExp(r'EXCLUDED_ARCHS.*\barm64\b'));
576576
}
577577

578578
/// Returns a list of targets and their associated plugin (if found) that exclude arm64 architecture.

packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,9 +1565,14 @@ Build settings for action build and target good_plugin:
15651565
);
15661566

15671567
final File config = fs.file('path/to/project/ios/Flutter/Generated.xcconfig');
1568+
final String configContents = config.readAsStringSync();
15681569
expect(logger.warningText, isEmpty);
1569-
expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386'));
1570-
expect(config.readAsStringSync(), contains('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7'));
1570+
expect(configContents, contains('EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386'));
1571+
expect(
1572+
configContents,
1573+
isNot(contains('EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64')),
1574+
);
1575+
expect(configContents, contains('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7'));
15711576
expect(fakeProcessManager, hasNoRemainingExpectations);
15721577
},
15731578
overrides: <Type, Generator>{

0 commit comments

Comments
 (0)