Bug 1324435 - mozboot: Install rust i686-msvc target. r?ted draft
authorRalph Giles <giles@mozilla.com>
Wed, 11 Jan 2017 10:19:28 -0800
changeset 463335 aaf2765c8146b0d720cff7b187d8715f36be73d3
parent 463334 70df7bbb9e1faf0b8fcda6657e7358f8a5e9161c
child 463336 346dba5efaaab6d00e3145494947155a970f9c82
child 463337 1cfa9572d32fa08797d9e439ef0135b7ce542e47
push id42029
push userbmo:giles@thaumas.net
push dateWed, 18 Jan 2017 21:47:35 +0000
reviewersted
bugs1324435
milestone53.0a1
Bug 1324435 - mozboot: Install rust i686-msvc target. r?ted Windows devs often want to target 32-bit windows. Make this easier by installing the target for them at mozboot time. MozReview-Commit-ID: 6gFbFBOqMz8
python/mozboot/mozboot/mozillabuild.py
--- a/python/mozboot/mozboot/mozillabuild.py
+++ b/python/mozboot/mozboot/mozillabuild.py
@@ -34,16 +34,19 @@ class MozillaBuildBootstrapper(BaseBoots
 
             with open(mozillabuild_dir + 'msys/etc/profile.d/profile-rustup.sh', 'wb') as f:
                 f.write('#!/bash/sh\n')
                 f.write('if test -n "$MOZILLABUILD"; then\n')
                 f.write('    WIN_HOME=$(command cd "$HOME" && pwd)\n')
                 f.write('    PATH="$WIN_HOME/.cargo/bin:$PATH"\n')
                 f.write('    export PATH\n')
                 f.write('fi')
+            _, cargo_bin = self.cargo_home()
+            rustup = os.path.join(cargo_bin, 'rustup')
+            self.run([rustup, 'target', 'add', 'i686-pc-windows-msvc'])
         finally:
             try:
                 os.remove(rustup_init)
             except FileNotFoundError:
                 pass
 
     def upgrade_mercurial(self, current):
         self.pip_install('mercurial')