diff options
author | Joonas Kylmälä <joonas.kylmala@iki.fi> | 2018-08-27 14:09:09 -0400 |
---|---|---|
committer | Joonas Kylmälä <joonas.kylmala@iki.fi> | 2018-08-27 14:09:09 -0400 |
commit | 989f332ea4e1ac952625139fbd7c18e8a8b31c8a (patch) | |
tree | 28f03931fa1c2148a015d59d9855bf976231101a /update-prebuilts.py | |
parent | b0c259403b7b74b55fc93f50fd1f2fbae3510ece (diff) | |
parent | a74813a825e49267faa0b2ba45e9cd4bd6ccf4f4 (diff) | |
download | toolchain_gcc-replicant-6.0-0004-rc4.tar.gz toolchain_gcc-replicant-6.0-0004-rc4.tar.bz2 toolchain_gcc-replicant-6.0-0004-rc4.zip |
Merge remote-tracking branch 'aosp/master' into replicant-6.0HEADreplicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004-rc4replicant-6.0-0004-rc3replicant-6.0-0004-rc2replicant-6.0-0004-rc1replicant-6.0-0004replicant-6.0master
Diffstat (limited to 'update-prebuilts.py')
-rwxr-xr-x | update-prebuilts.py | 54 |
1 files changed, 17 insertions, 37 deletions
diff --git a/update-prebuilts.py b/update-prebuilts.py index 645b1d574..660dee55c 100755 --- a/update-prebuilts.py +++ b/update-prebuilts.py @@ -62,30 +62,18 @@ class ArgParser(argparse.ArgumentParser): help='Override the git commit message.') -def host_to_build_host(host): - """Gets the build host name for an NDK host tag. +def build_target(host, arch): + """Gets the toolchain build target name for the specified host and arch. - The Windows builds are done from Linux. - """ - return { - 'darwin': 'mac', - 'linux': 'linux', - 'windows': 'linux', - }[host] - - -def build_name(host, arch): - """Gets the release build name for an NDK host tag. + The builds targets are named by combining the host and arch values. - The builds are named by a short identifier like "linux" or "win64". + >>> build_target('darwin', 'arm') + 'arm_mac' - >>> build_name('darwin', 'arm') - 'arm' + >>> build_target('darwin', 'aarch64') + 'arm64_mac' - >>> build_name('darwin', 'aarch64') - 'arm64' - - >>> build_name('linux', 'x86') + >>> build_target('linux', 'x86') 'linux_x86' """ build_arch = arch @@ -93,7 +81,7 @@ def build_name(host, arch): build_arch = 'arm64' if host == 'darwin': - return build_arch + return build_arch + '_mac' return host + '_' + build_arch @@ -134,22 +122,14 @@ def download_build(host, arch, build_number, download_dir, dryrun, cachedir): '{}'.format(pkg_name, cachedir)) return cached_pkg - url_base = 'https://android-build-uber.corp.google.com' - path = 'builds/{branch}-{build_host}-{build_name}/{build_num}'.format( - branch=BRANCH, - build_host=host_to_build_host(host), - build_name=build_name(host, arch), - build_num=build_number) - - url = '{}/{}/{}'.format(url_base, path, pkg_name) - TIMEOUT = '60' # In seconds. out_file_path = os.path.join(download_dir, pkg_name) - with open(out_file_path, 'w') as out_file: - print('Downloading {} to {}'.format(url, out_file_path)) - invoke_cmd(dryrun, - ['sso_client', '--location', - '--request_timeout', TIMEOUT, url], - outfile=out_file) + print('Downloading {} to {}'.format(pkg_name, out_file_path)) + invoke_cmd(dryrun, + ['/google/data/ro/projects/android/fetch_artifact', + '--branch={}'.format(BRANCH), + '--bid={}'.format(build_number), + '--target={}'.format(build_target(host, arch)), + pkg_name, out_file_path]) return out_file_path @@ -323,7 +303,7 @@ def main(): try: hosts = ('linux', 'darwin') - arches = ('arm', 'aarch64', 'x86_64', 'mips64') + arches = ('arm', 'aarch64', 'x86_64') for host in hosts: for arch in arches: update_gcc(host, arch, args.build, args.use_current_branch, |