Bug 1275437 - Fixed some offending version checks that were inhereted from the BaseBootstrapper r=gps
authorNathan Hakkakzadeh <nhakkakzadeh@mozilla.com>
Tue, 31 May 2016 11:20:34 -0700
changeset 339509 3952e910a66a8e98b5f3d87a4f0ba614f49ad249
parent 339508 cf30f2236629339e4845df17771b18f652a0ca00
child 339510 b86c7fc1f4bdc5af62b68756d46fa48b7d2a68e6
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 - 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
python/mozboot/mozboot/base.py
python/mozboot/mozboot/windows.py
--- 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)