Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
6118eaa0
Unverified
Commit
6118eaa0
authored
Dec 23, 2020
by
Jenn Magder
Committed by
GitHub
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for iOS simulator SDK during AOT validation instead of assuming x86 (#72834)
parent
27f29e75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
ios.dart
packages/flutter_tools/lib/src/build_system/targets/ios.dart
+7
-3
common_test.dart
.../test/general.shard/build_system/targets/common_test.dart
+11
-11
ios_test.dart
...ols/test/general.shard/build_system/targets/ios_test.dart
+4
-4
No files found.
packages/flutter_tools/lib/src/build_system/targets/ios.dart
View file @
6118eaa0
...
@@ -66,10 +66,14 @@ abstract class AotAssemblyBase extends Target {
...
@@ -66,10 +66,14 @@ abstract class AotAssemblyBase extends Target {
if
(
targetPlatform
!=
TargetPlatform
.
ios
)
{
if
(
targetPlatform
!=
TargetPlatform
.
ios
)
{
throw
Exception
(
'aot_assembly is only supported for iOS applications.'
);
throw
Exception
(
'aot_assembly is only supported for iOS applications.'
);
}
}
if
(
darwinArchs
.
contains
(
DarwinArch
.
x86_64
))
{
final
String
sdkRoot
=
environment
.
defines
[
kSdkRoot
];
final
EnvironmentType
environmentType
=
environmentTypeFromSdkroot
(
environment
.
fileSystem
.
directory
(
sdkRoot
));
if
(
environmentType
==
EnvironmentType
.
simulator
)
{
throw
Exception
(
throw
Exception
(
'release/profile builds are only supported for physical devices. '
'release/profile builds are only supported for physical devices. '
'attempted to build for
$darwinArchs
.'
'attempted to build for
simulator
.'
);
);
}
}
final
String
codeSizeDirectory
=
environment
.
defines
[
kCodeSizeDirectory
];
final
String
codeSizeDirectory
=
environment
.
defines
[
kCodeSizeDirectory
];
...
@@ -95,7 +99,7 @@ abstract class AotAssemblyBase extends Target {
...
@@ -95,7 +99,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
]
,
sdkRoot:
sdkRoot
,
bitcode:
bitcode
,
bitcode:
bitcode
,
quiet:
true
,
quiet:
true
,
splitDebugInfo:
splitDebugInfo
,
splitDebugInfo:
splitDebugInfo
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart
View file @
6118eaa0
...
@@ -469,7 +469,7 @@ void main() {
...
@@ -469,7 +469,7 @@ void main() {
'-arch'
,
'-arch'
,
'armv7'
,
'armv7'
,
'-isysroot'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-c'
,
'-c'
,
'
$build
/armv7/snapshot_assembly.S'
,
'
$build
/armv7/snapshot_assembly.S'
,
'-o'
,
'-o'
,
...
@@ -481,7 +481,7 @@ void main() {
...
@@ -481,7 +481,7 @@ void main() {
'-arch'
,
'-arch'
,
'arm64'
,
'arm64'
,
'-isysroot'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-c'
,
'-c'
,
'
$build
/arm64/snapshot_assembly.S'
,
'
$build
/arm64/snapshot_assembly.S'
,
'-o'
,
'-o'
,
...
@@ -505,7 +505,7 @@ void main() {
...
@@ -505,7 +505,7 @@ void main() {
'-install_name'
,
'-install_name'
,
'@rpath/App.framework/App'
,
'@rpath/App.framework/App'
,
'-isysroot'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-o'
,
'-o'
,
'
$build
/armv7/App.framework/App'
,
'
$build
/armv7/App.framework/App'
,
'
$build
/armv7/snapshot_assembly.o'
,
'
$build
/armv7/snapshot_assembly.o'
,
...
@@ -528,7 +528,7 @@ void main() {
...
@@ -528,7 +528,7 @@ void main() {
'-install_name'
,
'-install_name'
,
'@rpath/App.framework/App'
,
'@rpath/App.framework/App'
,
'-isysroot'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-o'
,
'-o'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/snapshot_assembly.o'
,
'
$build
/arm64/snapshot_assembly.o'
,
...
@@ -543,7 +543,7 @@ void main() {
...
@@ -543,7 +543,7 @@ void main() {
]),
]),
]);
]);
iosEnvironment
.
defines
[
kIosArchs
]
=
'armv7 arm64'
;
iosEnvironment
.
defines
[
kIosArchs
]
=
'armv7 arm64'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/sdk'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/
iPhoneOS.
sdk'
;
await
const
AotAssemblyProfile
().
build
(
iosEnvironment
);
await
const
AotAssemblyProfile
().
build
(
iosEnvironment
);
...
@@ -557,7 +557,7 @@ void main() {
...
@@ -557,7 +557,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'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/
iPhoneOS.
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
>[
...
@@ -575,7 +575,7 @@ void main() {
...
@@ -575,7 +575,7 @@ void main() {
'-arch'
,
'-arch'
,
'arm64'
,
'arm64'
,
'-isysroot'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
// Contains bitcode flag.
// Contains bitcode flag.
'-fembed-bitcode'
,
'-fembed-bitcode'
,
'-c'
,
'-c'
,
...
@@ -603,7 +603,7 @@ void main() {
...
@@ -603,7 +603,7 @@ void main() {
// Contains bitcode flag.
// Contains bitcode flag.
'-fembed-bitcode'
,
'-fembed-bitcode'
,
'-isysroot'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-o'
,
'-o'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/snapshot_assembly.o'
,
'
$build
/arm64/snapshot_assembly.o'
,
...
@@ -629,7 +629,7 @@ void main() {
...
@@ -629,7 +629,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
[
kSdkRoot
]
=
'path/to/
iPhoneOS.
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
>[
...
@@ -650,7 +650,7 @@ void main() {
...
@@ -650,7 +650,7 @@ void main() {
'-arch'
,
'-arch'
,
'arm64'
,
'arm64'
,
'-isysroot'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
// Contains bitcode flag.
// Contains bitcode flag.
'-fembed-bitcode'
,
'-fembed-bitcode'
,
'-c'
,
'-c'
,
...
@@ -678,7 +678,7 @@ void main() {
...
@@ -678,7 +678,7 @@ void main() {
// Contains bitcode flag.
// Contains bitcode flag.
'-fembed-bitcode'
,
'-fembed-bitcode'
,
'-isysroot'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-o'
,
'-o'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/snapshot_assembly.o'
,
'
$build
/arm64/snapshot_assembly.o'
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart
View file @
6118eaa0
...
@@ -181,21 +181,21 @@ void main() {
...
@@ -181,21 +181,21 @@ void main() {
Platform:
()
=>
macPlatform
,
Platform:
()
=>
macPlatform
,
});
});
testUsingContext
(
'AotAssemblyRelease throws exception if asked to build for
x86 target
'
,
()
async
{
testUsingContext
(
'AotAssemblyRelease throws exception if asked to build for
simulator
'
,
()
async
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Environment
environment
=
Environment
.
test
(
final
Environment
environment
=
Environment
.
test
(
fileSystem
.
currentDirectory
,
fileSystem
.
currentDirectory
,
defines:
<
String
,
String
>{
defines:
<
String
,
String
>{
kTargetPlatform:
'ios'
,
kTargetPlatform:
'ios'
,
kSdkRoot:
'path/to/sdk'
,
kSdkRoot:
'path/to/iPhoneSimulator.sdk'
,
kBuildMode:
'release'
,
kIosArchs:
'x86_64'
,
},
},
processManager:
processManager
,
processManager:
processManager
,
artifacts:
artifacts
,
artifacts:
artifacts
,
logger:
logger
,
logger:
logger
,
fileSystem:
fileSystem
,
fileSystem:
fileSystem
,
);
);
environment
.
defines
[
kBuildMode
]
=
'release'
;
environment
.
defines
[
kIosArchs
]
=
'x86_64'
;
expect
(
const
AotAssemblyRelease
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
expect
(
const
AotAssemblyRelease
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
.
having
(
.
having
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment