summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-11-19compilers: Remove Environment parameter from Compiler.compiles()Dylan Baker
2025-11-19Compilers: remove Environment parameter from Compiler.links()Dylan Baker
2025-11-19compilers: Remove Environment parameter from get_compileropt_valueDylan Baker
2025-11-19linkers: Store a reference to the Environment in the DynamicLinkerDylan Baker
For the same reason that the StaticLinker needs this, we need it in the DynamicLinker as well.
2025-11-19linkers: Store a reference to the Environment in the StaticLinkerDylan Baker
There are a number of places where we treat StaticLinker and Compiler as polymorphic, as such the StaticLinker cannot need extra parameters.
2025-11-19compilers: Stop passing `is_cross`Dylan Baker
This is calculated by `Environment().is_cross_build(for_machine)`. Since we have that in the Compiler class, just calculate it in the Compiler initializer
2025-11-19compilers: Pass Environment instead of MachineInfoDylan Baker
We end up needing it everywhere, so just store it. This patch is huge already, so it's just the conversion to passing Environment, more cleanups to come.
2025-11-19macros: fix feature to disable verbosityDominique Leuenberger
Instead of relying on __meson_verbose being defined or not, handle its value; in context of larger build systems (like open build service) this allows a project wide configuration to override %__meson_verbose to 0
2025-11-19interpreter: Fix import of cargo for type checkingDylan Baker
2025-11-19fix parsing cgit pathsJohn Turner
Using os.path.basename on a string such as "/foo/bar/" returns an empty string, which breaks on e.g. Cgit git URLs. The fix uses pathlibs Path class "parent" method, which gets the last component of the path, so "bar" for "/foo/bar/".
2025-11-19mtest: fix building of all test deps for --suitemaj0e
The previous commit eb1e52afa142fc0f38260a9cb3413f2bd63b1675 introduced a variable `rebuild_only_tests` to fix various edge cases in rebuild_deps. In particular, if all tests are selected anyway, rebuild_deps prior to the introduction of `rebuild_only_tests` would potentially create a huge list of targets, which may overflow the ARG_MAX limit. For that case `rebuild_only_tests` was introduced and is set to an empty list, which means that rebuild_deps falls back to the `meson-test-prereq` ninja target, that already contains the necessary targets. This is wrong, though, when `meson test` is executed with the "--suite" option. In that case, the user requested a particular subset of the tests, but `rebuild_only_tests` will be set to an empty list anyway, which means the `meson-test-prereq` target is executed, which contains the targets for all tests. Instead, `rebuild_only_tests` should only be set to an empty list, when the selected tests are identical to the complete list of available tests: `tests == self.tests` Since after this commit we compare directly to the result of `self.get_tests()`, this will do the correct thing for all other options, which change or filter the list of selected tests (e.g. `self.options.args`, `self.options.slice`).
2025-11-19tests: Fix regex in test_sliceMarkus Jörg
If the first line already conained a match, the former regex didn't catch it correctly, because it was looking for a newline character to detect the start of a line. The new regex is using the proper `^` to match the beginning of a line. For this to work as expected the `re.MULTILINE` flag has to be set.
2025-11-19rust: search for native static libs in target libdirAlyssa Ross
Sometimes, a Rust static library's native static libs refer to libraries installed in the rustc target libdir. This is always the case for most musl targets (with the intention of making it easier to use them on non-musl systems), and other targets can also be configured to do this using e.g. the llvm-libunwind option when building the standard libraries for the target. When rustc is responsible for linking it will always add the appropriate directory to the linker search path, but if we're not using Rust for linking, we have to tell the linker about that directory ourselves. The added test demonstrates a scenario where this comes up: linking a static Rust library, built for musl, into a C executable. -lunwind is in the native static libs list from the compiler, but it's referring to the libunwind.a in the self-contained directory.
2025-11-19options: the parent of a yielding option can be falsyPaolo Bonzini
Fixes: #15258
2025-11-19Prevent /link being passed twice in compiler flagsFrankie Robertson
This does not work correctly with clang-cl/lld-link
2025-11-19rust: add functions for coverage argumentsPaolo Bonzini
Adding support for linker option broke -Db_coverage because the `--coverage` option is added to the command line without the `-Clink-arg=` part. Fix it by overriding get_coverage_link_args; since we have to add the get_coverage_* functions to RustCompiler, teach it to generate `-Cinstrument-coverage` as well. Note that `-Clink-arg==--coverage` is actually useful only for mixed C/Rust programs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-18docs: Generate functions pagesSwagtoy
Currently meson generates a huge page for functions. For now we'll keep compatibility with it, but it's a lot cleaner to have separate pages as well as it makes it easier for search engines to parse as well as sending direct links Signed-off-by: Swagtoy <me@ow.swag.toys>
2025-11-18modules/windows: Also search for llvm-rc and llvm-windresLuca Bacci
Fixes #15011
2025-11-18docs: release-note rewriter improvementsBenjamin Gilbert
2025-11-18rewriter: fix kwargs info for dict-valued kwargsBenjamin Gilbert
We can't modify dict-valued kwargs (#14739) but this lets us at least read them.
2025-11-18rewriter: drop unused command-line arguments for def/kwargs deleteBenjamin Gilbert
The `default-options delete` and `kwargs delete` subcommands required key/value pairs, where the key was deleted and the specified value was ignored. This matches the JSON script mode interface but is unpleasant as a CLI. Have the CLI `delete` commands accept a list of keys instead. We can make this change because the UI is documented to be unstable. However, to allow scripts to work with both old and new Meson, ignore even-numbered arguments if they're all equal to the empty string. Fixes: #13234
2025-11-18rewriter: fix backtrace if command-line kwargs length is oddBenjamin Gilbert
Many rewriter subcommands expect key/value pairs as adjacent arguments. If the last value is missing, show a user-friendly error instead of a backtrace. For: #13234
2025-11-18rewriter: support project(license_files: )Benjamin Gilbert
2025-11-18rewriter: don't unpack the same values five timesBenjamin Gilbert
Fixes: e81acbd606 ("Use a single coredata dictionary for options")
2025-11-18rewriter: fix CLI help recommending invalid function IDs for projectBenjamin Gilbert
The project ID must be "/" and cannot be an arbitrary string.
2025-11-18rust.proc_macro: fix type of kwargs["native"]Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-18interpreter: fix type of override_optionsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-18Add support for the `counted_by` attributeTristan Partin
This is a new attribute released in GCC 15 and clang 18. It isn't supported in C++ compilers at the moment.
2025-11-17mtest: consistently, sanely, exit "1" if tests failEli Schwartz
Previously, we exited as "number of test failures", as a side effect of a refactor. Regressed in commit 297749581dd4dcb4e68da4b1d0622d2916fb8db3. This was a bad sentinel for "track if tests have failed", and formerly we did indeed set "returncode = 1" upon encountering a test fail! The consequence of this is that we break: - returning failure at all, if test fails are a multiple of 256 - returning 125 for "git bisect run shall skip this commit", as a documented guarantee of meson - returning > 127 shall abort bisection entirely The behavior is nonsensical and accidental, and nobody should be using this accident to count the number of failed tests (as it won't even work). Fixes: https://github.com/mesonbuild/meson/issues/15251
2025-11-17mtest: add convenience key to testlog.json for "is a failure"Eli Schwartz
This info is also available from the "result" entry, but requires mapping result types to "would cause a failure, but isn't literally FAIL". It comes in handy for the meson testsuite, too.
2025-11-17docs: fix typoSertonix
2025-11-17rust: allow either crate names or target names in the dependency mapPaolo Bonzini
Since commit 44ce04537 ("cargo: Add library API version into its name", 2025-10-28), the target names provided by cargo subprojects have a suffix corresponding to the library API; for example, the target that used to be "gtk4" is now "gtk4+0_10". This however is an implementation detail, and the change broke rust_dependency_maps that expected to use the crate name. While the target name is preferrable, and will work great when Meson is able to create dependency maps by itself (as is the case for the Cargo interpreter), preserve the old behavior by checking also the entry corresponding to the result of _get_rust_crate_name. Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-17docs: clarify documentation for rust_dependency_mapPaolo Bonzini
Give a practical example of how it is used. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-17Support Visual Studio 2026.Jussi Pakkanen
2025-11-14interpreter: Robustly covert executable arguments to shared_library argumentsDylan Baker
This extends the code that strips executable keyword arguments to also default populate shared_library exclusive arguments. Fixes: #15238
2025-11-14build: Add `android_exe_type` to the Executable keyword argumentsDylan Baker
Which removes the need to assert it.
2025-11-14Add documentation for OS/2 supportKO Myung-Hun
2025-11-14Add `os2_emxomf' option to generate OMF files on OS/2KO Myung-Hun
1. Generate OMF objs with `-Zomf' compiler flags 2. Generate OMF libs with `.lib' suffix using `emxomfar' as a librarian
2025-11-14Get library name patterns with proper prefixes and suffixes on OS/2KO Myung-Hun
2025-11-14Add `shortname' kwarg for a short DLL name on OS/2KO Myung-Hun
Give an user opportunities to mangle a custom short name for a DLL on OS/2.
2025-11-14Generate a shared library and an import library correctly on OS/2KO Myung-Hun
On OS/2, 1. a shared libary has '.dll' suffix 2. a length of DLL name should not be longer than 8 chars 3. an import library is used to link against a DLL 4. an import library has '_dll.a' suffix.
2025-11-14Extension of the executable is `exe' on OS/2KO Myung-Hun
2025-11-14PIC is always enabled on OS/2KO Myung-Hun
2025-11-14Add a proper flag for pthread on OS/2KO Myung-Hun
2025-11-14OS/2 linker does not support a thin archiveKO Myung-Hun
2025-11-14Add functions to determine if OS/2KO Myung-Hun
2025-11-14Add OS2 dynamic linker supportKO Myung-Hun
2025-11-14add test cases for meson.version.version_compare()Eli Schwartz
Extracted from https://github.com/mesonbuild/meson/pull/15230 Co-authored-by: Charlie Hutcheson <chaz.hutcheson@gmail.com>
2025-11-14make str and meson.version() API align again.Eli Schwartz
Regression in commit 6ee583e119b432fee03f908547729d5da030397e. str.version_compare() accepts varargs unless the str was defined via meson.version(), which isn't supposed to be a visible end user distinction. That being said, it makes no sense to support the special casing here. - FeatureNew only compares conditions with min, not with max - Having multiple min conditions is illogical and there's no need to support it. So we allow varargs for parity, but debug log that we can't handle it specially and refrain from setting tmp_meson_version at all. Fixes: https://github.com/mesonbuild/meson/issues/15217
2025-11-14version_compare with meson.version() override should log when it doesn't workEli Schwartz
meson_version: '>=1.8.0' works to control FeatureNew -- but < does not. Likewise with version_compare. This may or may not surprise people. Leave a hint in the logfile.