Bug 1508184 - Don't try to set the active python during bootstrap if not necessary r=gps
authorPanos Astithas <past@mozilla.com>
Fri, 30 Nov 2018 00:25:48 +0000
changeset 505316 305c06df7740f4b2393c53dae175f0d199f3e30b
parent 505315 1e64f8c3f949bb16b4981f255033021b42118586
child 505317 2b8cf5fe84e5d21c678131290d06da9cf3fa6aae
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1508184
milestone65.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 1508184 - Don't try to set the active python during bootstrap if not necessary r=gps Differential Revision: https://phabricator.services.mozilla.com/D12237
python/mozboot/mozboot/osx.py
--- a/python/mozboot/mozboot/osx.py
+++ b/python/mozboot/mozboot/osx.py
@@ -405,17 +405,26 @@ class OSXBootstrapper(BaseBootstrapper):
             'mercurial',
             'autoconf213',
             'gnutar',
             'watchman',
             'nodejs8'
         ]
 
         self._ensure_macports_packages(packages)
-        self.run_as_root([self.port, 'select', '--set', 'python', 'python27'])
+
+        pythons = set(self.check_output([self.port, 'select', '--list', 'python']).split('\n'))
+        active = ''
+        for python in pythons:
+            if 'active' in python:
+                active = python
+        if 'python27' not in active:
+            self.run_as_root([self.port, 'select', '--set', 'python', 'python27'])
+        else:
+            print('The right python version is already active.')
 
     def ensure_macports_browser_packages(self, artifact_mode=False):
         # TODO: Figure out what not to install for artifact mode
         packages = [
             'nasm',
             'yasm',
             'llvm-7.0',
             'clang-7.0',