From 08875d976f14a5c589c1cfcd17614adad06e43d4 Mon Sep 17 00:00:00 2001 From: Rahul Chaudhry Date: Mon, 18 Sep 2017 10:37:34 -0700 Subject: update-prebuilts: do not update mips prebuilts. The aosp-gcc builder has stopped building the toolchain for mips. Bug: None Test: None Change-Id: Ia3bf3a41b2d0e098efd6e8c526b81f6ef2b1beb0 --- update-prebuilts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'update-prebuilts.py') diff --git a/update-prebuilts.py b/update-prebuilts.py index 645b1d574..1a2f405ef 100755 --- a/update-prebuilts.py +++ b/update-prebuilts.py @@ -323,7 +323,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, -- cgit v1.2.3 From dca601e5d2b032ac5cca1df90ac56077ccf5d665 Mon Sep 17 00:00:00 2001 From: Rahul Chaudhry Date: Mon, 18 Sep 2017 10:45:53 -0700 Subject: update-prebuilts: use fetch_artifact for downloading prebuilts. The old method of constructing a URL and downloading using sso_client has stopped working since the URLs have changed. Using fetch_artifact makes this step more robust against future changes in URL schemes. Bug: 37683243 Test: './update-prebuilts.py 4342532' works. Change-Id: I14053709bb9839990e8cf59418010862daf09236 --- update-prebuilts.py | 52 ++++++++++++++++------------------------------------ 1 file changed, 16 insertions(+), 36 deletions(-) (limited to 'update-prebuilts.py') diff --git a/update-prebuilts.py b/update-prebuilts.py index 1a2f405ef..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 -- cgit v1.2.3