From 576833873c157117c7ef0fe61ed09225f9bc9880 Mon Sep 17 00:00:00 2001 From: godofredoc Date: Sat, 4 Nov 2023 09:25:24 -0700 Subject: [PATCH] Fix symbols upload (#47669) There were a couple of issues with the script. The first one is it was always trying to upload the entire .buil_id folder rather than individual files and the second one is that it could not find depot_tools on path. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- ci/builders/linux_fuchsia.json | 2 ++ tools/fuchsia/upload_to_symbol_server.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ci/builders/linux_fuchsia.json b/ci/builders/linux_fuchsia.json index da37bd6cd81a1..6388b1e9b13dc 100644 --- a/ci/builders/linux_fuchsia.json +++ b/ci/builders/linux_fuchsia.json @@ -77,6 +77,7 @@ { "name": "Upload to Symbol Server for arch: arm64", "language": "python3", + "contexts": ["depot_tools_on_path"], "script": "flutter/tools/fuchsia/upload_to_symbol_server.py", "parameters": [ "--symbol-dir", @@ -162,6 +163,7 @@ { "name": "Upload to Symbol Server for arch: x64", "language": "python3", + "contexts": ["depot_tools_on_path"], "script": "flutter/tools/fuchsia/upload_to_symbol_server.py", "parameters": [ "--symbol-dir", diff --git a/tools/fuchsia/upload_to_symbol_server.py b/tools/fuchsia/upload_to_symbol_server.py index dabd8728f1d46..50aceef874dfe 100755 --- a/tools/fuchsia/upload_to_symbol_server.py +++ b/tools/fuchsia/upload_to_symbol_server.py @@ -39,15 +39,20 @@ def process_symbols(should_upload, symbol_dir): for (dirpath, dirnames, filenames) in os.walk(full_path): files.extend([os.path.join(dirpath, f) for f in filenames]) + print('List of files to upload') + print('\n'.join(files)) + # Remove dbg_files files = [f for f in files if 'dbg_success' not in f] for file in files: - remote_path = 'gs://%s/%s' % ( - FUCHSIA_ARTIFACTS_BUCKET_NAME, remote_filename(file) + remote_path = 'gs://%s/%s/%s' % ( + FUCHSIA_ARTIFACTS_BUCKET_NAME, FUCHSIA_ARTIFACTS_DEBUG_NAMESPACE, + remote_filename(file) ) if should_upload: - command = 'gsutil cp %s %s' % (full_path, remote_path) + gsutil = os.path.join(os.environ['DEPOT_TOOLS'], 'gsutil.py') + command = ['python3', gsutil, '--', 'cp', gsutil, file, remote_path] subprocess.check_call(command) else: print(remote_path)