summaryrefslogtreecommitdiff
path: root/mesonbuild/envconfig.py
AgeCommit message (Collapse)Author
2025-11-14Extension of the executable is `exe' on OS/2KO Myung-Hun
2025-11-14Add functions to determine if OS/2KO Myung-Hun
2025-10-29compilers: add Microchip XC32 compilerLiza Chevalier
The Microchip XC32 compiler is a GCC-based compiler implemented using existing GNU compiler classes. As the XC32 version and GCC version do not match mixins have been implemented to override versions used in versions checks where applicable.
2025-10-29environment: move detection functions to envconfig.pyPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-25Fix regression that made compiler detection print messages about ccacheEli Schwartz
Which could be printed dozens of times in a row inside ./run_project_tests.py. Regression in commit c3ea8d5aa1b48fbc4137ef783c567a32cd596993.
2025-09-06compilers: Enable out-of-the-box MSVC compatibility with ccacheL. E. Segovia
ccache has been for a long time compatible with MSVC (since 4.6) but when using debug mode, the /Z7 flag must be passed instead of /Zi. See https://ccache.dev/releasenotes.html#_ccache_4_6
2025-04-16environment: handle all iOS variants as xnuPaolo Bonzini
All of iOS, tvOS, visionOS, watchOS use the XNU kernel. Report that and also make them return true for is_darwin() which is really more like "is_xnu()". Co-authored-by: Russell Keith-Magee <russell@keith-magee.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-03-26envconfig: fix unhandled exception when cross-file lacks required keysyexiaochuan
Fix the unhandled KeyError exception that occurs when cross-compilation configuration files are missing required parameters (such as 'endian'). This issue was introduced in commit b0d2a92 (PR #11692), where the key validation logic didn't properly handle the relationship between provided and required keys: - Previously, the code used `set(literal) < minimum_literal` to check if provided keys were a strict subset of the required keys in minimum_literal - This validation logic broke down when the provided keys weren't a strict subset anymore, but rather an overlapping set with disjoint elements on both sides - When required keys were missing, the code continued execution and later threw an unhandled KeyError when trying to access the non-existent keys Changed the condition check from: if set(literal) < minimum_literal: to: if minimum_literal - set(literal): This new check specifically identifies keys that are "present in required but not present in provided", providing users with clear error messages instead of raising unhandled exceptions. This change also removes the implicit requirement that "provided keys must not contain any keys not present in the required set" - allowing for optional keys to exist in the provided configuration. Fixes #14385
2025-03-01environment: make fully type safeDylan Baker
This as much as anything is to stop lying to envconfig about the potential types it will be given.
2025-01-08Add TASKING compiler supportgerioldman
2024-12-31Fail gracefully when compiler cache is specified without compilerJoel Rosdahl
With CC=ccache meson ... meson crashes with [...] File "/usr/lib/python3.10/site-packages/mesonbuild/compilers/detect.py", line 364, in _detect_c_or_cpp_compiler compiler_name = os.path.basename(compiler[0]) IndexError: list index out of range Improve this by throwing an EnvironmentException to fail gracefully when no compiler is specified. Fixes #9933 Fixes #13589
2024-03-12Added support for Texas Instruments C6000 compiler.Petr Machacek
2024-01-01envconfig: read CYTHON from the environment and use it if setErik Bråthen Solem
Add support for specifying Cython compiler using the CYTHON environment variable. If not set, proceed with the names hard coded for Cython.
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-10-19pkgconfig: Allow setting both pkgconfig and pkg-configXavier Claessens
This was previously allowed for different usage. Keep allowing it, but with non fatal deprecation notice, and ignore the value from legacy pkgconfig.
2023-09-22CPU family support 'sw_64' and remove the compile warning (#12273)Kunwu.Chan
add sw_64 to the list of known cpus
2023-09-18pkgconfig: Deprecate "pkgconfig" in favor of "pkg-config" in [binaries]Xavier Claessens
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-08-11remove useless type annotationsEli Schwartz
These annotations all had a default initializer of the correct type, or a parent class annotation.
2023-06-27Merge pull request #11902 from dcbaker/submit/rust-module-enhancementsJussi Pakkanen
Rust module enhancements for mesa
2023-06-27Archive shared library in AIX (#11850)Aditya Kamath
* Archive shared library in AIX This code change to ensure we archive shared libraries in AIX. The things we do are: Archive shared library Install archived shared library Build all must build the archived shared library blibpath must have the archived shared library dependency. * Archive shared library in AIX. Made changes as per the review comments given in the first PR request. They are:- Use self.environment.machines[t.for_machine].is_aix() Remove trial spaces Use of val instead of internal Changed comments wherever requested * Space after octothorpe * Fixed failed test case causing build break during install section * Moved AIX specific code to AIXDynamicLinker from backend * Fix indentation, trailing spaces, add type annotations and Linux/macOS build break * Remove some more trailing space issues * Fixed the wrong return type in linkers
2023-06-27modules/rust: Add a machine file property for extra clang args with bindgenDylan Baker
It's currently impossible to inject extra clang arguments when using bindgen, which is problematic when cross compiling since you may need critical arguments like `--target=...`. Because such arguments must be passed after the `--` it's impossible to inject them currently without going to something like a wrapper script. Fixes: #11805
2023-06-19Add kernel and subsystem properties to machine objects.Jussi Pakkanen
2023-04-11fix various spelling issuesJosh Soref
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-02-01treewide: add future annotations importEli Schwartz
2022-10-24Add NASM compilerXavier Claessens
2022-09-01env2mfile: reuse logical lists of interesting facts from meson itselfEli Schwartz
Meson internally knows about many languages and tools, and *FLAGS variables, and which languages to use them for. Instead of duplicating this logic, import it from mesonbuild.* This logic was originally standalone, but now that it is merged into the Meson tree we can have a single source of truth.
2022-08-30Add LLVM_CONFIG supportSamay Sharma
2022-08-04cmake: Change assertion into a more useful error (fixes #9925)Daniel Mensinger
2022-07-31envconfig: add more binutils variablesArtturin
follow standard variables and allow distributions to remove some entries from their cross-files ex: https://github.com/void-linux/void-packages/blob/f23acdd24bfade3a4e14809fafaffe09b3c3c318/common/build-style/meson.sh#L50-L54 variables chosen from the variables nixos sets https://github.com/NixOS/nixpkgs/blob/ea0f14a502c60223c96066de3ed548cb3be8ca47/pkgs/build-support/bintools-wrapper/setup-hook.sh#L58 sorted alphabetically
2022-03-22envconfig: use $PKG_CONFIG for pkg-config find_program as well as pkgconfigDylan Baker
It looks like internally we use pkgconfig, even though the installed name is pkg-config. This fixes `tests cases/common/44 pkgconfig-gen`, which will ignore PKG_CONFIG and select the wrong pkg-config binary if you have $PKG_CONFIG set.
2022-03-07treewide: string-quote the first argument to T.castEli Schwartz
Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only.
2022-02-02Genericise TI compiler and add MSP430 supportWilliam Toohey
2022-01-10first pass at migrating to dataclassesEli Schwartz
In some cases, init variables that accept None as a sentinel and immediately overwrite with [], are migrated to dataclass field factories. \o/ Note: dataclasses by default cannot provide eq methods, as they then become unhashable. In the future we may wish to opt into declaring them frozen, instead/additionally.
2021-12-17add ft32 cpu familyRafael Silva
2021-11-01modules/gnome: use envconfig for VAPIGENDylan Baker
we have a mechanism for doing "this could be an environment variable" let's use that.
2021-10-25Add sccache support.Jussi Pakkanen
2021-06-18holders: Introduce HoldableObjectDaniel Mensinger
2021-05-18add cpu family cskyRandy Yates
2021-04-12dependency: Add JDK system dependencyTristan Partin
The JDK system dependency is important for detecting JDK include paths that may be useful when developing a JNI interface.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz
performed by running "pyupgrade --py36-plus" and committing the results
2021-02-06add loongarch supportXiaotian Wu
2021-01-13Fix misspellsAntonin Décimo
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-11move get_env_var_pair to environmentDylan Baker
This is only used in environment, so it should live there too.
2021-01-11boost: default machine file properties to env var valuesDylan Baker
This both moves the env reading to configuration time, which is useful, and also simplifies the implementation of the boost dependency. The simplification comes from being able to delete basically duplicated code since the values will be in the Properties if they exist at all.
2021-01-11Move BinaryTable environment lookups to EnvironmentDylan Baker
This means that all the env lookups are done once, at initial configure time. This has all of the expected advantages.
2021-01-11pull env to program mappings out of BinaryType classDylan Baker
These really aren't pivotal to that class, and they're used outside of it. In a follow up patch they're not going to be used inside it at all.
2020-11-22Merge pull request #8011 from dcbaker/submit/post-python36-cleanupsJussi Pakkanen
Python 3.6 cleanups
2020-11-21envconfig: use debug for "using * from environment variables messagesDylan Baker
These are spammy, and being in the debug log is probably better anyway.
2020-11-20use real pathlib moduleDylan Baker
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this