Skip to content

Commit

Permalink
Add more debug loging to symbol verification script (flutter#6372)
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer authored Sep 28, 2018
1 parent fcb3c51 commit 0cd9ee3
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions testing/symbols/verify_exported.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,19 @@ int _checkIos(String outPath, String nmPath, Iterable<String> builds) {
int failures = 0;
for (String build in builds) {
final String libFlutter = p.join(outPath, build, 'Flutter.framework', 'Flutter');
final String stdout = Process.runSync(nmPath, <String>['-gUm', libFlutter]).stdout;
final ProcessResult nmResult = Process.runSync(nmPath, <String>['-gUm', libFlutter]);
print('+++ DEBUG: stdout of nm +++');
print(stdout);
print(nmResult.stdout);
print('+++ END: stdout of nm +++');
final Iterable<NmEntry> unexpectedEntries = NmEntry.parse(stdout).where((NmEntry entry) {
print('+++ DEBUG: stderr of nm +++');
print(nmResult.stderr);
print('+++ END: stdout of nm +++');
if (nmResult.exitCode != 0) {
print('ERROR: failed to execute "nm -gUm $libFlutter":\n${nmResult.stderr}');
failures++;
continue;
}
final Iterable<NmEntry> unexpectedEntries = NmEntry.parse(nmResult.stdout).where((NmEntry entry) {
return !((entry.type == '(__DATA,__common)' && entry.name.startsWith('_Flutter'))
|| (entry.type == '(__DATA,__objc_data)'
&& (entry.name.startsWith('_OBJC_METACLASS_\$_Flutter') || entry.name.startsWith('_OBJC_CLASS_\$_Flutter'))));
Expand All @@ -75,11 +83,19 @@ int _checkAndroid(String outPath, String nmPath, Iterable<String> builds) {
int failures = 0;
for (String build in builds) {
final String libFlutter = p.join(outPath, build, 'libflutter.so');
final String stdout = Process.runSync(nmPath, <String>['-gU', libFlutter]).stdout;
final ProcessResult nmResult = Process.runSync(nmPath, <String>['-gU', libFlutter]);
print('+++ DEBUG: stdout of nm +++');
print(stdout);
print(nmResult.stdout);
print('+++ END: stdout of nm +++');
final Iterable<NmEntry> entries = NmEntry.parse(stdout);
print('+++ DEBUG: stderr of nm +++');
print(nmResult.stderr);
print('+++ END: stdout of nm +++');
if (nmResult.exitCode != 0) {
print('ERROR: failed to execute "nm -gU $libFlutter":\n${nmResult.stderr}');
failures++;
continue;
}
final Iterable<NmEntry> entries = NmEntry.parse(nmResult.stdout);
if (entries.isEmpty) {
print('ERROR: $libFlutter exports no symbol');
print(' Expected exactly one symbol "JNI_OnLoad" of type "T", but got none.');
Expand Down

0 comments on commit 0cd9ee3

Please sign in to comment.