Add debug symbols (symbol-index) to serve.sh for Fuchsia. (flutter/engine#26463)

This commit is contained in:
Darren Chan
2021-05-27 19:49:02 -04:00
committed by GitHub
parent 6341250126
commit 5b6518d416
3 changed files with 22 additions and 50 deletions

View File

@@ -13,7 +13,6 @@ fi
# Note: if this file location changes this path needs to change
FLUTTER_ENGINE_SRC_DIR="$(dirname "$(dirname "$(dirname "$(dirname "$(dirname "${devshell_lib_dir}")")")")")"
export FLUTTER_ENGINE_SRC_DIR
export FLUTTER_ENGINE_OUT_DIR="${FLUTTER_ENGINE_OUT_DIR:-${FLUTTER_ENGINE_SRC_DIR}/out}"
unset devshell_lib_dir
# Find the fuchsia sdk location

View File

@@ -6,11 +6,11 @@
### Serves the out directory
## usage:
## -p port for "pm serve" to listen on
## -d device_name to use for connecting
## -r If you are running a remote workflow
## --only-serve-runners If set will only serve the flutter and dart runners
## --out the out directory (ex: fuchsia_debug_x64)
## --out <out_dir> Required. The out directory (ex: out/fuchsia_debug_x64).
## -p <port> Optional. The port for "pm serve" to listen on. Defaults to 8084.
## -d <device_name> Required for local workflows. The device_name to use for connecting.
## -r Optional. Serve to a remote target.
## --only-serve-runners Optional. Only serve the flutter and dart runners.
#TODO: Take an out directory and use that to find the list of packages to publish
@@ -19,12 +19,17 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.
# We need to use the fuchsia checkout still, make sure it is there
ensure_fuchsia_dir
remote=false
device_name=""
out=""
port="8084"
device_name=""
remote=false
only_serve_runners=false
while (($#)); do
case "$1" in
--out)
out="$2"
shift
;;
-p)
port="$2"
shift
@@ -46,17 +51,25 @@ while (($#)); do
shift
done
if [[ -z "${out}" ]]; then
engine-error "Must specify an out directory, such as out/fuchsia_debug_x64"
exit 1
fi
# Start our package server
# TODO: Need to ask for the out directory to find the package list
# TODO: Generate the all_packages.list file
cd "${FLUTTER_ENGINE_SRC_DIR}" || exit
"${FLUTTER_ENGINE_FUCHSIA_SDK_DIR}/tools/pm" serve -vt \
-repo "${FLUTTER_ENGINE_OUT_DIR}/tuf" \
-repo "${FLUTTER_ENGINE_FUCHSIA_SDK_DIR}/${out}/tuf" \
-l ":${port}" \
-p "${FLUTTER_ENGINE_SRC_DIR}/flutter/tools/fuchsia/all_packages.list"&
serve_pid=$!
# TODO: Set up the debug symbol server
# Add debug symbols to the symbol index.
"${FLUTTER_ENGINE_FUCHSIA_SDK_DIR}/tools/symbol-index" add \
"${FLUTTER_ENGINE_SRC_DIR}/${out}/.build-id" \
"${FLUTTER_ENGINE_SRC_DIR}/${out}"
# Start our server and loop to check if our device is up give some slack time
# to ensure that pm has started

View File

@@ -41,46 +41,6 @@ template("_copy_debug_symbols") {
}
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 = [
"--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" ]
}
}