diff options
author | Per Lundberg <per.lundberg@ecraft.com> | 2016-06-13 20:51:40 +0300 |
---|---|---|
committer | Per Lundberg <per.lundberg@ecraft.com> | 2016-06-14 20:24:06 +0300 |
commit | 22fddac3ad5c1607dd65ea0de327b8fb4437f8af (patch) | |
tree | fda3177c2a20e3a3e64342eca24e92f50f89902a /python/mach_bootstrap.py | |
parent | 08a55e29511a2b26b7ae26ebb0b9271f80e2a7bd (diff) | |
download | servo-22fddac3ad5c1607dd65ea0de327b8fb4437f8af.tar.gz servo-22fddac3ad5c1607dd65ea0de327b8fb4437f8af.zip |
Added detection for case-sensitive file systems
This is needed for the moment because of a bug in virtualenv (reported upstream).
Diffstat (limited to 'python/mach_bootstrap.py')
-rw-r--r-- | python/mach_bootstrap.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index 3314a83d08c..645ae1cf686 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -160,7 +160,22 @@ def _activate_virtualenv(topdir): open(marker_path, 'w').close() +def _ensure_case_insensitive_if_windows(): + # The folder is called 'python'. By deliberately checking for it with the wrong case, we determine if the file + # system is case sensitive or not. + if _is_windows() and not os.path.exists('Python'): + print('Cannot run mach in a path on a case-sensitive file system on Windows.') + print('For more details, see https://github.com/pypa/virtualenv/issues/935') + sys.exit(1) + + +def _is_windows(): + return sys.platform == 'win32' or sys.platform == 'msys' + + def bootstrap(topdir): + _ensure_case_insensitive_if_windows() + topdir = os.path.abspath(topdir) # We don't support paths with Unicode characters for now |