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 {
if
(
targetPlatform
!=
TargetPlatform
.
ios
)
{
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
(
'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
];
...
...
@@ -95,7 +99,7 @@ abstract class AotAssemblyBase extends Target {
mainPath:
environment
.
buildDir
.
childFile
(
'app.dill'
).
path
,
outputPath:
environment
.
fileSystem
.
path
.
join
(
buildOutputPath
,
getNameForDarwinArch
(
darwinArch
)),
darwinArch:
darwinArch
,
sdkRoot:
environment
.
defines
[
kSdkRoot
]
,
sdkRoot:
sdkRoot
,
bitcode:
bitcode
,
quiet:
true
,
splitDebugInfo:
splitDebugInfo
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart
View file @
6118eaa0
...
...
@@ -469,7 +469,7 @@ void main() {
'-arch'
,
'armv7'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-c'
,
'
$build
/armv7/snapshot_assembly.S'
,
'-o'
,
...
...
@@ -481,7 +481,7 @@ void main() {
'-arch'
,
'arm64'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-c'
,
'
$build
/arm64/snapshot_assembly.S'
,
'-o'
,
...
...
@@ -505,7 +505,7 @@ void main() {
'-install_name'
,
'@rpath/App.framework/App'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-o'
,
'
$build
/armv7/App.framework/App'
,
'
$build
/armv7/snapshot_assembly.o'
,
...
...
@@ -528,7 +528,7 @@ void main() {
'-install_name'
,
'@rpath/App.framework/App'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-o'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/snapshot_assembly.o'
,
...
...
@@ -543,7 +543,7 @@ void main() {
]),
]);
iosEnvironment
.
defines
[
kIosArchs
]
=
'armv7 arm64'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/sdk'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/
iPhoneOS.
sdk'
;
await
const
AotAssemblyProfile
().
build
(
iosEnvironment
);
...
...
@@ -557,7 +557,7 @@ void main() {
testUsingContext
(
'AotAssemblyProfile with bitcode sends correct argument to snapshotter (one arch)'
,
()
async
{
iosEnvironment
.
defines
[
kIosArchs
]
=
'arm64'
;
iosEnvironment
.
defines
[
kBitcodeFlag
]
=
'true'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/sdk'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/
iPhoneOS.
sdk'
;
final
String
build
=
iosEnvironment
.
buildDir
.
path
;
processManager
.
addCommands
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
...
...
@@ -575,7 +575,7 @@ void main() {
'-arch'
,
'arm64'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
// Contains bitcode flag.
'-fembed-bitcode'
,
'-c'
,
...
...
@@ -603,7 +603,7 @@ void main() {
// Contains bitcode flag.
'-fembed-bitcode'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-o'
,
'
$build
/arm64/App.framework/App'
,
'
$build
/arm64/snapshot_assembly.o'
,
...
...
@@ -629,7 +629,7 @@ void main() {
testUsingContext
(
'AotAssemblyRelease configures gen_snapshot with code size directory'
,
()
async
{
iosEnvironment
.
defines
[
kCodeSizeDirectory
]
=
'code_size_1'
;
iosEnvironment
.
defines
[
kIosArchs
]
=
'arm64'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/sdk'
;
iosEnvironment
.
defines
[
kSdkRoot
]
=
'path/to/
iPhoneOS.
sdk'
;
iosEnvironment
.
defines
[
kBitcodeFlag
]
=
'true'
;
final
String
build
=
iosEnvironment
.
buildDir
.
path
;
processManager
.
addCommands
(<
FakeCommand
>[
...
...
@@ -650,7 +650,7 @@ void main() {
'-arch'
,
'arm64'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
// Contains bitcode flag.
'-fembed-bitcode'
,
'-c'
,
...
...
@@ -678,7 +678,7 @@ void main() {
// Contains bitcode flag.
'-fembed-bitcode'
,
'-isysroot'
,
'path/to/sdk'
,
'path/to/
iPhoneOS.
sdk'
,
'-o'
,
'
$build
/arm64/App.framework/App'
,
'
$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() {
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
Environment
environment
=
Environment
.
test
(
fileSystem
.
currentDirectory
,
defines:
<
String
,
String
>{
kTargetPlatform:
'ios'
,
kSdkRoot:
'path/to/sdk'
,
kSdkRoot:
'path/to/iPhoneSimulator.sdk'
,
kBuildMode:
'release'
,
kIosArchs:
'x86_64'
,
},
processManager:
processManager
,
artifacts:
artifacts
,
logger:
logger
,
fileSystem:
fileSystem
,
);
environment
.
defines
[
kBuildMode
]
=
'release'
;
environment
.
defines
[
kIosArchs
]
=
'x86_64'
;
expect
(
const
AotAssemblyRelease
().
build
(
environment
),
throwsA
(
isA
<
Exception
>()
.
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