Commit Graph

23 Commits

Author SHA1 Message Date
Xavier Claessens 302a29593a devenv: Always include env for HOST machine
Cross compiled executables could still be run with an exe wrapper, or
with proper binfmt installed.

Fixes: #10999
2022-12-07 11:58:36 -05:00
Xavier Claessens b926374205 devenv: Do not include system values in --dump
This makes --dump print variables like `FOO=/path:$FOO:/another/path`.
2022-12-07 11:58:35 -05:00
Xavier Claessens bc2f1fb2f3 devenv: Add more info how to get gdb scripts working
Now that top builddir is not the default workdir any more, the .gdbinit
file we write there won't be loaded automatically unless user cd there,
or use --init-command. There is also a global setting that user has to
set to allow automatically loading .gdbinit file.
2022-12-06 07:59:48 -05:00
Xavier Claessens 3e7433086c devenv: Add --workdir option
Most of the time it is preferable to remain the the top source dir
instead of going into the builddir. Add --workdir argument to be able to
have a different workdir than builddir, but keep it default to builddir
for backward compatibility, and also because it makes gdb integration
better.
2022-12-06 07:59:48 -05:00
Eli Schwartz 50f35039e7
devenv: avoid overwriting internal variables of the global argparse
We already use options.command for the subcommand in use, in this case
devenv. We cannot reuse that variable name for the list of words to
execute inside the devenv.
2022-11-30 15:40:31 -05:00
Xavier Claessens 31a6633e62 mdevenv: powershell <7.0 is EOL, prefer using pwsh.exe
If neither pwsh.exe nor powershell.exe works, fallback to cmd.exe. This
script could be failing because of virus scanner.
2022-09-21 18:32:51 -04:00
Xavier Claessens 7e4188a53f devenv: Resolve executable in devenv's PATH
Fixes: #10815
2022-09-15 10:04:59 -04:00
Xavier Claessens a693e2d091 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.
2022-06-17 11:53:38 -04:00
Xavier Claessens 57909b53d6 Improve WINEPATH reduction
- Remove duplicated code in mdevenv.py
- Change the limit to 1024 instead of 2048 which is what has been
  tested.
- Skip shortening if it is already short enough.
- Skip shortening with wine >= 6.4 which does not seems to have that
  limitation any more.
- Downgrade exception to warning in the case WINEPATH cannot be
  shortened under 1024 chars, it is possible that it will still work.
2022-06-17 11:53:38 -04:00
Seungha Yang ee7a7fec10 devenv: Add support for PowerShell 7 on Windows
Checks "pwsh.exe" in addition to "powershell.exe" and "cmd.exe"
to support PowerShell 7 on Windows. The Powershell 7 support was added
in GStreamer (which is the origin of this script) already via
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2545
2022-06-14 19:09:25 -04:00
Eli Schwartz 16ed82a62f flake8: remove unused variable 2022-06-13 13:34:39 +03:00
Eli Schwartz 3e2dba5b7c devenv: do not fatally error if pkg-config or bash-completion is not available
We might be using all fallbacks, or be super weird and not use
bash-completion, or simply have a different PKG_CONFIG_LIBDIR set. And
devenv already checks whether the dependency is found, but defaults to
required anyway, which is wrong.
2022-06-03 06:42:58 -04:00
Xavier Claessens f9200ca8f7 devenv: Set WINEPATH when cross compiling for Windows 2022-05-06 23:04:11 +03:00
Xavier Claessens 5a34dcedf7 devenv: Use PkgConfigDependency.get_env()
This ensures that PKG_CONFIG_PATH, PKG_CONFIG_LIBDIR and
PKG_CONFIG_SYSROOT_DIR are also set properly.
2022-05-04 00:16:32 +03:00
Xavier Claessens 2eb730f3ac devenv: Catch FileNotFoundError
Fixes: #10310
2022-04-30 11:47:25 +03:00
Xavier Claessens 24f224777d devenv: Add --dump option
It prints all envorinmente variables that have been modified. Can be
used by shell scripts that wish to setup their environment themself.
2022-02-28 09:03:27 -05:00
Xavier Claessens 30cdb2a280 devenv: Setup GDB auto-load scripts
When the project instals GDB helper scripts, copy them into
meson-private directory with the right tree layout and write a .gdbinit
script to load them automatically.
2022-02-28 09:03:27 -05:00
Xavier Claessens 6fafeb13b3 devenv: Source bash completion scripts 2022-02-28 09:03:27 -05:00
Christoph Reiter 5d64a15be7 devenv: support bash under MSYS2 by default
Currently it tries to run "cmd" by default in a MSYS2 bash.
Passing "bash" doesn't work since that defaults to WSL and
one has to pass an absolute path to bash instead, and even then
one misses out on the PS1 override.

In case $SHELL is set and the contained path exists prefer it even if
we are on Windows.

To make the PS1 override work we can't use Unix paths in Python since
we might be on Windows, so move the .bashrc check into the temporary
bash script itself.

This makes "meson devenv" work the same under MSYS2 as on Linux.
2022-02-20 14:25:18 +02:00
Xavier Claessens 928078982c Add --vsenv command line option and active VS only when needed 2021-10-10 23:15:18 +03:00
Paolo Bonzini 5215f4fa98 cleanup self.options.wd
It is never None and always an absolute path
2021-07-07 18:00:37 +02:00
Paolo Bonzini b44a51d0fd resolve symlinks passed to -C
"meson setup" is resolving symlinks for the build directory in
validate_core_dirs.  For consistency with it, do the same when
the build directory is passed via -C to devenv, dist, init, install
and test.

This ensures for example that the path to test dependencies is
computed correctly in "meson test".

Fixes: #8765
2021-07-07 18:00:37 +02:00
Xavier Claessens 598e968993 Add `meson devenv` command and meson.add_devenv() 2021-03-16 09:00:50 -04:00