build: document electron goma usage and add the external binaries (#21622)

This commit is contained in:
Samuel Attard 2020-01-07 10:35:52 -08:00 committed by GitHub
parent 0a850fbc5d
commit e18acb4380
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 2 deletions

View file

@ -43,6 +43,21 @@
"url": "sccache-win32-x64.zip",
"platform": "win32",
"sha": "b6a20fd1c2026f3792e7286bc768a7ebc261847b76449b49f55455e1f841fecd"
},
{
"url": "goma-win.zip",
"platform": "win32",
"sha": "f97c88aa5d49395ae20387b6329ad406fd019f5fb4aac4ba639ca928b7151f6b"
},
{
"url": "goma-linux.tgz",
"platform": "linux",
"sha": "1cb3099a40f6200ae57216efa26af795c587b6ac7ae97955d1078d0b1e3011a6"
},
{
"url": "goma-mac.tgz",
"platform": "darwin",
"sha": "da1e7de82fbf3b99f1a9d0f9bf51b25e75e8778fec180deb72cff873813d717c"
}
]
}

View file

@ -5,6 +5,7 @@ import errno
import hashlib
import json
import os
import tarfile
from lib.config import PLATFORM, get_target_arch
from lib.util import add_exec_bit, download, extract_zip, rm_rf, \
@ -51,8 +52,12 @@ def main():
temp_path = download_binary(base_url, version, binary['url'], binary['sha'])
# We assume that all binaries are in zip archives.
extract_zip(temp_path, output_dir)
if temp_path.endswith('.zip'):
extract_zip(temp_path, output_dir)
else:
tar = tarfile.open(temp_path, "r:gz")
tar.extractall(output_dir)
tar.close()
# Hack alert. Set exec bit for sccache binaries.
# https://bugs.python.org/issue15795