Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on windows when default python is MSYS64 python #9408

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix build on windows when default python is MSYS64 python

  • Loading branch information
adamncasey committed Jan 23, 2016
commit 25b0ee22f2ba8a419d528bc875d17a9776375cb3
@@ -80,6 +80,13 @@ def _get_exec(*names):
return None


def _get_virtualenv_script_dir():
# Virtualenv calls its scripts folder "bin" on linux/OSX/MSYS64 but "Scripts" on Windows
if os.name == "nt" and os.path.sep != "/":
return "Scripts"
return "bin"


# Possible names of executables, sorted from most to least specific
PYTHON_NAMES = ["python-2.7", "python2.7", "python2", "python"]
VIRTUALENV_NAMES = ["virtualenv-2.7", "virtualenv2.7", "virtualenv2", "virtualenv"]
@@ -92,8 +99,7 @@ def _activate_virtualenv(topdir):
if python is None:
sys.exit("Python is not installed. Please install it prior to running mach.")

# Virtualenv calls its scripts folder "bin" on linux/OSX but "Scripts" on Windows, detect which one then use that
script_dir = "Scripts" if os.name == "nt" else "bin"
script_dir = _get_virtualenv_script_dir()
activate_path = os.path.join(virtualenv_path, script_dir, "activate_this.py")
if not (os.path.exists(virtualenv_path) and os.path.exists(activate_path)):
virtualenv = _get_exec(*VIRTUALENV_NAMES)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.