From 8a30840904062e2db6c20c3aa75046b786c48246 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Thu, 31 Oct 2019 12:23:11 -0700 Subject: [PATCH] CIPD needs the directory to be relative (flutter/engine#13461) * [recipe] Pass the out-dir argument in the recipe * CIPD needs the yaml definition to be relative to the upload dir --- engine/src/flutter/recipe_changelog.md | 5 +++++ .../fuchsia/merge_and_upload_debug_symbols.py | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/engine/src/flutter/recipe_changelog.md b/engine/src/flutter/recipe_changelog.md index bc48a1b60e..4d2cc5cccf 100644 --- a/engine/src/flutter/recipe_changelog.md +++ b/engine/src/flutter/recipe_changelog.md @@ -1,5 +1,10 @@ # Recipe Changelog +## 30 Oct 2019 + +* Recipe Link: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1891522 +* Reason: Pass the `out-dir` arg in the recipe. + ## 29 Oct 2019 * Recipe Link: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1887742 diff --git a/engine/src/flutter/tools/fuchsia/merge_and_upload_debug_symbols.py b/engine/src/flutter/tools/fuchsia/merge_and_upload_debug_symbols.py index 6e49c71f63..78cf713f16 100755 --- a/engine/src/flutter/tools/fuchsia/merge_and_upload_debug_symbols.py +++ b/engine/src/flutter/tools/fuchsia/merge_and_upload_debug_symbols.py @@ -14,13 +14,16 @@ import platform import shutil import subprocess import sys -import tempfile def IsLinux(): return platform.system() == 'Linux' +def GetPackagingDir(out_dir): + return os.path.abspath(os.path.join(out_dir, os.pardir)) + + def CreateCIPDDefinition(target_arch, out_dir): dir_name = os.path.basename(os.path.normpath(out_dir)) return """ @@ -32,16 +35,18 @@ data: """ % (target_arch, target_arch, dir_name) +# CIPD CLI needs the definition and data directory to be relative to each other. def WriteCIPDDefinition(target_arch, out_dir): - _, temp_file = tempfile.mkstemp(suffix='.yaml') - with open(temp_file, 'w') as f: + _packaging_dir = GetPackagingDir(out_dir) + yaml_file = os.path.join(_packaging_dir, 'debug_symbols.cipd.yaml') + with open(yaml_file, 'w') as f: cipd_def = CreateCIPDDefinition(target_arch, out_dir) f.write(cipd_def) - return temp_file + return yaml_file def ProcessCIPDPackage(upload, cipd_yaml, engine_version, out_dir, target_arch): - _packaging_dir = os.path.abspath(os.path.join(out_dir, os.pardir)) + _packaging_dir = GetPackagingDir(out_dir) if upload and IsLinux(): command = [ 'cipd', 'create', '-pkg-def', cipd_yaml, '-ref', 'latest', '-tag',