summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-09-25mypy: ignore unused castEli Schwartz
It doesn't appear to have been needed at all? But only newer mypy versions go so far as to report it as an unused ignore (which is an error code itself).
2025-09-25mypy: loosen type ignoreEli Schwartz
The type error is renamed to union-attr in some mypy versions, which raises TWO errors: - Unused "type: ignore" comment - Item "TextIO" of "TextIO | Any" has no attribute "colorize_console" ... which broadly speaking indicates that we should not be using targeted ignores, after all. A proper inheritance system for ignore types would be more fitting, but seemingly doesn't exist.
2025-09-25remove unused function with mypy errorsEli Schwartz
Newer mypy astutely notices this always sets `self.options[str_key]`, which violates the type requirement for OptionKey. Per the comment, nobody should be using it, and fortunately nobody is. Deleting the code (or making it raise MesonBugException) has no impact on the testsuite.
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-25mypy: fix typing looseness regression in 3.13Eli Schwartz
glob can be a generator or an iterator depending on python version. We would rather not care about this (and officially these are the same, except not). We just pass it to "accepts_iterable". But nonetheless, we are forced to care because we hold the value. Sad.
2025-09-25mypy: enable allow-redefinition-new and fix falloutEli Schwartz
Reduces 3 errors that show up in newer mypy versions than pinned in CI. It is new since 1.16 and a likely future default for mypy 2.0. It allows things like: ``` for i in ['one', 'two', 'three']: frob_a(i) for i in [1, 2, 3]: frob_b(i) ``` since "i" is obviously used as a loop holder and its type can be freely reinvented. Note: allow-redefinition-new isn't actually about this at all, it has greater scope than loop holders and allows redefining "unannotated variables" of all kinds. No granularity in what to accept redefinition of. :P To enable this, we must also opt in to local-partial-types, which has some overlap with None-safety. Specifically: > the most common cases for partial types are variables initialized > using None, but without explicit X | None annotations. By default, mypy > won’t check partial types spanning module top level or class top level. > This flag changes the behavior to only allow partial types at local > level, therefore it disallows inferring variable type for None from two > assignments in different scopes. So with this, we also fix a couple of actual type errors this revealed. Where possible, stop None-initializing at all -- it's not strictly needed for global variables, anyway, and it's a coding error if it is possible to hit these variables without defining them first. Bug: https://github.com/python/mypy/issues/19280
2025-09-24ast/introspection: remove keyword arguments from build targets that are ↵Dylan Baker
UnknownValue It is not the build layer's job to handle ast types, so instead filter out UnknownValues before passing them to the build layer, then fix up any special values we need in the ast layer. This reveals that some of what we were previously doing only works because the build layer is pretty much untyped, if it was typed it would have screamed loudly.
2025-09-24format: Fix indentation with parenthesesCharles Brunet
- Split long expressions in () according to max line length - Partly revert d028502 . Fixes #14935. - Fixes #15032.
2025-09-24compilers: clang: map -Db_vscrt to -fms-runtime-libPaolo Bonzini
The main complication here is that passing -fms-runtime-lib during compilation results in a warning: clang: error: argument unused during compilation: '-fms-runtime-lib=dll' [-Werror,-Wunused-command-line-argument] (https://github.com/mesonbuild/meson/actions/runs/17727020048/job/50369771571). So, for compilation expand the -D flags by hand, and only pass -fms-runtime-lib when linking. Fixes: #14571 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-24compilers: use CRT linker arguments also for testsPaolo Bonzini
get_crt_link_args was only called for the final linker command line; add its result to the sanity check and compiler tests as well. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-24compilers: replace "type: ignore" with assertionsPaolo Bonzini
Option values have type "str | int | list[str]", assert that they are strings before passing them to self.get_crt_compile_args(). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-22cuda: Add support for sbsa-linux targetMaxandre Ogeret
2025-09-22rust: Fix dependency on proc macro cratesMartin Kletzander
When building a proc-macro crate the build target is actually a shared library target. The resulting library (the .so file directly) is used in the targets that depend on it. But being a shared object there are symbols extracted from it and the symbols file is the actual file recorded as the dependency. When another crate uses a macro from the first crate, being dependent on the symbols file it means that if the macro _implementation_ changes, but symbols stay the same, the symbol extractor does not rewrite the symbols file and nothing else gets rebuilt. That would be fine when it comes to classic shared library, but due to the fact that the shared library is used by the compiler (just like a gcc plugin or another compiler plugin) the result does not change only based on the symbols, but also based on the implementation. Therefore if the target in the dependency is a proc-macro crate, instead of depending on the symbols file, depend on the shared object filename. With this change, when a macro implementation changes in a proc-macro crate, all crates using that macro will be rebuilt. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2025-09-22rust: let doctests pick objects from dependenciesPaolo Bonzini
If a depedency includes object files, they have to be added to the doctest. However, NinjaBackend was not running flatten_object_list on the doctest. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-22utils, backends: add and use unique_listPaolo Bonzini
backends.py has an interesting idiom for keeping the unique elements of a list. This is much faster than OrderedSet: * dict.fromkeys() vs. OrderedSet.__init__(): 35% faster on Python 3.13, 50-60% faster on Python 3.10 * list(d) (d is a dict) vs. list(os) (os is an OrderedSet): up to 25% faster on Python 3.13, up to 15% faster on Python 3.10 though it tapers out after a few hundred elements. Add a function to mesonlib to encapsulate this idiom. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-21get_llvm_tool_names: add llvm 21Christoph Reiter
this fixes the "frameworks: 15 llvm" tests with llvm 21.1
2025-09-19pkgconfig: Fix class cached to be keyed on extra_pathsMichał Górny
Add `extra_paths` to cache keys for `PkgConfigInterface` and `PkgConfigCLI` instances, to avoid incorrectly reusing an instance with a different `extra_paths` value, see: https://github.com/mesonbuild/meson/pull/14657#discussion_r2320623799 Signed-off-by: Michał Górny <mgorny@quansight.com>
2025-09-15docs: fix pre-1.8 order for per-subproject optionsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-15Revert "test cases: do not pass global option on command line"Paolo Bonzini
This reverts commit 9b1eb8b8ed434d1c2fdca0d8ac46b79c9b91bb0f. It is not needed anymore since the pre-1.8 semantics were the good ones. Only leave in place the new and clearer testcase names.
2025-09-15Revert "tests: skip test common/223 in the -Ddefault_library=... jobs"Paolo Bonzini
This reverts commit 5ab871be5287aa5cce1e8dfdfb7c4a6b07b4f2f7. It is not needed anymore since the pre-1.8 semantics were the good ones.
2025-09-15options: put back in place 1.7 ordering of opt=value vs subp:opt=valuePaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-14Fix not passing user option args to scan-build buildStephan Lachnit
The option refactor (https://github.com/mesonbuild/meson/pull/14251) required False as argument in order for get_user_option_args to work as intended. This commit removes this argument again. Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2025-09-11Document internal dep support in pkgconfig.generate `requires` argBenjamin Gilbert
Added in #14750 for 1.9.0. Also add FeatureNew.
2025-09-09msetup: not-found subprojects do not have known optionsPaolo Bonzini
If a subproject had its SubprojectHolder created, but was disabled, its options were not parsed; therefore the subproject should not be checked for unknown options. Fixes: #14969 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-06tests: Fix shutil.which shim signature not accepting kwargsL. E. Segovia
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-09-06vsenv: Ignore errors when parsing multiline env valuesXavier Claessens
2025-09-04docs: Fix grammar ("has" -> "have")William Pursell
The subject of this sentence is the plural "design goals", and the verb must much the pluralism of the subject.
2025-09-03docs: belatedly generate release notes for 1.9.0Eli Schwartz
Fixes: https://github.com/mesonbuild/meson/issues/14984
2025-09-04gnome: Add missing install tag for vapi .deps fileThomas Mühlbacher
2025-09-03Use https for mesonbuild.comTobias Stoeckmann
Since http://mesonbuild.com redirects to https://mesonbuild.com anyway, use https directly in documentation.
2025-09-03Add docs on dependency handling conventions for upstream WrapDB projectsWill Ayd
2025-09-03Boost python must have a library component.Jussi Pakkanen
2025-09-03Check for header only Boost libraries.Jussi Pakkanen
2025-09-03docs: fix minor error in qt6 modulemeator
2025-08-29docs: clarify dict keys() and values() returns sorted arraysMarvin Scholz
2025-08-29tests: add dict.values() testsMarvin Scholz
2025-08-29interpreter: add dict.values() methodMarvin Scholz
Analogous to keys(), this returns the values in an array. It uses the same sorting as keys(), else it would quite confusing to return values in a different order than the corresponding keys.
2025-08-29tests: add tests for the dict.keys() methodMarvin Scholz
2025-08-29utils: make .wraplock optionalPaolo Bonzini
.wraplock is nice to have, but prevents Meson from operating on a read-only source directory. If the source directory is read-only, there is no possible conflict so in that case it is acceptable to return without any actual locking. Fixes: #14948 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-29Fix Cygwin test failure.Jussi Pakkanen
2025-08-28python: add a python.build_config option (PEP 739)Filipe Laíns
Signed-off-by: Filipe Laíns <lains@riseup.net> Signed-off-by: Michał Górny <mgorny@quansight.com>
2025-08-27coredata: do not write None to cmd_line.txtPaolo Bonzini
Fixes: #14955 Fixes: 37f7572ce15494654128184777b16ece38308b9a Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-27options: do not raise exception for unknown options in -U commandPaolo Bonzini
Fixes: #14956 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-26test cases/common/32 has header: disable undef with libcxxHaelwenn (lanodan) Monnier
Can be tested with adding -stdlib=libc++ to C++ flags. In file included from /usr/include/c++/v1/stdio.h:93: In file included from /usr/include/c++/v1/__config:14: In file included from /usr/include/c++/v1/__configuration/abi.h:15: /usr/include/c++/v1/__configuration/platform.h:35:7: error: function-like macro '__has_include' is not defined 35 | # if __has_include(<features.h>) | ^ /usr/include/c++/v1/__configuration/platform.h:48:5: error: function-like macro '__has_include' is not defined 48 | #if __has_include(<picolibc.h>) | ^ 1 warning and 2 errors generated. '
2025-08-26Print external project logfile on CI systemsTobias Diez
2025-08-26rustdoc: skip --crate-type optionPaolo Bonzini
--crate-type is accepted by recent versions of rustdoc, but it is not used by it and not listed in the documentation[1]. Remove it for compatibility with old versions of Rust. [1] https://doc.rust-lang.org/rustdoc/command-line-arguments.html Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-26Set version, soversion from cmake if availableJulianne Swinoga
2025-08-26mformat: force multiline arguments with commaCharles Brunet
Force multiline arguments when there is a trailing comma. This is the behavior of muon. Fixes #14721.
2025-08-26format: do not group '--' argCharles Brunet
The group_arg_value option allow to put --key and its value on the same line on multiline arguments. However, when the options is `--`, it is an argument separator, and should not be grouped with the following argument.