From 37ea997ca4e74360bfa31748c0e3b408b85591e3 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 28 Oct 2021 11:13:10 -0400 Subject: [PATCH] Fix "meson compile" not activating vsenv setup_vsenv() was not propagating the return value, so build.need_vsenv was always False. --- mesonbuild/mesonlib/vsenv.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesonbuild/mesonlib/vsenv.py b/mesonbuild/mesonlib/vsenv.py index 0d69d9a9b..2ba2b90bb 100644 --- a/mesonbuild/mesonlib/vsenv.py +++ b/mesonbuild/mesonlib/vsenv.py @@ -97,10 +97,11 @@ def _setup_vsenv(force: bool) -> bool: os.environ[k] = v return True -def setup_vsenv(force: bool = False): +def setup_vsenv(force: bool = False) -> bool: try: - _setup_vsenv(force) + return _setup_vsenv(force) except MesonException as e: if force: raise mlog.warning('Failed to activate VS environment:', str(e)) + return False