From 70682c23060b44301f66a908934bd3af183833f7 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Mon, 27 Jun 2016 12:13:45 -0500 Subject: [PATCH] servo: Merge #11740 - Added detection for case-sensitive file systems (from perlun:detect-case-sensitive-file-system); r=metajack - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because they only change Mach code This is needed for the moment because of a bug in virtualenv (reported upstream). r? @metajack (you were the one who suggested that we check this. I did it in a slightly simpler way since I realized we over-complicated things a bit when talking about it the other day.) Source-Repo: https://github.com/servo/servo Source-Revision: 887376b225d1969b04b8893afffaa4d65ea6ba1a --- servo/python/mach_bootstrap.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/servo/python/mach_bootstrap.py b/servo/python/mach_bootstrap.py index 3314a83d08c1..645ae1cf686d 100644 --- a/servo/python/mach_bootstrap.py +++ b/servo/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