aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mdevenv.py
AgeCommit message (Collapse)AuthorFilesLines
2023-03-29Make --vsenv a readonly builtin optionXavier Claessens1-1/+2
We need to remember its value when reconfiguring, but the Build object is not reused, only coredata is. This also makes CLI more consistent by allowing `-Dvsenv=true` syntax. Fixes: #11309
2023-02-01treewide: add future annotations importEli Schwartz1-0/+2
2023-01-20devenv should import env vars from vsenvCharles Brunet1-2/+1
2023-01-18devenv: Allow dumping into file and select a formatXavier Claessens1-9/+23
It is often more useful to generate shell script than dumping to stdout. It is also important to be able to select the shell format. Formats currently implemented: - sh: Basic VAR=prepend_value:$VAR - export: Same as 'sh', but also export VAR - vscode: Same as 'sh', but without substitutions because they don't seems to work. To be used in launch.json's envFile.
2022-12-07devenv: Set QEMU_LD_PREFIX to sys_rootXavier Claessens1-1/+6
When the cross file has a sys_root, it is most probably needed to run executables with qemu.
2022-12-07devenv: Always include env for HOST machineXavier Claessens1-0/+8
Cross compiled executables could still be run with an exe wrapper, or with proper binfmt installed. Fixes: #10999
2022-12-07devenv: Do not include system values in --dumpXavier Claessens1-6/+6
This makes --dump print variables like `FOO=/path:$FOO:/another/path`.
2022-12-06devenv: Add more info how to get gdb scripts workingXavier Claessens1-3/+12
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-06devenv: Add --workdir optionXavier Claessens1-7/+10
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-11-30devenv: avoid overwriting internal variables of the global argparseEli Schwartz1-3/+3
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-09-21mdevenv: powershell <7.0 is EOL, prefer using pwsh.exeXavier Claessens1-5/+14
If neither pwsh.exe nor powershell.exe works, fallback to cmd.exe. This script could be failing because of virus scanner.
2022-09-15devenv: Resolve executable in devenv's PATHXavier Claessens1-0/+4
Fixes: #10815
2022-06-17devenv: Do not use relative WINEPATHXavier Claessens1-5/+5
It forces launching executables from the top builddir which users might not expect and creates hard to understand issues.
2022-06-17Improve WINEPATH reductionXavier Claessens1-42/+2
- 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-14devenv: Add support for PowerShell 7 on WindowsSeungha Yang1-3/+2
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-13flake8: remove unused variableEli Schwartz1-1/+1
2022-06-03devenv: do not fatally error if pkg-config or bash-completion is not availableEli Schwartz1-1/+1
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-05-06devenv: Set WINEPATH when cross compiling for WindowsXavier Claessens1-0/+52
2022-05-04devenv: Use PkgConfigDependency.get_env()Xavier Claessens1-4/+0
This ensures that PKG_CONFIG_PATH, PKG_CONFIG_LIBDIR and PKG_CONFIG_SYSROOT_DIR are also set properly.
2022-04-30devenv: Catch FileNotFoundErrorXavier Claessens1-0/+2
Fixes: #10310
2022-02-28devenv: Add --dump optionXavier Claessens1-11/+25
It prints all envorinmente variables that have been modified. Can be used by shell scripts that wish to setup their environment themself.
2022-02-28devenv: Setup GDB auto-load scriptsXavier Claessens1-2/+50
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-28devenv: Source bash completion scriptsXavier Claessens1-5/+29
2022-02-20devenv: support bash under MSYS2 by defaultChristoph Reiter1-4/+6
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.
2021-10-10Add --vsenv command line option and active VS only when neededXavier Claessens1-1/+2
2021-07-07cleanup self.options.wdPaolo Bonzini1-1/+0
It is never None and always an absolute path
2021-07-07resolve symlinks passed to -CPaolo Bonzini1-2/+2
"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-03-16Add `meson devenv` command and meson.add_devenv()Xavier Claessens1-0/+79