Bug 1275437 - Added placeholder for Windows bootstrapper. r=gps
authorNathan Hakkakzadeh <nhakkakzadeh@mozilla.com>
Wed, 25 May 2016 16:32:09 -0700
changeset 341518 f4e2ff34312b8104fe96e07af43b23cbce3c3f73
parent 341517 403728f309ce77168d47d67e69e41aad284aabbd
child 341519 b12e09309b96a2ea15b560317cd63a388788a27a
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [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 - Added placeholder for Windows bootstrapper. r=gps Created a WindowsBootstrapper class that raises a NotImplementedError when initialized. As WindowsBootstrapper is implemented, set $MOZ_WINDOWS_BOOTSTRAP to '1' in your environment to test it. Bootstrapper now detects if the system is being run on Windows, and if it is dispatches to the WindowsBootstrapper. MozReview-Commit-ID: 3x6PDPuLtzs
python/mozboot/mozboot/bootstrap.py
python/mozboot/mozboot/windows.py
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -13,16 +13,17 @@ import os.path
 # list in bin/bootstrap.py!
 from mozboot.centosfedora import CentOSFedoraBootstrapper
 from mozboot.debian import DebianBootstrapper
 from mozboot.freebsd import FreeBSDBootstrapper
 from mozboot.gentoo import GentooBootstrapper
 from mozboot.osx import OSXBootstrapper
 from mozboot.openbsd import OpenBSDBootstrapper
 from mozboot.archlinux import ArchlinuxBootstrapper
+from mozboot.windows import WindowsBootstrapper
 
 APPLICATION_CHOICE = '''
 Please choose the version of Firefox you want to build:
 %s
 
 Note: (For Firefox for Android)
 
 The Firefox for Android front-end is built using Java, the Android
@@ -134,16 +135,19 @@ class Bootstrapper(object):
             args['version'] = platform.uname()[2]
 
         elif sys.platform.startswith('dragonfly') or \
                 sys.platform.startswith('freebsd'):
             cls = FreeBSDBootstrapper
             args['version'] = platform.release()
             args['flavor'] = platform.system()
 
+        elif sys.platform.startswith('win32') or sys.platform.startswith('msys'):
+            cls = WindowsBootstrapper
+
         if cls is None:
             raise NotImplementedError('Bootstrap support is not yet available '
                                       'for your OS.')
 
         self.instance = cls(**args)
 
     def bootstrap(self):
         if self.choice is None:
new file mode 100644
--- /dev/null
+++ b/python/mozboot/mozboot/windows.py
@@ -0,0 +1,18 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os
+
+from mozboot.base import BaseBootstrapper
+
+class WindowsBootstrapper(BaseBootstrapper):
+    '''Bootstrapper for msys2 based environments for building in Windows.'''
+    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.')