Bug 1100925 - bin_path method of virtualenv.py in mozbuild now accurately detects if virtualenv is in a windows system. r?gps
Before bin_path would detect msys2 as if it were a windows system which would cause a virtualenv problem since the binaries should go in a /bin folder not a /Scripts folder for msys2.
Based on a patch by :vlad https://github.com/vvuk/mc-hg/commit/89b21efe938af375f8f7971e7e3bb2aa0ecbde2a
MozReview-Commit-ID: IyAukszHGmN
--- a/python/mozbuild/mozbuild/virtualenv.py
+++ b/python/mozbuild/mozbuild/virtualenv.py
@@ -11,16 +11,19 @@ import distutils.sysconfig
import os
import shutil
import subprocess
import sys
import warnings
from distutils.version import LooseVersion
+IS_NATIVE_WIN = (sys.platform == 'win32' and os.sep == '\\')
+IS_MSYS2 = (sys.platform == 'win32' and os.sep == '/')
+IS_CYGWIN = (sys.platform == 'cygwin')
# Minimum version of Python required to build.
MINIMUM_PYTHON_VERSION = LooseVersion('2.7.3')
MINIMUM_PYTHON_MAJOR = 2
UPGRADE_WINDOWS = '''
Please upgrade to the latest MozillaBuild development environment. See
@@ -67,17 +70,17 @@ class VirtualenvManager(object):
'virtualenv.py')
@property
def bin_path(self):
# virtualenv.py provides a similar API via path_locations(). However,
# we have a bit of a chicken-and-egg problem and can't reliably
# import virtualenv. The functionality is trivial, so just implement
# it here.
- if sys.platform in ('win32', 'cygwin'):
+ if IS_CYGWIN or IS_NATIVE_WIN:
return os.path.join(self.virtualenv_root, 'Scripts')
return os.path.join(self.virtualenv_root, 'bin')
@property
def python_path(self):
binary = 'python'
if sys.platform in ('win32', 'cygwin'):