Skip to content

Commit

Permalink
CIPD needs the directory to be relative (flutter#13461)
Browse files Browse the repository at this point in the history
* [recipe] Pass the out-dir argument in the recipe

* CIPD needs the yaml definition to be relative to the upload dir
  • Loading branch information
iskakaushik authored Oct 31, 2019
1 parent 3a32d9f commit 7c80d62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions recipe_changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 10 additions & 5 deletions tools/fuchsia/merge_and_upload_debug_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
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 """
Expand All @@ -32,16 +35,18 @@ def CreateCIPDDefinition(target_arch, out_dir):
""" % (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',
Expand Down

0 comments on commit 7c80d62

Please sign in to comment.