Bug 1336155 - Update rust repack script for 1.15.0 stable. r=mshal draft
authorRalph Giles <giles@mozilla.com>
Thu, 02 Feb 2017 11:02:41 -0800
changeset 480969 c152aac7d0b649cd891a81f7ed3291ea2761cd82
parent 480952 f505911eb333d5ae8c2bf5c44f7b85add6450b53
child 480970 71b1c41b082d70414161b9d4a554c13d5ce0d4a4
push id44677
push userbmo:giles@thaumas.net
push dateThu, 09 Feb 2017 01:49:20 +0000
reviewersmshal
bugs1336155, 1332759
milestone54.0a1
Bug 1336155 - Update rust repack script for 1.15.0 stable. r=mshal Revert the bump to beta for the android builders now that 1.15.0 is in stable release. Generalize the cargo tarball name mangling to use a regular expression to hand the tiny revision added for the stable release, as suggested by mshal in bug 1332759. MozReview-Commit-ID: 2xZWpvKxY77
taskcluster/docker/rust-build/repack_rust.py
--- a/taskcluster/docker/rust-build/repack_rust.py
+++ b/taskcluster/docker/rust-build/repack_rust.py
@@ -1,16 +1,17 @@
 #!/bin/env python
 '''
 This script downloads and repacks official rust language builds
 with the necessary tool and target support for the Firefox
 build environment.
 '''
 
 import os.path
+import re
 import sys
 
 import requests
 import subprocess
 import toml
 
 
 def fetch_file(url):
@@ -54,17 +55,17 @@ def fetch(url):
 
 def install(filename, target):
     '''Run a package's installer script against the given target directory.'''
     print(' Unpacking %s...' % filename)
     subprocess.check_call(['tar', 'xf', filename])
     basename = filename.split('.tar')[0]
     # Work around bad tarball naming in 1.15 cargo packages.
     basename = basename.replace('cargo-beta', 'cargo-nightly')
-    basename = basename.replace('cargo-0.16', 'cargo-nightly')
+    basename = re.sub(r'cargo-0\.[\d\.]+', 'cargo-nightly', basename)
     print(' Installing %s...' % basename)
     install_cmd = [os.path.join(basename, 'install.sh')]
     install_cmd += ['--prefix=' + os.path.abspath(target)]
     install_cmd += ['--disable-ldconfig']
     subprocess.check_call(install_cmd)
     print(' Cleaning %s...' % basename)
     subprocess.check_call(['rm', '-rf', basename])
 
@@ -193,9 +194,9 @@ win64 = "x86_64-pc-windows-msvc"
 win32 = "i686-pc-windows-msvc"
 
 if __name__ == '__main__':
     repack(mac64, [mac64, mac32])
     repack(win32, [win32])
     repack(win64, [win64])
     repack(linux64, [linux64, linux32])
     repack(linux64, [linux64, mac64, mac32], suffix='mac-cross')
-    repack(linux64, [linux64, android, android_x86], channel='beta', suffix='android-cross')
+    repack(linux64, [linux64, android, android_x86], suffix='android-cross')