Unverified Commit 53410c4b authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Compile snapshot_assembly with sdk root set in Xcode (#69731)

parent 9b564e9a
...@@ -185,6 +185,7 @@ is set to release or run \"flutter build ios --release\", then re-run Archive fr ...@@ -185,6 +185,7 @@ is set to release or run \"flutter build ios --release\", then re-run Archive fr
-dTargetFile="${target_path}" \ -dTargetFile="${target_path}" \
-dBuildMode=${build_mode} \ -dBuildMode=${build_mode} \
-dIosArchs="${ARCHS}" \ -dIosArchs="${ARCHS}" \
-dSdkRoot="${SDKROOT}" \
-dSplitDebugInfo="${SPLIT_DEBUG_INFO}" \ -dSplitDebugInfo="${SPLIT_DEBUG_INFO}" \
-dTreeShakeIcons="${TREE_SHAKE_ICONS}" \ -dTreeShakeIcons="${TREE_SHAKE_ICONS}" \
-dTrackWidgetCreation="${TRACK_WIDGET_CREATION}" \ -dTrackWidgetCreation="${TRACK_WIDGET_CREATION}" \
......
...@@ -14,6 +14,7 @@ import 'build_system/targets/ios.dart'; ...@@ -14,6 +14,7 @@ import 'build_system/targets/ios.dart';
import 'cache.dart'; import 'cache.dart';
import 'globals.dart' as globals; import 'globals.dart' as globals;
import 'ios/bitcode.dart'; import 'ios/bitcode.dart';
import 'macos/xcode.dart';
import 'project.dart'; import 'project.dart';
/// Builds AOT snapshots given a platform, build mode and a path to a Dart /// Builds AOT snapshots given a platform, build mode and a path to a Dart
...@@ -26,12 +27,13 @@ class AotBuilder { ...@@ -26,12 +27,13 @@ class AotBuilder {
@required String mainDartFile, @required String mainDartFile,
bool bitcode = kBitcodeEnabledDefault, bool bitcode = kBitcodeEnabledDefault,
bool quiet = true, bool quiet = true,
Iterable<DarwinArch> iosBuildArchs = defaultIOSArchs, Iterable<DarwinArch> iosBuildArchs,
bool reportTimings = false, bool reportTimings = false,
}) async { }) async {
if (platform == null) { if (platform == null) {
throwToolExit('No AOT build platform specified'); throwToolExit('No AOT build platform specified');
} }
iosBuildArchs ??= defaultIOSArchsForSdk(SdkType.iPhone);
Target target; Target target;
bool expectSo = false; bool expectSo = false;
switch (platform) { switch (platform) {
......
...@@ -111,13 +111,13 @@ class AOTSnapshotter { ...@@ -111,13 +111,13 @@ class AOTSnapshotter {
@required String mainPath, @required String mainPath,
@required String outputPath, @required String outputPath,
DarwinArch darwinArch, DarwinArch darwinArch,
String sdkRoot,
List<String> extraGenSnapshotOptions = const <String>[], List<String> extraGenSnapshotOptions = const <String>[],
@required bool bitcode, @required bool bitcode,
@required String splitDebugInfo, @required String splitDebugInfo,
@required bool dartObfuscation, @required bool dartObfuscation,
bool quiet = false, bool quiet = false,
}) async { }) async {
// TODO(cbracken): replace IOSArch with TargetPlatform.ios_{armv7,arm64}.
assert(platform != TargetPlatform.ios || darwinArch != null); assert(platform != TargetPlatform.ios || darwinArch != null);
if (bitcode && platform != TargetPlatform.ios) { if (bitcode && platform != TargetPlatform.ios) {
_logger.printError('Bitcode is only supported for iOS.'); _logger.printError('Bitcode is only supported for iOS.');
...@@ -209,6 +209,7 @@ class AOTSnapshotter { ...@@ -209,6 +209,7 @@ class AOTSnapshotter {
final RunResult result = await _buildFramework( final RunResult result = await _buildFramework(
appleArch: darwinArch, appleArch: darwinArch,
isIOS: platform == TargetPlatform.ios, isIOS: platform == TargetPlatform.ios,
sdkRoot: sdkRoot,
assemblyPath: assembly, assemblyPath: assembly,
outputPath: outputDir.path, outputPath: outputDir.path,
bitcode: bitcode, bitcode: bitcode,
...@@ -226,6 +227,7 @@ class AOTSnapshotter { ...@@ -226,6 +227,7 @@ class AOTSnapshotter {
Future<RunResult> _buildFramework({ Future<RunResult> _buildFramework({
@required DarwinArch appleArch, @required DarwinArch appleArch,
@required bool isIOS, @required bool isIOS,
@required String sdkRoot,
@required String assemblyPath, @required String assemblyPath,
@required String outputPath, @required String outputPath,
@required bool bitcode, @required bool bitcode,
...@@ -248,12 +250,10 @@ class AOTSnapshotter { ...@@ -248,12 +250,10 @@ class AOTSnapshotter {
const String embedBitcodeArg = '-fembed-bitcode'; const String embedBitcodeArg = '-fembed-bitcode';
final String assemblyO = _fileSystem.path.join(outputPath, 'snapshot_assembly.o'); final String assemblyO = _fileSystem.path.join(outputPath, 'snapshot_assembly.o');
List<String> isysrootArgs; List<String> isysrootArgs;
if (isIOS) { if (sdkRoot != null) {
final String iPhoneSDKLocation = await _xcode.sdkLocation(SdkType.iPhone); isysrootArgs = <String>['-isysroot', sdkRoot];
if (iPhoneSDKLocation != null) {
isysrootArgs = <String>['-isysroot', iPhoneSDKLocation];
}
} }
final RunResult compileResult = await _xcode.cc(<String>[ final RunResult compileResult = await _xcode.cc(<String>[
'-arch', targetArch, '-arch', targetArch,
if (isysrootArgs != null) ...isysrootArgs, if (isysrootArgs != null) ...isysrootArgs,
......
...@@ -11,6 +11,7 @@ import 'base/logger.dart'; ...@@ -11,6 +11,7 @@ import 'base/logger.dart';
import 'base/utils.dart'; import 'base/utils.dart';
import 'build_system/targets/icon_tree_shaker.dart'; import 'build_system/targets/icon_tree_shaker.dart';
import 'globals.dart' as globals; import 'globals.dart' as globals;
import 'macos/xcode.dart';
/// Information about a build to be performed or used. /// Information about a build to be performed or used.
class BuildInfo { class BuildInfo {
...@@ -472,9 +473,23 @@ enum AndroidArch { ...@@ -472,9 +473,23 @@ enum AndroidArch {
} }
/// The default set of iOS device architectures to build for. /// The default set of iOS device architectures to build for.
const List<DarwinArch> defaultIOSArchs = <DarwinArch>[ List<DarwinArch> defaultIOSArchsForSdk(SdkType sdkType) {
DarwinArch.arm64, switch (sdkType) {
]; case SdkType.iPhone:
return <DarwinArch>[
DarwinArch.armv7,
DarwinArch.arm64,
];
case SdkType.iPhoneSimulator:
return <DarwinArch>[
// Apple Silicon ARM simulators not yet supported.
DarwinArch.x86_64,
];
default:
assert(false, 'Unknown SDK type $sdkType');
return null;
}
}
String getNameForDarwinArch(DarwinArch arch) { String getNameForDarwinArch(DarwinArch arch) {
switch (arch) { switch (arch) {
......
...@@ -65,6 +65,9 @@ const String kFileSystemRoots = 'FileSystemRoots'; ...@@ -65,6 +65,9 @@ const String kFileSystemRoots = 'FileSystemRoots';
/// The other supported value is armv7, the 32-bit iOS architecture. /// The other supported value is armv7, the 32-bit iOS architecture.
const String kIosArchs = 'IosArchs'; const String kIosArchs = 'IosArchs';
/// Path to the SDK root to be used as the isysroot.
const String kSdkRoot = 'SdkRoot';
/// Whether to enable Dart obfuscation and where to save the symbol map. /// Whether to enable Dart obfuscation and where to save the symbol map.
const String kDartObfuscation = 'DartObfuscation'; const String kDartObfuscation = 'DartObfuscation';
......
...@@ -89,6 +89,7 @@ abstract class AotAssemblyBase extends Target { ...@@ -89,6 +89,7 @@ abstract class AotAssemblyBase extends Target {
mainPath: environment.buildDir.childFile('app.dill').path, mainPath: environment.buildDir.childFile('app.dill').path,
outputPath: environment.fileSystem.path.join(buildOutputPath, getNameForDarwinArch(darwinArch)), outputPath: environment.fileSystem.path.join(buildOutputPath, getNameForDarwinArch(darwinArch)),
darwinArch: darwinArch, darwinArch: darwinArch,
sdkRoot: environment.defines[kSdkRoot],
bitcode: bitcode, bitcode: bitcode,
quiet: true, quiet: true,
splitDebugInfo: splitDebugInfo, splitDebugInfo: splitDebugInfo,
......
...@@ -28,7 +28,7 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen ...@@ -28,7 +28,7 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
..addFlag('quiet', defaultsTo: false) ..addFlag('quiet', defaultsTo: false)
..addMultiOption('ios-arch', ..addMultiOption('ios-arch',
splitCommas: true, splitCommas: true,
defaultsTo: defaultIOSArchs.map<String>(getNameForDarwinArch), defaultsTo: <String>[getNameForDarwinArch(DarwinArch.arm64)],
allowed: DarwinArch.values.map<String>(getNameForDarwinArch), allowed: DarwinArch.values.map<String>(getNameForDarwinArch),
help: 'iOS architectures to build.', help: 'iOS architectures to build.',
) )
......
...@@ -21,6 +21,7 @@ import '../cache.dart'; ...@@ -21,6 +21,7 @@ import '../cache.dart';
import '../convert.dart'; import '../convert.dart';
import '../globals.dart' as globals; import '../globals.dart' as globals;
import '../macos/cocoapod_utils.dart'; import '../macos/cocoapod_utils.dart';
import '../macos/xcode.dart';
import '../plugins.dart'; import '../plugins.dart';
import '../project.dart'; import '../project.dart';
import '../runner/flutter_command.dart' show DevelopmentArtifact, FlutterCommandResult; import '../runner/flutter_command.dart' show DevelopmentArtifact, FlutterCommandResult;
...@@ -376,6 +377,7 @@ end ...@@ -376,6 +377,7 @@ end
kExtraFrontEndOptions: buildInfo.extraFrontEndOptions.join(','), kExtraFrontEndOptions: buildInfo.extraFrontEndOptions.join(','),
kIosArchs: <DarwinArch>[DarwinArch.armv7, DarwinArch.arm64] kIosArchs: <DarwinArch>[DarwinArch.armv7, DarwinArch.arm64]
.map(getNameForDarwinArch).join(' '), .map(getNameForDarwinArch).join(' '),
kSdkRoot: await globals.xcode.sdkLocation(SdkType.iPhone),
}, },
artifacts: globals.artifacts, artifacts: globals.artifacts,
fileSystem: globals.fs, fileSystem: globals.fs,
......
...@@ -586,7 +586,7 @@ class XCDevice { ...@@ -586,7 +586,7 @@ class XCDevice {
if (architecture.startsWith('armv7')) { if (architecture.startsWith('armv7')) {
cpuArchitecture = DarwinArch.armv7; cpuArchitecture = DarwinArch.armv7;
} else { } else {
cpuArchitecture = defaultIOSArchs.first; cpuArchitecture = DarwinArch.arm64;
} }
_logger.printError( _logger.printError(
'Unknown architecture $architecture, defaulting to ' 'Unknown architecture $architecture, defaulting to '
......
...@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/build_info.dart'; ...@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart'; import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build_ios_framework.dart'; import 'package:flutter_tools/src/commands/build_ios_framework.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/version.dart'; import 'package:flutter_tools/src/version.dart';
import 'package:mockito/mockito.dart'; import 'package:mockito/mockito.dart';
...@@ -43,7 +42,7 @@ void main() { ...@@ -43,7 +42,7 @@ void main() {
); );
when(mockFlutterVersion.gitTagVersion).thenReturn(mockGitTagVersion); when(mockFlutterVersion.gitTagVersion).thenReturn(mockGitTagVersion);
outputDirectory = globals.fs.systemTempDirectory outputDirectory = memoryFileSystem.systemTempDirectory
.createTempSync('flutter_build_ios_framework_test_output.') .createTempSync('flutter_build_ios_framework_test_output.')
.childDirectory('Debug') .childDirectory('Debug')
..createSync(); ..createSync();
......
...@@ -24,15 +24,6 @@ const FakeCommand kARMCheckCommand = FakeCommand( ...@@ -24,15 +24,6 @@ const FakeCommand kARMCheckCommand = FakeCommand(
exitCode: 1, exitCode: 1,
); );
const FakeCommand kSdkPathCommand = FakeCommand(
command: <String>[
'xcrun',
'--sdk',
'iphoneos',
'--show-sdk-path'
]
);
const List<String> kDefaultClang = <String>[ const List<String> kDefaultClang = <String>[
'-miphoneos-version-min=8.0', '-miphoneos-version-min=8.0',
'-dynamiclib', '-dynamiclib',
...@@ -47,7 +38,7 @@ const List<String> kDefaultClang = <String>[ ...@@ -47,7 +38,7 @@ const List<String> kDefaultClang = <String>[
'-install_name', '-install_name',
'@rpath/App.framework/App', '@rpath/App.framework/App',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-o', '-o',
'build/foo/App.framework/App', 'build/foo/App.framework/App',
'build/foo/snapshot_assembly.o', 'build/foo/snapshot_assembly.o',
...@@ -68,7 +59,7 @@ const List<String> kBitcodeClang = <String>[ ...@@ -68,7 +59,7 @@ const List<String> kBitcodeClang = <String>[
'@rpath/App.framework/App', '@rpath/App.framework/App',
'-fembed-bitcode', '-fembed-bitcode',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-o', '-o',
'build/foo/App.framework/App', 'build/foo/App.framework/App',
'build/foo/snapshot_assembly.o', 'build/foo/snapshot_assembly.o',
...@@ -223,6 +214,7 @@ void main() { ...@@ -223,6 +214,7 @@ void main() {
expect(await snapshotter.build( expect(await snapshotter.build(
platform: TargetPlatform.ios, platform: TargetPlatform.ios,
darwinArch: DarwinArch.arm64, darwinArch: DarwinArch.arm64,
sdkRoot: 'path/to/sdk',
buildMode: BuildMode.debug, buildMode: BuildMode.debug,
mainPath: 'main.dill', mainPath: 'main.dill',
outputPath: outputPath, outputPath: outputPath,
...@@ -278,7 +270,6 @@ void main() { ...@@ -278,7 +270,6 @@ void main() {
] ]
)); ));
processManager.addCommand(kARMCheckCommand); processManager.addCommand(kARMCheckCommand);
processManager.addCommand(kSdkPathCommand);
processManager.addCommand(const FakeCommand( processManager.addCommand(const FakeCommand(
command: <String>[ command: <String>[
'xcrun', 'xcrun',
...@@ -286,7 +277,7 @@ void main() { ...@@ -286,7 +277,7 @@ void main() {
'-arch', '-arch',
'armv7', 'armv7',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-fembed-bitcode', '-fembed-bitcode',
'-c', '-c',
'build/foo/snapshot_assembly.S', 'build/foo/snapshot_assembly.S',
...@@ -310,6 +301,7 @@ void main() { ...@@ -310,6 +301,7 @@ void main() {
mainPath: 'main.dill', mainPath: 'main.dill',
outputPath: outputPath, outputPath: outputPath,
darwinArch: DarwinArch.armv7, darwinArch: DarwinArch.armv7,
sdkRoot: 'path/to/sdk',
bitcode: true, bitcode: true,
splitDebugInfo: null, splitDebugInfo: null,
dartObfuscation: false, dartObfuscation: false,
...@@ -340,7 +332,6 @@ void main() { ...@@ -340,7 +332,6 @@ void main() {
] ]
)); ));
processManager.addCommand(kARMCheckCommand); processManager.addCommand(kARMCheckCommand);
processManager.addCommand(kSdkPathCommand);
processManager.addCommand(const FakeCommand( processManager.addCommand(const FakeCommand(
command: <String>[ command: <String>[
'xcrun', 'xcrun',
...@@ -348,7 +339,7 @@ void main() { ...@@ -348,7 +339,7 @@ void main() {
'-arch', '-arch',
'armv7', 'armv7',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-c', '-c',
'build/foo/snapshot_assembly.S', 'build/foo/snapshot_assembly.S',
'-o', '-o',
...@@ -371,6 +362,7 @@ void main() { ...@@ -371,6 +362,7 @@ void main() {
mainPath: 'main.dill', mainPath: 'main.dill',
outputPath: outputPath, outputPath: outputPath,
darwinArch: DarwinArch.armv7, darwinArch: DarwinArch.armv7,
sdkRoot: 'path/to/sdk',
bitcode: false, bitcode: false,
splitDebugInfo: 'foo', splitDebugInfo: 'foo',
dartObfuscation: false, dartObfuscation: false,
...@@ -399,7 +391,6 @@ void main() { ...@@ -399,7 +391,6 @@ void main() {
] ]
)); ));
processManager.addCommand(kARMCheckCommand); processManager.addCommand(kARMCheckCommand);
processManager.addCommand(kSdkPathCommand);
processManager.addCommand(const FakeCommand( processManager.addCommand(const FakeCommand(
command: <String>[ command: <String>[
'xcrun', 'xcrun',
...@@ -407,7 +398,7 @@ void main() { ...@@ -407,7 +398,7 @@ void main() {
'-arch', '-arch',
'armv7', 'armv7',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-c', '-c',
'build/foo/snapshot_assembly.S', 'build/foo/snapshot_assembly.S',
'-o', '-o',
...@@ -430,6 +421,7 @@ void main() { ...@@ -430,6 +421,7 @@ void main() {
mainPath: 'main.dill', mainPath: 'main.dill',
outputPath: outputPath, outputPath: outputPath,
darwinArch: DarwinArch.armv7, darwinArch: DarwinArch.armv7,
sdkRoot: 'path/to/sdk',
bitcode: false, bitcode: false,
splitDebugInfo: null, splitDebugInfo: null,
dartObfuscation: true, dartObfuscation: true,
...@@ -457,7 +449,6 @@ void main() { ...@@ -457,7 +449,6 @@ void main() {
] ]
)); ));
processManager.addCommand(kARMCheckCommand); processManager.addCommand(kARMCheckCommand);
processManager.addCommand(kSdkPathCommand);
processManager.addCommand(const FakeCommand( processManager.addCommand(const FakeCommand(
command: <String>[ command: <String>[
'xcrun', 'xcrun',
...@@ -465,7 +456,7 @@ void main() { ...@@ -465,7 +456,7 @@ void main() {
'-arch', '-arch',
'armv7', 'armv7',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-c', '-c',
'build/foo/snapshot_assembly.S', 'build/foo/snapshot_assembly.S',
'-o', '-o',
...@@ -488,6 +479,7 @@ void main() { ...@@ -488,6 +479,7 @@ void main() {
mainPath: 'main.dill', mainPath: 'main.dill',
outputPath: outputPath, outputPath: outputPath,
darwinArch: DarwinArch.armv7, darwinArch: DarwinArch.armv7,
sdkRoot: 'path/to/sdk',
bitcode: false, bitcode: false,
splitDebugInfo: null, splitDebugInfo: null,
dartObfuscation: false, dartObfuscation: false,
...@@ -512,7 +504,6 @@ void main() { ...@@ -512,7 +504,6 @@ void main() {
] ]
)); ));
processManager.addCommand(kARMCheckCommand); processManager.addCommand(kARMCheckCommand);
processManager.addCommand(kSdkPathCommand);
processManager.addCommand(const FakeCommand( processManager.addCommand(const FakeCommand(
command: <String>[ command: <String>[
'xcrun', 'xcrun',
...@@ -520,7 +511,7 @@ void main() { ...@@ -520,7 +511,7 @@ void main() {
'-arch', '-arch',
'arm64', 'arm64',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-c', '-c',
'build/foo/snapshot_assembly.S', 'build/foo/snapshot_assembly.S',
'-o', '-o',
...@@ -543,6 +534,7 @@ void main() { ...@@ -543,6 +534,7 @@ void main() {
mainPath: 'main.dill', mainPath: 'main.dill',
outputPath: outputPath, outputPath: outputPath,
darwinArch: DarwinArch.arm64, darwinArch: DarwinArch.arm64,
sdkRoot: 'path/to/sdk',
bitcode: false, bitcode: false,
splitDebugInfo: null, splitDebugInfo: null,
dartObfuscation: false, dartObfuscation: false,
......
...@@ -485,25 +485,13 @@ void main() { ...@@ -485,25 +485,13 @@ void main() {
], ],
exitCode: 1, exitCode: 1,
), ),
const FakeCommand(command: <String>[
'xcrun',
'--sdk',
'iphoneos',
'--show-sdk-path',
]),
const FakeCommand(command: <String>[
'xcrun',
'--sdk',
'iphoneos',
'--show-sdk-path',
]),
FakeCommand(command: <String>[ FakeCommand(command: <String>[
'xcrun', 'xcrun',
'cc', 'cc',
'-arch', '-arch',
'armv7', 'armv7',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-c', '-c',
'$build/armv7/snapshot_assembly.S', '$build/armv7/snapshot_assembly.S',
'-o', '-o',
...@@ -515,7 +503,7 @@ void main() { ...@@ -515,7 +503,7 @@ void main() {
'-arch', '-arch',
'arm64', 'arm64',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-c', '-c',
'$build/arm64/snapshot_assembly.S', '$build/arm64/snapshot_assembly.S',
'-o', '-o',
...@@ -539,7 +527,7 @@ void main() { ...@@ -539,7 +527,7 @@ void main() {
'-install_name', '-install_name',
'@rpath/App.framework/App', '@rpath/App.framework/App',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-o', '-o',
'$build/armv7/App.framework/App', '$build/armv7/App.framework/App',
'$build/armv7/snapshot_assembly.o', '$build/armv7/snapshot_assembly.o',
...@@ -562,7 +550,7 @@ void main() { ...@@ -562,7 +550,7 @@ void main() {
'-install_name', '-install_name',
'@rpath/App.framework/App', '@rpath/App.framework/App',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-o', '-o',
'$build/arm64/App.framework/App', '$build/arm64/App.framework/App',
'$build/arm64/snapshot_assembly.o', '$build/arm64/snapshot_assembly.o',
...@@ -577,6 +565,7 @@ void main() { ...@@ -577,6 +565,7 @@ void main() {
]), ]),
]); ]);
iosEnvironment.defines[kIosArchs] ='armv7 arm64'; iosEnvironment.defines[kIosArchs] ='armv7 arm64';
iosEnvironment.defines[kSdkRoot] = 'path/to/sdk';
await const AotAssemblyProfile().build(iosEnvironment); await const AotAssemblyProfile().build(iosEnvironment);
...@@ -590,6 +579,7 @@ void main() { ...@@ -590,6 +579,7 @@ void main() {
testUsingContext('AotAssemblyProfile with bitcode sends correct argument to snapshotter (one arch)', () async { testUsingContext('AotAssemblyProfile with bitcode sends correct argument to snapshotter (one arch)', () async {
iosEnvironment.defines[kIosArchs] = 'arm64'; iosEnvironment.defines[kIosArchs] = 'arm64';
iosEnvironment.defines[kBitcodeFlag] = 'true'; iosEnvironment.defines[kBitcodeFlag] = 'true';
iosEnvironment.defines[kSdkRoot] = 'path/to/sdk';
final String build = iosEnvironment.buildDir.path; final String build = iosEnvironment.buildDir.path;
processManager.addCommands(<FakeCommand>[ processManager.addCommands(<FakeCommand>[
FakeCommand(command: <String>[ FakeCommand(command: <String>[
...@@ -610,19 +600,13 @@ void main() { ...@@ -610,19 +600,13 @@ void main() {
], ],
exitCode: 1, exitCode: 1,
), ),
const FakeCommand(command: <String>[
'xcrun',
'--sdk',
'iphoneos',
'--show-sdk-path',
]),
FakeCommand(command: <String>[ FakeCommand(command: <String>[
'xcrun', 'xcrun',
'cc', 'cc',
'-arch', '-arch',
'arm64', 'arm64',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
// Contains bitcode flag. // Contains bitcode flag.
'-fembed-bitcode', '-fembed-bitcode',
'-c', '-c',
...@@ -650,7 +634,7 @@ void main() { ...@@ -650,7 +634,7 @@ void main() {
// Contains bitcode flag. // Contains bitcode flag.
'-fembed-bitcode', '-fembed-bitcode',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-o', '-o',
'$build/arm64/App.framework/App', '$build/arm64/App.framework/App',
'$build/arm64/snapshot_assembly.o', '$build/arm64/snapshot_assembly.o',
...@@ -676,6 +660,7 @@ void main() { ...@@ -676,6 +660,7 @@ void main() {
testUsingContext('AotAssemblyRelease configures gen_snapshot with code size directory', () async { testUsingContext('AotAssemblyRelease configures gen_snapshot with code size directory', () async {
iosEnvironment.defines[kCodeSizeDirectory] = 'code_size_1'; iosEnvironment.defines[kCodeSizeDirectory] = 'code_size_1';
iosEnvironment.defines[kIosArchs] = 'arm64'; iosEnvironment.defines[kIosArchs] = 'arm64';
iosEnvironment.defines[kSdkRoot] = 'path/to/sdk';
iosEnvironment.defines[kBitcodeFlag] = 'true'; iosEnvironment.defines[kBitcodeFlag] = 'true';
final String build = iosEnvironment.buildDir.path; final String build = iosEnvironment.buildDir.path;
processManager.addCommands(<FakeCommand>[ processManager.addCommands(<FakeCommand>[
...@@ -699,19 +684,13 @@ void main() { ...@@ -699,19 +684,13 @@ void main() {
], ],
exitCode: 1, exitCode: 1,
), ),
const FakeCommand(command: <String>[
'xcrun',
'--sdk',
'iphoneos',
'--show-sdk-path',
]),
FakeCommand(command: <String>[ FakeCommand(command: <String>[
'xcrun', 'xcrun',
'cc', 'cc',
'-arch', '-arch',
'arm64', 'arm64',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
// Contains bitcode flag. // Contains bitcode flag.
'-fembed-bitcode', '-fembed-bitcode',
'-c', '-c',
...@@ -739,7 +718,7 @@ void main() { ...@@ -739,7 +718,7 @@ void main() {
// Contains bitcode flag. // Contains bitcode flag.
'-fembed-bitcode', '-fembed-bitcode',
'-isysroot', '-isysroot',
'', 'path/to/sdk',
'-o', '-o',
'$build/arm64/App.framework/App', '$build/arm64/App.framework/App',
'$build/arm64/snapshot_assembly.o', '$build/arm64/snapshot_assembly.o',
......
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