From 24e35adeb4ef6be89be717bdaa7d8ce2118f8a94 Mon Sep 17 00:00:00 2001 From: Darren Chan <74682667+chandarrengoog@users.noreply.github.com> Date: Thu, 27 May 2021 16:14:01 -0400 Subject: [PATCH] Canonicalize fuchsia runner debug symbol path. (flutter/engine#26426) --- .../tools/fuchsia/fuchsia_debug_symbols.gni | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/engine/src/flutter/tools/fuchsia/fuchsia_debug_symbols.gni b/engine/src/flutter/tools/fuchsia/fuchsia_debug_symbols.gni index bc604be523f..5d624b6f860 100644 --- a/engine/src/flutter/tools/fuchsia/fuchsia_debug_symbols.gni +++ b/engine/src/flutter/tools/fuchsia/fuchsia_debug_symbols.gni @@ -23,6 +23,46 @@ template("_copy_debug_symbols") { sources = [ binary_path ] + _dest_base = "${root_out_dir}/.build-id" + + args = [ + "--executable-name", + target_name, + "--executable-path", + rebase_path(binary_path), + "--destination-base", + rebase_path(_dest_base), + "--read-elf", + rebase_path("//buildtools/${host_os}-${host_cpu}/clang/bin/llvm-readelf"), + ] + + if (unstripped) { + args += [ "--unstripped" ] + } + + outputs = [ "${_dest_base}/.${target_name}_success" ] + + if (!defined(deps)) { + deps = [] + } + deps += [ ":${target_name}_soft_transition" ] + } + + # TODO(fxbug.dev/76223): Soft transition recipes/engine.py to used + # canonicalized debug symbol name and then remove. + action(target_name + "_soft_transition") { + forward_variables_from(invoker, + [ + "deps", + "unstripped", + "binary_path", + "testonly", + ]) + + script = "//flutter/tools/fuchsia/copy_debug_symbols.py" + + sources = [ binary_path ] + _dest_base = "${root_out_dir}/flutter-debug-symbols-${flutter_runtime_mode}-${target_os}-${target_cpu}" args = [