Bug 1545968 - Update repack_rust.py to include rust stdlib src and analysis data. r=glandium
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 14 May 2019 17:30:55 +0000
changeset 532630 f1ace2853a4c8e42c77eea943f2938147a111118
parent 532629 01fcbba06f1c5a79a6881c4a4378b0bd2476e22e
child 532631 f17162f343b657c6ac2f57937ff49a1840465a6b
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1545968 - Update repack_rust.py to include rust stdlib src and analysis data. r=glandium This makes the rust toolchain artifacts contain the rust stdlib as well, for use by searchfox. It does bring up the size of the toolchain artifact slightly - rustc.tar.xz file for the Linux/rust 1.34 job for example goes from 270483672 bytes to 273803148 bytes (1.23% larger) and the equivalent android tarball goes from 230503888 to 235698736 bytes (2.25% larger). Differential Revision: https://phabricator.services.mozilla.com/D28282
--- a/taskcluster/scripts/misc/repack_rust.py
+++ b/taskcluster/scripts/misc/repack_rust.py
@@ -200,17 +200,22 @@ def install(filename, target):
     log('Cleaning %s...' % basename)
 def package(manifest, pkg, target):
     '''Pull out the package dict for a particular package and target
     from the given manifest.'''
     version = manifest['pkg'][pkg]['version']
-    info = manifest['pkg'][pkg]['target'][target]
+    if target in manifest['pkg'][pkg]['target']:
+        info = manifest['pkg'][pkg]['target'][target]
+    else:
+        # rust-src is the same for all targets, and has a literal '*' in the
+        # section key/name instead of a target
+        info = manifest['pkg'][pkg]['target']['*']
     return (version, info)
 def fetch_package(manifest, pkg, host):
     version, info = package(manifest, pkg, host)
     log('%s %s\n  %s\n  %s' % (pkg, version, info['url'], info['hash']))
     if not info['available']:
         log('%s marked unavailable for %s' % (pkg, host))
@@ -221,18 +226,18 @@ def fetch_package(manifest, pkg, host):
             '\n  %s' % sha)
         raise AssertionError
     return info
 def fetch_std(manifest, targets):
     stds = []
     for target in targets:
-        info = fetch_package(manifest, 'rust-std', target)
-        stds.append(info)
+        stds.append(fetch_package(manifest, 'rust-std', target))
+        stds.append(fetch_package(manifest, 'rust-analysis', target))
     return stds
 def fetch_optional(manifest, pkg, host):
         return fetch_package(manifest, pkg, host)
     except KeyError:
         # The package is not available, oh well!
@@ -273,28 +278,30 @@ def repack(host, targets, channel='stabl
         cargo_manifest = fetch_manifest(cargo_channel)
         log('Using manifest for cargo %s as of %s.' %
             (cargo_channel, cargo_manifest['date']))
     log('Fetching packages...')
     rustc = fetch_package(manifest, 'rustc', host)
     cargo = fetch_package(cargo_manifest, 'cargo', host)
     stds = fetch_std(manifest, targets)
+    rustsrc = fetch_package(manifest, 'rust-src', host)
     rustfmt = fetch_optional(manifest, 'rustfmt-preview', host)
     log('Installing packages...')
     install_dir = 'rustc'
     # Clear any previous install directory.
     except OSError as e:
         if e.errno != errno.ENOENT:
     install(os.path.basename(rustc['url']), install_dir)
     install(os.path.basename(cargo['url']), install_dir)
+    install(os.path.basename(rustsrc['url']), install_dir)
     if rustfmt:
         install(os.path.basename(rustfmt['url']), install_dir)
     for std in stds:
         install(os.path.basename(std['url']), install_dir)
     log('Creating archive...')
     tar_options, tar_ext = tar_for_host(host)