Bug 1275437 - Windows bootstrapper installs necessary system and browser packages that come from pacman. r=gps
authorNathan Hakkakzadeh <nhakkakzadeh@mozilla.com>
Thu, 26 May 2016 09:53:14 -0700
changeset 339507 3c18f97878791c4eb73cddbefd1102c7c1a270bd
parent 339506 b12e09309b96a2ea15b560317cd63a388788a27a
child 339508 cf30f2236629339e4845df17771b18f652a0ca00
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1275437
milestone49.0a1
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 1275437 - Windows bootstrapper installs necessary system and browser packages that come from pacman. r=gps Windows bootstrapper checks if pacman is installed before continuing. Added a convenience method similar to BaseBootstrapper.which that works with the mingw version of python in msys2. MozReview-Commit-ID: 6AG2c18KF0U
python/mozboot/mozboot/windows.py
--- a/python/mozboot/mozboot/windows.py
+++ b/python/mozboot/mozboot/windows.py
@@ -5,24 +5,67 @@
 import os
 import sys
 import subprocess
 
 from mozboot.base import BaseBootstrapper
 
 class WindowsBootstrapper(BaseBootstrapper):
     '''Bootstrapper for msys2 based environments for building in Windows.'''
+
+    SYSTEM_PACKAGES = [
+        'mingw-w64-x86_64-make',
+        'mingw-w64-x86_64-python2',
+        'mingw-w64-x86_64-python2-pip',
+        'mingw-w64-x86_64-perl',
+        'patch',
+        'patchutils',
+        'diffutils',
+        'autoconf2.13',
+        'tar',
+        'zip',
+        'unzip',
+        'mingw-w64-x86_64-toolchain', # TODO: Should be removed when Mercurial is installable from a wheel.
+        'mingw-w64-i686-toolchain'
+    ]
+
+    BROWSER_PACKAGES = [
+        'mingw-w64-x86_64-yasm',
+        'mingw-w64-i686-nsis'
+    ]
+
+    MOBILE_ANDROID_COMMON_PACKAGES = [
+        'wget'
+    ]
+
     def __init__(self, **kwargs):
         if 'MOZ_WINDOWS_BOOTSTRAP' not in os.environ or os.environ['MOZ_WINDOWS_BOOTSTRAP'] != '1':
             raise NotImplementedError('Bootstrap support for Windows is under development. For now, use MozillaBuild '
                                       'to set up a build environment on Windows. If you are testing Windows Bootstrap support, '
                                       'try `export MOZ_WINDOWS_BOOTSTRAP=1`')
         BaseBootstrapper.__init__(self, **kwargs)
-        raise NotImplementedError('Bootstrap support is not yet available for Windows. '
-                                  'For now, use MozillaBuild to set up a build environment on Windows.')
+        if not self.which('pacman.exe'):
+            raise NotImplementedError('The Windows bootstrapper only works with msys2 with pacman. Get msys2 at '
+                                      'http://msys2.github.io/')
+        print 'Using an experimental bootstrapper for Windows.'
+
+    def install_system_packages(self):
+        self.pacman_install(*self.SYSTEM_PACKAGES)
+
+    def install_browser_packages(self):
+        self.pacman_install(*self.BROWSER_PACKAGES)
+
+    def install_mobile_android_packages(self):
+        raise NotImplementedError('We do not support building Android on Windows. Sorry!')
+
+    def install_mobile_android_artifact_mode_packages(self):
+        raise NotImplementedError('We do not support building Android on Windows. Sorry!')
+
+    def _update_package_manager(self):
+        self.pacman_update()
 
     def run(self, command):
         subprocess.check_call(command, stdin=sys.stdin)
 
     def pacman_update(self):
         command = ['pacman', '--sync', '--refresh']
         self.run(command)