aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-06-03 15:00:53 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-03 18:59:24 +0000
commit107e061506fb0e8f2783ba07de7f6ce79634688b (patch)
treea41f26a6e978234d8b14091fabe330399477a6f5 /mesonbuild/environment.py
parentfbc716021444e8e37f2c2dbf539b58fefb0d2b5b (diff)
downloadmeson-107e061506fb0e8f2783ba07de7f6ce79634688b.zip
meson-107e061506fb0e8f2783ba07de7f6ce79634688b.tar.gz
meson-107e061506fb0e8f2783ba07de7f6ce79634688b.tar.bz2
Error out when someone tries to use msys/python to run Meson
This mistake seems to be a very common hiccup for people trying to use Meson with MSYS2 on Windows from git or with pip. msys/python uses POSIX paths with '/' as the root instead of a drive like `C:/`, and also does not identify the platform as Windows. This means that configure checks will be wrong, and many build tools will be unable to parse the paths that are returned by functions in Python such as shutil.which. Closes https://github.com/mesonbuild/meson/issues/3653
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 4bcffbd..2522892 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -240,6 +240,11 @@ def detect_system():
return 'cygwin'
return system
+def detect_msys2_arch():
+ if 'MSYSTEM_CARCH' in os.environ:
+ return os.environ['MSYSTEM_CARCH']
+ return None
+
def search_version(text):
# Usually of the type 4.1.4 but compiler output may contain
# stuff like this: