summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-07-22Docs: standardize between list and array as arrayDylan Baker
When arrays were added they were called arrays. Because the are implemented with Python lists, that language started leaking into talking about Meson types. This is confusing. I've attempted, as much as possible, to move to using one name, array. I picked array because 1) It's the original name used, and 2) what Meson has are more properly arrays as they have a fixed length, while a critical property of lists are the ability to link and unlink them. There are a couple of places where the list language has leaked into the names of keyword arguments. I have not made any attempt to change those, I don't know if it's that useful or not.
2025-07-21rust: pass rpath arguments to rustdoc --testPaolo Bonzini
rustdoc does not support --print, and therefore the rpath argument corresponding to the rust installation is not passed to doctests. Forward anything that requires --print to the RustCompiler, thus fixing doctests with a shared library dependency. Fixes: #14813 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-21rust: only allow rust.doctests if the target is a cratePaolo Bonzini
Rust doctests implicitly use the base target as a crate. This is not possible unless the target uses the Rust ABI. If someone uses a C-ABI target with rust.doctest(), you get an unresolved module error and it is not clear what's really going on, so add a more specific error. Cargo does the same, though it only reports a warning. Fixes: #14813 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-21clang-tidy: run tool only on source files participating in targetsSahnvour
clang-tidy can't be ran as is on every source file and header
2025-07-19interpreter: Add a flatten() method to arraysDylan Baker
This allows users to do two things, flatten potentially nested arrays themselves, and, to safely convert types that may be an array to not an array. ```meson x = [meson.get_external_property('may_be_array)].flatten() ``` ```meson x = ['a', ['b', 'c']] assert(x.flatten() == ['a', 'b', 'c']) ```
2025-07-19Hack around hotdoc build failuresMichał Górny
Build hotdoc from the git repository to work around the build failures resulting from C99 incompatibilities. The issues are already fixed, but the fix has not made it into a release yet. Signed-off-by: Michał Górny <mgorny@quansight.com>
2025-07-19options: fix misindentationPaolo Bonzini
Ensure that valobj.yielding is cleared for options in the toplevel project. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-19Always add libdirs to rustc commandSeán de Búrca
This works around an issue in which meson provides absolute paths to rustc, but rustc pulls metadata from an external rlib and adds link args without adding library paths. Fixes: #14622
2025-07-19wrap: Don't use old patch.exe from Strawberry PerlNirbheek Chauhan
It is too old and barfs on patches from git-format-patch: ``` Applying diff file "orc-0.4.38\0001-meson-fix-symbols-leaking-from-static-library-on-Win.patch" patching file meson.build Assertation failed! Program: C:\Strawberry\c\bin\patch.EXE File: .\src\patch\2.5.9\patch-2.5.9-src\patch.c, Line 354 Expression: hunk ``` 2.6.1 is the oldest known version that works correctly.
2025-07-18wrap: Print deprecation warnings when using wrapdb v1Xavier Claessens
2025-07-18Fix use of a .pxi Cython include file as source from `configure_file`Ralf Gommers
Without adding .pxi` as a known header suffix, the added test will fail with: ``` No specified compiler can handle file stuff.pxi ``` Technically only .pxd are header files, and .pxi are "include files" which are literally included in .pyx files. Adding them as headers seems to be fine though, since they're kinda similar and the point is to avoid treating them as source files.
2025-07-18cmake: Use the `cm\_` prefix for names starting with digitsKonstantin Seurer
Avoids errors like `ERROR: Invalid variable name: 16bit_arithmetic_dir`.
2025-07-18Use os.path.normpath to make paths prettierVolker Weißmann
`meson.py introspect build --targets` should show `/path/to/project/hello.c` instead of `/path/to/project/subdir/../hello.c` if /path/to/project/meson.build contains subdir('subdir') and /path/to/project/subdir/meson.build contains executable('hello', '../hello.c').
2025-07-18rust: add rust_dynamic_std optionPaolo Bonzini
As an initial implementation, simply adding "-C prefer-dynamic" works for binary crates (as well as dylib and proc-macro that already used it). In the future this could be extended to other crate types. For more information see the comment in the changed file, as well as https://github.com/mesonbuild/meson/issues/8828 and https://github.com/mesonbuild/meson/issues/14215. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-18compilers: add Rustup libdir even if there is no other rpath argumentPaolo Bonzini
RustCompiler.build_rpath_args works by appending the directory to the arguments computed by self.linker.build_rpath_args. This does not work if there is no argument to begin with, which happens for example in program crates. Use the new extra_paths argument to force inclusion of the libdir into the rpath of the binary, even in that case. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-18linkers: add extra_paths to build_rpath_argsPaolo Bonzini
Allow adding extra directories to the rpath. Rust needs this when Rustup is in use. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-18docs: document new behavior of yielding optionsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-18Revert "options: do not overwrite parent options when a yielding option is set"Paolo Bonzini
This reverts commit 9ad10ee78f632a60d35327eaa9b88c7efde35fe6. The "if" in set_option() was removed, because get_key_and_value_object_for now always returns the subproject key and option object; remove the function as well. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-18options: resolve yielding options at the time they are addedPaolo Bonzini
This makes it possible to adjust the value of the option with a subproject-specific augment. This was an undocumented change in 1.8 which was (voluntarily) undone in commit eae4efa72 ("options: resolve yielding options at the time they are added", 2025-07-13), but is useful. This reimplementation of yielding options makes it possible to presreve the bugfix while restoring this new feature. Reported-by: Nirbheek Chauhan <nirbheek@centricular.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-18coredata: remove use of `stringlistify` to do a castDylan Baker
This is a heavyweight and expensive function to use to verify that we have a string list. Just cast to make mypy happy, we know what we have.
2025-07-18coredata: actually use the correct machine for the dependency cache keyDylan Baker
2025-07-17options: parse -D and -U arguments directly into a Dict[OptionKey, ↵Paolo Bonzini
Optional[str]] As a side effect, this deduplicates -D and -U arguments passed to meson configure, taking into account the relative ordering of -D and -U options. Fixes: #14754 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-16Add encoding parameter to fix CI.Jussi Pakkanen
The test does not actually fail, but the test runner seems to think that if _anything_ gets printed to stderr, that is a failure. https://nibblestew.blogspot.com/2019/04/an-important-message-for-people.html
2025-07-14environment: really remove assertionPaolo Bonzini
Fixes: #14789 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-14hdf5: Skip failing Fortran config-tool test when h5fc is brokenMichał Górny
Skip the hdf5 Fortran config-tool test when running on CI and h5fc looks broken. This is needed due to upstream bug that h5fc does not include include paths when built via CMake, that currently affects at least Arch Linux and Gentoo. Bug: https://github.com/HDFGroup/hdf5/issues/5660 Signed-off-by: Michał Górny <mgorny@quansight.com>
2025-07-14scalapack: Fix exception when MKLROOT is unsetMichał Górny
Fix `scalapack.MKLPkgConfigDependency` not to crash when `MKLROOT` is unset: ``` File "/meson/mesonbuild/dependencies/scalapack.py", line 65, in __init__ super().__init__(name, env, kwargs, language=language) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/meson/mesonbuild/dependencies/pkgconfig.py", line 322, in __init__ self._set_cargs() ~~~~~~~~~~~~~~~^^ File "/meson/mesonbuild/dependencies/scalapack.py", line 141, in _set_cargs cflags = self.pkgconfig.cflags(self.name, allow_system, define_variable=(('prefix', self.__mklroot.as_posix()),)) ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'as_posix' ``` The code is crashing because the `_set_cargs()` method assumes that `self.__mklroot` will always be set, presumably because it assumes it will only be called only when `MKLPkgConfigDependency.__init__()` finishes with `is_found = True`. However, both `_set_cargs()` and `_set_libs()` are called during `PkgConfigDependency.__init__()`, and therefore they will be called if pkg-config lookup succeeds even without `MKL_ROOT` set. To avoid the issue, check for `self.__mklroot is None` in both functions, and raise a `DependencyException` — effectively causing the pkg-config lookup to fail in a natural way. Fixes #11172 Signed-off-by: Michał Górny <mgorny@quansight.com>
2025-07-14docs: document missing languages in project()meator
2025-07-14environment: allow setting build options with "build." prefixPaolo Bonzini
This is allowed -- it is already deprecated for the cross file, but it should not assert. Add a deprecation for the native file too, and remove the assert. Fixes: d37d649b08b832d52fa684bc0506829fb40d5261 Fixes: #14789 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-14mconf: print build option names including "build."Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-14unittests: add test case for setting and retrieving build optionsPaolo Bonzini
Check that build options fall back to host options, and that they can be retrieved with get_option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-14interpreter: allow retrieving build options with get_option()Paolo Bonzini
Fixes: #14788 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-13backends: Use POSIX paths for target pathsL. E. Segovia
This commit completes 5de09cbe8838e8febf1ca3aa83b53cf06972bff3, ensuring that only POSIX style paths are passed to the compiler line, and thus fixing UNIX-style tools that treat single backward slashes as Unicode escaped characters. Fixes #12191 Completes #12534 Completes #12564
2025-07-13qt dependency: Don't insert backslashes into cflags on windowsNirbheek Chauhan
The use of os.path.join is inserting `\` into the compile_args, which is wrong since qmake outputs `/` even on Windows, and in fact it causes pkgconfig files that depend on qmake dependencies to have `\` path separators, which get resolved as escape sequences. Use Path.as_posix() to avoid this.
2025-07-12cuda: enable support for `CCCL_ENABLE_ASSERTIONS`David Seifert
CUDA 12.9.0 ships a cccl that supports the new debug macros.
2025-07-10compilers: move CFLAGS/CXXFLAGS handling to EnvironmentPaolo Bonzini
That is where env_opts are stored, so make the compiler call back directly into the environment. Suggested-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-10unittests: add test for c_link_args and CFLAGS interactionPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-10options: apply CFLAGS even if c_link_args existsPaolo Bonzini
This restores the behavior before 1.8's option store refactoring. The bug arises because c_link_args has been stored in pending_options, and therefore the extended value (which get_global_options correctly computes) is overwritten by the value passed on the command line. In fact, this bug is the reason why I added the "link_args_from_envvar" check: the CFLAGS would be ignored anyway, so I put that logic in code instead of relying on the option store's behavior. The fix is to extend the value *after* the option has been added and the pending_options resolved. This requires a tiny refactoring of the split between CoreData.add_lang_args and compilers.get_global_options. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-10options: ignore c(pp)_link_args when deciding whether to apply C(XX)FLAGSPaolo Bonzini
Commit 2d1c67f09 ("options: restore special behavior of CFLAGS vs. c_args", 2025-05-15) incorrectly checked the presence of c_link_args, and did not apply CFLAGS if c_link_args was set. This was not the behavior of 1.7, so remove the check. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-09Add -F compiler flag for included MacOS frameworksmattbsage
Currently, when using frameworks on MacOS systems, Meson will send the appropriate flags to the linker but fails to pass flags to the compiler, resulting in the headers not being found for the included frameworks. This patch adds the required "-F{framework}" flag to the compiler options, so that the compiler can find the headers of included frameworks. See: https://github.com/mesonbuild/meson/issues/14641
2025-07-09unittests: improve test for yielding optionsPaolo Bonzini
Go through the whole initialization and set_option process, and check that the option value is unaffected by the creation of a subproject. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-09options: do not overwrite parent options when a yielding option is setPaolo Bonzini
Fixes: #14774 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-09xcode: Setup folder tree in IDEAlbert Tang
2025-07-07msetup: keep pending optionsPaolo Bonzini
New languages and subprojects can appear in subsequent configurations. Subproject options are kept for later now that they are not stored in pending_options, but compiler options for example are not. Drop OptionStore.clear_pending so that they are preserved as well. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-07docs: update project(default_options: ...) for 1.8 changesPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-07docs: document order in which options are appliedPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-07ast, interpreter: look up default_library and default_both_libraries by ↵Paolo Bonzini
subproject This is already done most of the time for default_library but not in these cases. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-07options: give priority to parent augments over child default_optionsPaolo Bonzini
Restore behavior of 1.7. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-07options: handle augments in OptionStore.set_optionPaolo Bonzini
Remove all the special casing and late validation now that early augments are stored in pending_subproject_options until the subproject is found. As a result, this makes the buildtype special case operate on subprojects as well. It also simplifies set_from_configure_command(), which does not have to treat various kinds of options in different ways. Fixes: #14729 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-07options: fix direction of resultPaolo Bonzini
Fixes: 8dcc9d342 ("options: accept compiler and built-in options in --reconfigure and "meson configure"", 2025-05-21 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-07options: warn if subproject sets another subproject option too latePaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>