[flutter_tools] Pull more arm64 artifacts on Apple Silicon (#110291)

This commit is contained in:
Zachary Anderson
2022-08-29 10:33:24 -07:00
committed by GitHub
parent ee8488e871
commit c6ec84e978
16 changed files with 34 additions and 121 deletions

View File

@@ -219,7 +219,7 @@ void main() {
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.hostPlatform, HostPlatform.darwin_arm);
expect(utils.hostPlatform, HostPlatform.darwin_arm64);
});
testWithoutContext('macOS 11 x86', () async {
@@ -335,7 +335,7 @@ void main() {
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.name, 'product version build darwin-arm');
expect(utils.name, 'product version build darwin-arm64');
});
testWithoutContext('macOS ARM on Rosetta name', () async {
@@ -385,7 +385,7 @@ void main() {
final OperatingSystemUtils utils =
createOSUtils(FakePlatform(operatingSystem: 'macos'));
expect(utils.name, 'product version build darwin-arm (Rosetta)');
expect(utils.name, 'product version build darwin-arm64 (Rosetta)');
});
testWithoutContext('macOS x86 name', () async {

View File

@@ -566,9 +566,9 @@ void main() {
cache.includeAllPlatforms = true;
expect(artifacts.getBinaryDirs(), <List<String>>[
<String>['darwin-x64', 'darwin-x64/font-subset.zip'], // arm64 macOS hosts are not supported now
<String>['darwin-x64', 'darwin-arm64/font-subset.zip'],
<String>['linux-arm64', 'linux-arm64/font-subset.zip'],
<String>['windows-x64', 'windows-x64/font-subset.zip'], // arm64 macOS hosts are not supported now
<String>['windows-x64', 'windows-x64/font-subset.zip'], // arm64 windows hosts are not supported now
]);
});

View File

@@ -48,67 +48,9 @@ void main() {
dartEntrypointArgs: dartEntrypointArgs,
);
testUsingContext('runs in Rosetta on arm64 Mac', () async {
final FakeProcessManager processManager = FakeProcessManager.empty();
final FlutterTesterTestDevice device = TestFlutterTesterDevice(
platform: FakePlatform(operatingSystem: 'macos'),
fileSystem: fileSystem,
processManager: processManager,
enableObservatory: false,
dartEntrypointArgs: const <String>[],
);
processManager.addCommands(<FakeCommand>[
const FakeCommand(
command: <String>[
'which',
'sysctl',
],
),
const FakeCommand(
command: <String>[
'sysctl',
'hw.optional.arm64',
],
stdout: 'hw.optional.arm64: 1',
),
FakeCommand(command: const <String>[
'/usr/bin/arch',
'-x86_64',
'/',
'--disable-observatory',
'--ipv6',
'--enable-checked-mode',
'--verify-entry-points',
'--enable-software-rendering',
'--skia-deterministic-rendering',
'--enable-dart-profiling',
'--non-interactive',
'--use-test-fonts',
'--disable-asset-fonts',
'--packages=.dart_tool/package_config.json',
'example.dill',
], environment: <String, String>{
'FLUTTER_TEST': 'true',
'FONTCONFIG_FILE': device.fontConfigManager.fontConfigFile.path,
'SERVER_PORT': '0',
'APP_NAME': '',
}),
]);
await device.start('example.dill');
expect(processManager, hasNoRemainingExpectations);
});
group('The FLUTTER_TEST environment variable is passed to the test process', () {
setUp(() {
processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'x86_64',
),
]);
processManager = FakeProcessManager.list(<FakeCommand>[]);
device = createDevice();
fileSystem
@@ -175,13 +117,6 @@ void main() {
group('Dart Entrypoint Args', () {
setUp(() {
processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'x86_64',
),
const FakeCommand(
command: <String>[
'/',
@@ -217,13 +152,6 @@ void main() {
group('DDS', () {
setUp(() {
processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand(
command: <String>[
'uname',
'-m',
],
stdout: 'x86_64',
),
const FakeCommand(
command: <String>[
'/',

View File

@@ -197,7 +197,7 @@ void main() {
testWithoutContext('target platform display name on ARM', () async {
final FakeOperatingSystemUtils fakeOperatingSystemUtils =
FakeOperatingSystemUtils();
fakeOperatingSystemUtils.hostPlatform = HostPlatform.darwin_arm;
fakeOperatingSystemUtils.hostPlatform = HostPlatform.darwin_arm64;
final MacOSDevice device = MacOSDevice(
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),

View File

@@ -32,7 +32,7 @@ void main() {
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
fileSystem: MemoryFileSystem.test(),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64),
iosWorkflow: FakeIOSWorkflow(canListDevices: true),
);
@@ -45,7 +45,7 @@ void main() {
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
fileSystem: MemoryFileSystem.test(),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64),
iosWorkflow: FakeIOSWorkflow(canListDevices: true),
);
expect(discoverer.supportsPlatform, isTrue);
@@ -77,7 +77,7 @@ void main() {
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
fileSystem: MemoryFileSystem.test(),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64),
iosWorkflow: FakeIOSWorkflow(canListDevices: false),
);
expect(discoverer.supportsPlatform, isTrue);
@@ -93,7 +93,7 @@ void main() {
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
fileSystem: MemoryFileSystem.test(),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64),
iosWorkflow: FakeIOSWorkflow(canListDevices: true),
);
expect(discoverer.supportsPlatform, isTrue);
@@ -116,7 +116,7 @@ void main() {
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
fileSystem: MemoryFileSystem.test(),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm),
operatingSystemUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64),
);
expect(device.id, 'designed-for-ipad');
expect(await device.isLocalEmulator, isFalse);

View File

@@ -39,7 +39,7 @@ HostPlatform _identifyMacBinaryArch(String path) {
case 'x86_64':
return HostPlatform.darwin_x64;
case 'arm64':
return HostPlatform.darwin_arm;
return HostPlatform.darwin_arm64;
default:
fail('Unexpected architecture ${match.group(1)}');
}

View File

@@ -228,7 +228,7 @@ void main() {
});
testWithoutContext('can launch x86_64 Chrome on ARM macOS', () async {
final OperatingSystemUtils macOSUtils = FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm);
final OperatingSystemUtils macOSUtils = FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64);
final ChromiumLauncher chromiumLauncher = ChromiumLauncher(
fileSystem: fileSystem,
platform: platform,
@@ -267,7 +267,7 @@ void main() {
});
testWithoutContext('can launch ARM Chrome natively on ARM macOS when installed', () async {
final OperatingSystemUtils macOSUtils = FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm);
final OperatingSystemUtils macOSUtils = FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64);
final ChromiumLauncher chromiumLauncher = ChromiumLauncher(
fileSystem: fileSystem,
platform: platform,