From cb3b7ab48743fbf37cb09d7bca5f09b2c17bf806 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 29 Jan 2020 13:43:23 -0800 Subject: [PATCH] [flutter_tools] simplify symbol logic for iOS (#49628) --- dev/devicelab/bin/tasks/module_test_ios.dart | 36 ------------------- packages/flutter_tools/bin/xcode_backend.sh | 24 ------------- .../flutter_tools/lib/src/base/build.dart | 6 +--- .../test/general.shard/base/build_test.dart | 5 +++ 4 files changed, 6 insertions(+), 65 deletions(-) diff --git a/dev/devicelab/bin/tasks/module_test_ios.dart b/dev/devicelab/bin/tasks/module_test_ios.dart index 04b75e63ad..04503efe49 100644 --- a/dev/devicelab/bin/tasks/module_test_ios.dart +++ b/dev/devicelab/bin/tasks/module_test_ios.dart @@ -57,13 +57,6 @@ Future main() async { ); } - if (await _hasDebugSymbols(ephemeralReleaseHostApp)) { - return TaskResult.failure( - "Ephemeral host app ${ephemeralReleaseHostApp.path}'s App.framework's " - "debug symbols weren't stripped in release mode" - ); - } - section('Clean build'); await inDirectory(projectDir, () async { @@ -97,12 +90,6 @@ Future main() async { ); } - if (!await _hasDebugSymbols(ephemeralProfileHostApp)) { - return TaskResult.failure( - "Ephemeral host app ${ephemeralProfileHostApp.path}'s App.framework does not contain debug symbols" - ); - } - section('Clean build'); await inDirectory(projectDir, () async { @@ -406,26 +393,3 @@ Future _isAppAotBuild(Directory app) async { return symbolTable.contains('kDartIsolateSnapshotInstructions'); } - -Future _hasDebugSymbols(Directory app) async { - final String binary = path.join( - app.path, - 'Frameworks', - 'App.framework', - 'App', - ); - - final String symbolTable = await eval( - 'dsymutil', - [ - '--dump-debug-map', - binary, - ], - // The output is huge. - printStdout: false, - ); - - // Search for some random Flutter framework Dart function which should always - // be in App.framework. - return symbolTable.contains('BuildOwner_reassemble'); -} diff --git a/packages/flutter_tools/bin/xcode_backend.sh b/packages/flutter_tools/bin/xcode_backend.sh index 7f5bb868bb..00229927b1 100755 --- a/packages/flutter_tools/bin/xcode_backend.sh +++ b/packages/flutter_tools/bin/xcode_backend.sh @@ -201,30 +201,6 @@ BuildApp() { RunCommand cp -r -- "${app_framework}" "${derived_dir}" - if [[ "${build_mode}" == "release" ]]; then - StreamOutput " ├─Generating dSYM file..." - # Xcode calls `symbols` during app store upload, which uses Spotlight to - # find dSYM files for embedded frameworks. When it finds the dSYM file for - # `App.framework` it throws an error, which aborts the app store upload. - # To avoid this, we place the dSYM files in a folder ending with ".noindex", - # which hides it from Spotlight, https://github.com/flutter/flutter/issues/22560. - RunCommand mkdir -p -- "${build_dir}/dSYMs.noindex" - RunCommand xcrun dsymutil -o "${build_dir}/dSYMs.noindex/App.framework.dSYM" "${app_framework}/App" - if [[ $? -ne 0 ]]; then - EchoError "Failed to generate debug symbols (dSYM) file for ${app_framework}/App." - exit -1 - fi - StreamOutput "done" - - StreamOutput " ├─Stripping debug symbols..." - RunCommand xcrun strip -x -S "${derived_dir}/App.framework/App" - if [[ $? -ne 0 ]]; then - EchoError "Failed to strip ${derived_dir}/App.framework/App." - exit -1 - fi - StreamOutput "done" - fi - else RunCommand mkdir -p -- "${derived_dir}/App.framework" diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index 7f3a88e979..3ecd62aa13 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart @@ -138,11 +138,7 @@ class AOTSnapshotter { outputPaths.add(assembly); genSnapshotArgs.add('--snapshot_kind=app-aot-assembly'); genSnapshotArgs.add('--assembly=$assembly'); - // TODO(jonahwilliams): determine the correct time to use strip - // since this is required for the future dwarf strack traces option. - if (bitcode && buildMode == BuildMode.release) { - genSnapshotArgs.add('--strip'); - } + genSnapshotArgs.add('--strip'); } else { final String aotSharedLibrary = globals.fs.path.join(outputDir.path, 'app.so'); outputPaths.add(aotSharedLibrary); diff --git a/packages/flutter_tools/test/general.shard/base/build_test.dart b/packages/flutter_tools/test/general.shard/base/build_test.dart index 46180d22c2..b50555b193 100644 --- a/packages/flutter_tools/test/general.shard/base/build_test.dart +++ b/packages/flutter_tools/test/general.shard/base/build_test.dart @@ -326,6 +326,7 @@ void main() { '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', + '--strip', '--no-sim-use-hardfp', '--no-use-integer-division', '--no-causal-async-stacks', @@ -444,6 +445,7 @@ void main() { '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=$assembly', + '--strip', '--no-sim-use-hardfp', '--no-use-integer-division', '--no-causal-async-stacks', @@ -493,6 +495,7 @@ void main() { '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=${globals.fs.path.join(outputPath, 'snapshot_assembly.S')}', + '--strip', '--no-causal-async-stacks', '--lazy-async-stacks', 'main.dill', @@ -531,6 +534,7 @@ void main() { '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=${globals.fs.path.join(outputPath, 'snapshot_assembly.S')}', + '--strip', '--no-sim-use-hardfp', '--no-use-integer-division', '--no-causal-async-stacks', @@ -571,6 +575,7 @@ void main() { '--deterministic', '--snapshot_kind=app-aot-assembly', '--assembly=${globals.fs.path.join(outputPath, 'snapshot_assembly.S')}', + '--strip', '--no-causal-async-stacks', '--lazy-async-stacks', 'main.dill',