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
--- 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.')