From 8fefd35da4637c575dcec40c47c55fd4767acf52 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 3 Nov 2023 12:38:58 -0700 Subject: [PATCH 1/7] Fix type in upload symbols script. It was trying to update a full path rather than a single file and it could not find gsutil on path. --- .ci.yaml | 2 +- tools/fuchsia/upload_to_symbol_server.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index b6b83d5019c1f..448327d744755 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -216,7 +216,7 @@ targets: - web_sdk/** - name: Linux linux_fuchsia - bringup: true + bringup: false recipe: engine_v2/engine_v2 timeout: 60 properties: diff --git a/tools/fuchsia/upload_to_symbol_server.py b/tools/fuchsia/upload_to_symbol_server.py index dabd8728f1d46..cd14eae751eb2 100755 --- a/tools/fuchsia/upload_to_symbol_server.py +++ b/tools/fuchsia/upload_to_symbol_server.py @@ -39,6 +39,9 @@ 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] @@ -47,7 +50,7 @@ def process_symbols(should_upload, symbol_dir): FUCHSIA_ARTIFACTS_BUCKET_NAME, remote_filename(file) ) if should_upload: - command = 'gsutil cp %s %s' % (full_path, remote_path) + command = 'gsutil cp %s %s' % (file, remote_path) subprocess.check_call(command) else: print(remote_path) @@ -81,6 +84,7 @@ def main(): engine_version = 'HEAD' should_upload = False + should_upload = True # Remove me process_symbols(should_upload, args.symbol_dir) return 0 From f1842242792ef1ac5daf0d509e50bd88982a406d Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 3 Nov 2023 12:55:03 -0700 Subject: [PATCH 2/7] Add context for depot_tools. --- ci/builders/linux_fuchsia.json | 2 ++ tools/fuchsia/upload_to_symbol_server.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 cd14eae751eb2..c71d3a515d2a1 100755 --- a/tools/fuchsia/upload_to_symbol_server.py +++ b/tools/fuchsia/upload_to_symbol_server.py @@ -84,7 +84,7 @@ def main(): engine_version = 'HEAD' should_upload = False - should_upload = True # Remove me + should_upload = True # Remove me process_symbols(should_upload, args.symbol_dir) return 0 From 1dcb4cfd85332518dbd6a8abb49005dadba1bf9d Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 3 Nov 2023 13:39:58 -0700 Subject: [PATCH 3/7] Use depot_tools gsutil wrapper. --- tools/fuchsia/upload_to_symbol_server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/fuchsia/upload_to_symbol_server.py b/tools/fuchsia/upload_to_symbol_server.py index c71d3a515d2a1..85a8f5f59ec3c 100755 --- a/tools/fuchsia/upload_to_symbol_server.py +++ b/tools/fuchsia/upload_to_symbol_server.py @@ -46,11 +46,12 @@ def process_symbols(should_upload, symbol_dir): 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' % (file, remote_path) + command = 'gsutil.py cp %s %s' % (file, remote_path) subprocess.check_call(command) else: print(remote_path) From b2bac7bf6bd051f0ed780765e6819f42d4cd14e5 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 3 Nov 2023 15:11:11 -0700 Subject: [PATCH 4/7] Calculate full path to gsutil. --- tools/fuchsia/upload_to_symbol_server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/fuchsia/upload_to_symbol_server.py b/tools/fuchsia/upload_to_symbol_server.py index 85a8f5f59ec3c..e06f1b9333111 100755 --- a/tools/fuchsia/upload_to_symbol_server.py +++ b/tools/fuchsia/upload_to_symbol_server.py @@ -51,7 +51,8 @@ def process_symbols(should_upload, symbol_dir): remote_filename(file) ) if should_upload: - command = 'gsutil.py cp %s %s' % (file, remote_path) + gsutil = os.path.join(os.environ['DEPOT_TOOLS'], 'gsutil.py') + command = '%s cp %s %s' % (gsutil, file, remote_path) subprocess.check_call(command) else: print(remote_path) From 59aee5eb3c9892ace0645d44dc480ba9a18ff701 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 3 Nov 2023 15:39:24 -0700 Subject: [PATCH 5/7] Run script with python3. --- tools/fuchsia/upload_to_symbol_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fuchsia/upload_to_symbol_server.py b/tools/fuchsia/upload_to_symbol_server.py index e06f1b9333111..a801ef52e6823 100755 --- a/tools/fuchsia/upload_to_symbol_server.py +++ b/tools/fuchsia/upload_to_symbol_server.py @@ -52,7 +52,7 @@ def process_symbols(should_upload, symbol_dir): ) if should_upload: gsutil = os.path.join(os.environ['DEPOT_TOOLS'], 'gsutil.py') - command = '%s cp %s %s' % (gsutil, file, remote_path) + command = 'python3 %s cp %s %s' % (gsutil, file, remote_path) subprocess.check_call(command) else: print(remote_path) From 1bb6b9a5c462f9c8bf36f9fd0b55478426c1062d Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 3 Nov 2023 16:03:42 -0700 Subject: [PATCH 6/7] Use list instead of string for command. --- tools/fuchsia/upload_to_symbol_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fuchsia/upload_to_symbol_server.py b/tools/fuchsia/upload_to_symbol_server.py index a801ef52e6823..562cdabc47e43 100755 --- a/tools/fuchsia/upload_to_symbol_server.py +++ b/tools/fuchsia/upload_to_symbol_server.py @@ -52,7 +52,7 @@ def process_symbols(should_upload, symbol_dir): ) if should_upload: gsutil = os.path.join(os.environ['DEPOT_TOOLS'], 'gsutil.py') - command = 'python3 %s cp %s %s' % (gsutil, file, remote_path) + command = ['python3', gsutil, '--', 'cp', gsutil, file, remote_path] subprocess.check_call(command) else: print(remote_path) From b436e35a152e319de23df8a8016ac7ff511feaf6 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Fri, 3 Nov 2023 17:44:05 -0700 Subject: [PATCH 7/7] Remove presubmit for linux_fuchsia. --- .ci.yaml | 2 +- tools/fuchsia/upload_to_symbol_server.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci.yaml b/.ci.yaml index 448327d744755..b6b83d5019c1f 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -216,7 +216,7 @@ targets: - web_sdk/** - name: Linux linux_fuchsia - bringup: false + bringup: true recipe: engine_v2/engine_v2 timeout: 60 properties: diff --git a/tools/fuchsia/upload_to_symbol_server.py b/tools/fuchsia/upload_to_symbol_server.py index 562cdabc47e43..50aceef874dfe 100755 --- a/tools/fuchsia/upload_to_symbol_server.py +++ b/tools/fuchsia/upload_to_symbol_server.py @@ -86,7 +86,6 @@ def main(): engine_version = 'HEAD' should_upload = False - should_upload = True # Remove me process_symbols(should_upload, args.symbol_dir) return 0