summaryrefslogtreecommitdiff
path: root/mesonbuild/utils/core.py
AgeCommit message (Collapse)Author
2024-06-23limit wrapped-due-to-env special case for `env` to only apply for env.setEli Schwartz
In commit 2cb7350d1679fb61826bf4aebfb0f75a9b9103e3 we added a special case for environment() objects to allow skipping `meson --internal exe` overhead when /usr/bin/env exists and can be used to set environment variables instead of using a pickled wrapper. This special case assumed that environment is used for setting variables, but it is also possible, albeit less common, to append/prepend to them, in which case `meson --internal exe` will compute the final value as an offset from whatever the current environment variables inherited from ninja are. It is not possible to precompute this when generating command lines for ninja, so using arguments to /usr/bin/env is not possible. All it can do is set (override) an environment variable. In this case, we have to use the python wrapper and cannot optimize it away. Add a tracking bit to the env object and propagate it to the backend.
2024-02-23env.unset methodCharles Brunet
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-08-03ExecutableSerialisation: capture and feed are optional stringsXavier Claessens
capture is the optional filename stdout is redirected to. feed is the optional filename stdin reads from.
2023-05-02extend install scripts to allow specific directory variable exportsEli Schwartz
This is useful for internal scripts that want to know about something other than MESON_INSTALL_PREFIX and MESON_INSTALL_DESTDIR_PREFIX, which is very specific to the prefix.
2023-04-26Add env kwarg to gnome.generate_gir().Volker Weißmann
Fixes #384
2023-02-14allow install script to run in dry-run modeCharles Brunet
2023-02-01micro-optimize: define typing-only objects in TYPE_CHECKINGEli Schwartz
Union types that exist solely for use as annotations don't need to be created in normal runs.
2023-01-18devenv: Allow dumping into file and select a formatXavier Claessens
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.
2023-01-16properly type utils/core.py and add it to mypyEli Schwartz
EnvironmentVariables was always broken, it used MutableMapping because everyone <3 abstract interfaces, especially when they are broken and don't actually do what you want. This needs a dict interface, exposing `.copy()`. We either use a dict or os._Environ, and the latter also supports that. Also fix a broken import, and the fallout from forgetting to update the signature of self.envvars in commit b926374205bd761085031755c87152d08bc10e9d.
2022-12-07devenv: Do not include system values in --dumpXavier Claessens
This makes --dump print variables like `FOO=/path:$FOO:/another/path`.
2022-09-28Move classes used by scripts to their own moduleXavier Claessens
Those classes are used by wrapper scripts and we should not have to import the rest of mesonlib, build.py, and all their dependencies for that. This renames mesonlib/ directory to utils/ and add a mesonlib.py module that imports everything from utils/ to not have to change `import mesonlib` everywhere. It allows to import utils.core without importing the rest of mesonlib.