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
eefe9d95
Unverified
Commit
eefe9d95
authored
Aug 30, 2019
by
Dan Field
Committed by
GitHub
Aug 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep symbols for profile (#39530)
parent
359b5325
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
6 deletions
+52
-6
build.dart
packages/flutter_tools/lib/src/base/build.dart
+5
-3
build_test.dart
...ges/flutter_tools/test/general.shard/base/build_test.dart
+47
-3
No files found.
packages/flutter_tools/lib/src/base/build.dart
View file @
eefe9d95
...
...
@@ -178,7 +178,8 @@ class AOTSnapshotter {
// is resolved.
// The DWARF section confuses Xcode tooling, so this strips it. Ideally,
// gen_snapshot would provide an argument to do this automatically.
if
(
platform
==
TargetPlatform
.
ios
&&
bitcode
)
{
final
bool
stripSymbols
=
platform
==
TargetPlatform
.
ios
&&
buildMode
==
BuildMode
.
release
&&
bitcode
;
if
(
stripSymbols
)
{
final
IOSink
sink
=
fs
.
file
(
'
$assembly
.stripped.S'
).
openWrite
();
for
(
String
line
in
fs
.
file
(
assembly
).
readAsLinesSync
())
{
if
(
line
.
startsWith
(
'.section __DWARF'
))
{
...
...
@@ -201,12 +202,13 @@ class AOTSnapshotter {
final
RunResult
result
=
await
_buildFramework
(
appleArch:
darwinArch
,
isIOS:
platform
==
TargetPlatform
.
ios
,
assemblyPath:
bitcode
?
'
$assembly
.stripped.S'
:
assembly
,
assemblyPath:
stripSymbols
?
'
$assembly
.stripped.S'
:
assembly
,
outputPath:
outputDir
.
path
,
bitcode:
bitcode
,
);
if
(
result
.
exitCode
!=
0
)
if
(
result
.
exitCode
!=
0
)
{
return
result
.
exitCode
;
}
}
return
0
;
}
...
...
packages/flutter_tools/test/general.shard/base/build_test.dart
View file @
eefe9d95
...
...
@@ -163,7 +163,7 @@ void main() {
),
isNot
(
0
));
},
overrides:
contextOverrides
);
testUsingContext
(
'iOS
debug
AOT with bitcode uses right flags'
,
()
async
{
testUsingContext
(
'iOS
profile
AOT with bitcode uses right flags'
,
()
async
{
fs
.
file
(
'main.dill'
).
writeAsStringSync
(
'binary magic'
);
final
String
outputPath
=
fs
.
path
.
join
(
'build'
,
'foo'
);
...
...
@@ -204,6 +204,52 @@ void main() {
verify
(
xcode
.
cc
(
argThat
(
contains
(
'-fembed-bitcode'
)))).
called
(
1
);
verify
(
xcode
.
clang
(
argThat
(
contains
(
'-fembed-bitcode'
)))).
called
(
1
);
final
File
assemblyFile
=
fs
.
file
(
assembly
);
expect
(
assemblyFile
.
existsSync
(),
true
);
expect
(
assemblyFile
.
readAsStringSync
().
contains
(
'.section __DWARF'
),
true
);
},
overrides:
contextOverrides
);
testUsingContext
(
'iOS release AOT with bitcode uses right flags'
,
()
async
{
fs
.
file
(
'main.dill'
).
writeAsStringSync
(
'binary magic'
);
final
String
outputPath
=
fs
.
path
.
join
(
'build'
,
'foo'
);
fs
.
directory
(
outputPath
).
createSync
(
recursive:
true
);
final
String
assembly
=
fs
.
path
.
join
(
outputPath
,
'snapshot_assembly.S'
);
genSnapshot
.
outputs
=
<
String
,
String
>{
assembly:
'blah blah
\n
.section __DWARF
\n
blah blah
\n
'
,
};
final
RunResult
successResult
=
RunResult
(
ProcessResult
(
1
,
0
,
''
,
''
),
<
String
>[
'command name'
,
'arguments...'
]);
when
(
xcode
.
cc
(
any
)).
thenAnswer
((
_
)
=>
Future
<
RunResult
>.
value
(
successResult
));
when
(
xcode
.
clang
(
any
)).
thenAnswer
((
_
)
=>
Future
<
RunResult
>.
value
(
successResult
));
final
int
genSnapshotExitCode
=
await
snapshotter
.
build
(
platform:
TargetPlatform
.
ios
,
buildMode:
BuildMode
.
release
,
mainPath:
'main.dill'
,
packagesPath:
'.packages'
,
outputPath:
outputPath
,
darwinArch:
DarwinArch
.
armv7
,
bitcode:
true
,
);
expect
(
genSnapshotExitCode
,
0
);
expect
(
genSnapshot
.
callCount
,
1
);
expect
(
genSnapshot
.
snapshotType
.
platform
,
TargetPlatform
.
ios
);
expect
(
genSnapshot
.
snapshotType
.
mode
,
BuildMode
.
release
);
expect
(
genSnapshot
.
additionalArgs
,
<
String
>[
'--deterministic'
,
'--snapshot_kind=app-aot-assembly'
,
'--assembly=
$assembly
'
,
'--no-sim-use-hardfp'
,
'--no-use-integer-division'
,
'main.dill'
,
]);
verify
(
xcode
.
cc
(
argThat
(
contains
(
'-fembed-bitcode'
)))).
called
(
1
);
verify
(
xcode
.
clang
(
argThat
(
contains
(
'-fembed-bitcode'
)))).
called
(
1
);
final
File
assemblyFile
=
fs
.
file
(
assembly
);
final
File
assemblyBitcodeFile
=
fs
.
file
(
'
$assembly
.stripped.S'
);
expect
(
assemblyFile
.
existsSync
(),
true
);
...
...
@@ -253,9 +299,7 @@ void main() {
verifyNever
(
xcode
.
clang
(
argThat
(
contains
(
'-fembed-bitcode'
))));
final
File
assemblyFile
=
fs
.
file
(
assembly
);
final
File
assemblyBitcodeFile
=
fs
.
file
(
'
$assembly
.bitcode'
);
expect
(
assemblyFile
.
existsSync
(),
true
);
expect
(
assemblyBitcodeFile
.
existsSync
(),
false
);
expect
(
assemblyFile
.
readAsStringSync
().
contains
(
'.section __DWARF'
),
true
);
},
overrides:
contextOverrides
);
...
...
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