Unverified Commit 7424db44 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Exclude arm64 from iOS app archs if unsupported by plugins on x64 Macs (#87362)

parent 9072bac5
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
import '../artifacts.dart'; import '../artifacts.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/os.dart';
import '../build_info.dart'; import '../build_info.dart';
import '../cache.dart'; import '../cache.dart';
import '../flutter_manifest.dart'; import '../flutter_manifest.dart';
...@@ -210,7 +209,7 @@ Future<List<String>> _xcodeBuildSettingsLines({ ...@@ -210,7 +209,7 @@ Future<List<String>> _xcodeBuildSettingsLines({
// If any plugins or their dependencies do not support arm64 simulators // If any plugins or their dependencies do not support arm64 simulators
// (to run natively without Rosetta translation on an ARM Mac), // (to run natively without Rosetta translation on an ARM Mac),
// the app will fail to build unless it also excludes arm64 simulators. // the app will fail to build unless it also excludes arm64 simulators.
if (globals.os.hostPlatform == HostPlatform.darwin_arm && !(await project.ios.pluginsSupportArmSimulator())) { if (!(await project.ios.pluginsSupportArmSimulator())) {
excludedSimulatorArchs += ' arm64'; excludedSimulatorArchs += ' arm64';
} }
xcodeBuildSettings.add('EXCLUDED_ARCHS[sdk=iphonesimulator*]=$excludedSimulatorArchs'); xcodeBuildSettings.add('EXCLUDED_ARCHS[sdk=iphonesimulator*]=$excludedSimulatorArchs');
......
...@@ -9,7 +9,6 @@ import 'package:flutter_tools/src/artifacts.dart'; ...@@ -9,7 +9,6 @@ import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/os.dart';
import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/version.dart'; import 'package:flutter_tools/src/base/version.dart';
import 'package:flutter_tools/src/build_info.dart'; import 'package:flutter_tools/src/build_info.dart';
...@@ -21,7 +20,6 @@ import 'package:flutter_tools/src/reporting/reporting.dart'; ...@@ -21,7 +20,6 @@ import 'package:flutter_tools/src/reporting/reporting.dart';
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
import '../../src/fake_process_manager.dart'; import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart';
const String xcodebuild = '/usr/bin/xcodebuild'; const String xcodebuild = '/usr/bin/xcodebuild';
...@@ -739,7 +737,6 @@ Build settings for action build and target plugin2: ...@@ -739,7 +737,6 @@ Build settings for action build and target plugin2:
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => localArtifacts, Artifacts: () => localArtifacts,
Platform: () => macOS, Platform: () => macOS,
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm),
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
XcodeProjectInterpreter: () => xcodeProjectInterpreter, XcodeProjectInterpreter: () => xcodeProjectInterpreter,
...@@ -781,7 +778,6 @@ Build settings for action build and target plugin2: ...@@ -781,7 +778,6 @@ Build settings for action build and target plugin2:
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => localArtifacts, Artifacts: () => localArtifacts,
Platform: () => macOS, Platform: () => macOS,
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm),
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
XcodeProjectInterpreter: () => xcodeProjectInterpreter, XcodeProjectInterpreter: () => xcodeProjectInterpreter,
...@@ -835,7 +831,6 @@ Build settings for action build and target plugin2: ...@@ -835,7 +831,6 @@ Build settings for action build and target plugin2:
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Artifacts: () => localArtifacts, Artifacts: () => localArtifacts,
Platform: () => macOS, Platform: () => macOS,
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm),
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
XcodeProjectInterpreter: () => xcodeProjectInterpreter, XcodeProjectInterpreter: () => xcodeProjectInterpreter,
...@@ -846,7 +841,6 @@ Build settings for action build and target plugin2: ...@@ -846,7 +841,6 @@ Build settings for action build and target plugin2:
testUsingContext(description, testMethod, overrides: <Type, Generator>{ testUsingContext(description, testMethod, overrides: <Type, Generator>{
Artifacts: () => localArtifacts, Artifacts: () => localArtifacts,
Platform: () => macOS, Platform: () => macOS,
OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_x64),
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
}); });
...@@ -875,7 +869,7 @@ Build settings for action build and target plugin2: ...@@ -875,7 +869,7 @@ Build settings for action build and target plugin2:
expect(buildPhaseScriptContents.contains('EXCLUDED_ARCHS'), isFalse); expect(buildPhaseScriptContents.contains('EXCLUDED_ARCHS'), isFalse);
}); });
testUsingOsxContext('excludes i386 simulator', () async { testUsingOsxContext('does not exclude arm64 simulator when there are no plugins', () async {
const BuildInfo buildInfo = BuildInfo.debug; const BuildInfo buildInfo = BuildInfo.debug;
final FlutterProject project = FlutterProject.fromDirectoryTest(fs.directory('path/to/project')); final FlutterProject project = FlutterProject.fromDirectoryTest(fs.directory('path/to/project'));
await updateGeneratedXcodeProperties( await updateGeneratedXcodeProperties(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment