aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-06-17 08:49:06 -0400
committerXavier Claessens <xclaesse@gmail.com>2022-06-17 11:53:38 -0400
commita693e2d09164408b962aec91cba4a1318abf8a89 (patch)
tree9c2c0e3ccd79b837a8fdfd1ee72b9a8326771469
parent57909b53d6d2099e45873688b659ce071f6039ef (diff)
downloadmeson-a693e2d09164408b962aec91cba4a1318abf8a89.zip
meson-a693e2d09164408b962aec91cba4a1318abf8a89.tar.gz
meson-a693e2d09164408b962aec91cba4a1318abf8a89.tar.bz2
devenv: Do not use relative WINEPATH
It forces launching executables from the top builddir which users might not expect and creates hard to understand issues.
-rw-r--r--mesonbuild/mdevenv.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/mdevenv.py b/mesonbuild/mdevenv.py
index d0e84ff..67ea700 100644
--- a/mesonbuild/mdevenv.py
+++ b/mesonbuild/mdevenv.py
@@ -28,17 +28,17 @@ def get_windows_shell() -> str:
result = subprocess.check_output(command)
return result.decode().strip()
-def reduce_winepath(build_dir: str, env: T.Dict[str, str]) -> None:
+def reduce_winepath(env: T.Dict[str, str]) -> None:
winepath = env.get('WINEPATH')
if not winepath:
return
winecmd = shutil.which('wine64') or shutil.which('wine')
if not winecmd:
return
- env['WINEPATH'] = get_wine_shortpath([winecmd], winepath.split(';'), build_dir)
+ env['WINEPATH'] = get_wine_shortpath([winecmd], winepath.split(';'))
mlog.log('Meson detected wine and has set WINEPATH accordingly')
-def get_env(b: build.Build, build_dir: str) -> T.Tuple[T.Dict[str, str], T.Set[str]]:
+def get_env(b: build.Build) -> T.Tuple[T.Dict[str, str], T.Set[str]]:
extra_env = build.EnvironmentVariables()
extra_env.set('MESON_DEVENV', ['1'])
extra_env.set('MESON_PROJECT_NAME', [b.project_name])
@@ -49,7 +49,7 @@ def get_env(b: build.Build, build_dir: str) -> T.Tuple[T.Dict[str, str], T.Set[s
env = i.get_env(env)
varnames |= i.get_names()
- reduce_winepath(build_dir, env)
+ reduce_winepath(env)
return env, varnames
@@ -122,7 +122,7 @@ def run(options: argparse.Namespace) -> int:
raise MesonException(f'Directory {options.wd!r} does not seem to be a Meson build directory.')
b = build.load(options.wd)
- devenv, varnames = get_env(b, options.wd)
+ devenv, varnames = get_env(b)
if options.dump:
if options.command:
raise MesonException('--dump option does not allow running other command.')