Bug 1275437 - Fixed some offending version checks that were inhereted from the BaseBootstrapper r?gps
Overrode BaseBootstrapper.which to append '.exe' to any which checks since (hopefully) anything the bootstrapper looks for, must be a windows executable.
Changed base bootstrapper class to use str instead of unicode to avoid a bug in the MinGW version of Python where subprocces.Popen will not accept environment variables that are in unicode instead of str.
MozReview-Commit-ID: 4m8xNifawYS
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -294,17 +294,18 @@ class BaseBootstrapper(object):
def _hgplain_env(self):
""" Returns a copy of the current environment updated with the HGPLAIN
environment variable.
HGPLAIN prevents Mercurial from applying locale variations to the output
making it suitable for use in scripts.
"""
env = os.environ.copy()
- env['HGPLAIN'] = '1'
+ env[b'HGPLAIN'] = b'1'
+
return env
def is_mercurial_modern(self):
hg = self.which('hg')
if not hg:
print(NO_MERCURIAL)
return False, False, None
--- a/python/mozboot/mozboot/windows.py
+++ b/python/mozboot/mozboot/windows.py
@@ -37,21 +37,24 @@ class WindowsBootstrapper(BaseBootstrapp
]
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)
- if not self.which('pacman.exe'):
+ if not self.which('pacman'):
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 which(self, name):
+ return BaseBootstrapper.which(self, name + '.exe')
+
def install_system_packages(self):
self.pacman_install(*self.SYSTEM_PACKAGES)
def upgrade_mercurial(self, current):
self.pip_install('mercurial')
def install_browser_packages(self):
self.pacman_install(*self.BROWSER_PACKAGES)