aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-11-16 13:41:27 -0600
committerGitHub <noreply@github.com>2016-11-16 13:41:27 -0600
commit17bf6aed21cb966c52382e7cef23d2bd66144874 (patch)
tree7c9d412d8c1a09f65f54ce3bba1a6ab42ad81a0b /python
parent00f229d615980dbd23612f64b7a60a70b76d3f97 (diff)
parent8e8519d03826042b453e54527aaf3e3646221fec (diff)
downloadservo-17bf6aed21cb966c52382e7cef23d2bd66144874.tar.gz
servo-17bf6aed21cb966c52382e7cef23d2bd66144874.zip
Auto merge of #14039 - metajack:windows-wpt, r=jgraham
Fix test-wpt and test-css for Windows. <!-- Please describe your changes on the following line: --> In addition to minor changes for Windows, this forces Windows Python to be used for all Windows builds (instead of using Windows Python only for pc-windows-msvc builds). --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because testing the tests is too meta for me <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14039) <!-- Reviewable:end -->
Diffstat (limited to 'python')
-rw-r--r--python/mach_bootstrap.py22
-rw-r--r--python/servo/command_base.py5
2 files changed, 19 insertions, 8 deletions
diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py
index bd1f42417ad..c2d35278dae 100644
--- a/python/mach_bootstrap.py
+++ b/python/mach_bootstrap.py
@@ -76,9 +76,16 @@ CATEGORIES = {
}
# Possible names of executables
-PYTHON_NAMES = ["python-2.7", "python2.7", "python2", "python"]
-VIRTUALENV_NAMES = ["virtualenv-2.7", "virtualenv2.7", "virtualenv2", "virtualenv"]
-PIP_NAMES = ["pip-2.7", "pip2.7", "pip2", "pip"]
+# NOTE: Windows Python doesn't provide versioned executables, so we must use
+# the plain names. On MSYS, we still use Windows Python.
+if sys.platform in ['msys', 'win32']:
+ PYTHON_NAMES = ["python"]
+ VIRTUALENV_NAMES = ["virtualenv"]
+ PIP_NAMES = ["pip"]
+else:
+ PYTHON_NAMES = ["python-2.7", "python2.7", "python2", "python"]
+ VIRTUALENV_NAMES = ["virtualenv-2.7", "virtualenv2.7", "virtualenv2", "virtualenv"]
+ PIP_NAMES = ["pip-2.7", "pip2.7", "pip2", "pip"]
def _get_exec_path(names, is_valid_path=lambda _path: True):
@@ -197,10 +204,11 @@ def bootstrap(topdir):
# We don't support MinGW Python
if os.path.join(os.sep, 'mingw64', 'bin') in sys.executable:
- print('Cannot run mach with MinGW Python.')
- print('\nPlease rename following files:')
- print(' /mingw64/bin/python2.exe -> /mingw64/bin/python2-mingw64.exe')
- print(' /mingw64/bin/python2.7.exe -> /mingw64/bin/python2.7-mingw64.exe')
+ print('Cannot run mach with MinGW or MSYS Python.')
+ print('\nPlease add the path to Windows Python (usually /c/Python27) to your path.')
+ print('You can do this by appending the line:')
+ print(' export PATH=/c/Python27:$PATH')
+ print('to your ~/.profile.')
sys.exit(1)
# Ensure we are running Python 2.7+. We put this check here so we generate a
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index c6ea363dd05..a67ea0b208d 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -107,7 +107,10 @@ def host_triple():
elif os_type == "android":
os_type = "linux-androideabi"
elif os_type == "windows":
- os_type = "pc-windows-msvc"
+ if os.getenv("MSYSTEM") is None:
+ os_type = "pc-windows-msvc"
+ else:
+ os_type = "pc-windows-gnu"
elif os_type.startswith("mingw64_nt-") or os_type.startswith("cygwin_nt-"):
os_type = "pc-windows-gnu"
elif os_type == "freebsd":