summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-11-14tests: Skip limited API test on freethreading Python versionsMichał Górny
Skip the limited API test when the CPython version used indicates being built with GIL disabled, i.e. the freethreaded build. The freethreaded versions of Python 3.13 and 3.14 do not support the limited API, and attempting to build the test case results in compilation failures. The check is limited to <3.15, so we don't forget to reenable it once limited API is supported. Signed-off-by: Michał Górny <mgorny@quansight.com>
2025-11-13vala: utilize depfilesValeri Ochinski
2025-11-12rust: allow linking with sanitizer-enabled C librariesPaolo Bonzini
Fixes: #15222 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12compilers: pass target and env to sanitizer_*_argsPaolo Bonzini
The Rust compiler will need these to check the rust_nightly option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12rust: call compilers.get_base_link_argsPaolo Bonzini
The rustc invocation performs both compilation and linking, so it should include link-phase arguments for LTO or sanitizers. RustCompiler has been taught how to include these arguments, so now add them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12rust: always pass -C default-linker-librariesPaolo Bonzini
This is often needed for mixed Rust/C programs, and in particular always needed with sanitizers. Add it always. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12rust: use proper linker arguments to get the MSVC runtime libraryPaolo Bonzini
Follow the suggestion in https://github.com/rust-lang/rust/issues/39016#issuecomment-2391095973 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12rust: add full set of linker argument functions to RustCompilerPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12compilers: generalize -fembed-bitcodePaolo Bonzini
Produce -Cembed-bitcode for Rust, and also disable bitcode generation when LTO is not enabled.
2025-11-12rust: add get_lto_compile_argsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12linkers: add -no_warn_duplicate_libraries when testing for arguments to Apple ldPaolo Bonzini
No other linker warns for duplicate libraries, and (especially with rustc) specifying --fatal-warnings may cause the warnings to trigger and a wrong result from has_multi_link_arguments. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12ninjabackend: rust: add linker args for cdylibsPaolo Bonzini
These produce a linked build product like binaries and Rust-ABI dylibs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-12interpreter: move backend type checking to interpreterDylan Baker
Of course, this checking isn't actually doing what it claims, as it doesn't actually stop you from writing at target like: ```meson build_target( 'foo', 'srcs/main.c', c_pch : 'src/pch.h', ) ```
2025-11-12build: Use a tuple for pch dataDylan Baker
This really isn't a list because it's not homogenous data, it's really `tuple[str, str | None] | None`, but we're using list length to decide what to do with it, and that makes for strict null issues, as an accurate annotation would be `list[str | None]`, which would require a lot of `is not None` checking. By using a tuple we don't need to keep checking length, which is more expensive than null checking. To ensure correctness I annotated some things in the VS backend
2025-11-12intepreter: Move remaining PCH validation to InterpreterDylan Baker
2025-11-12interpreter: Move most of the remaining validation to the InterpreterDylan Baker
What's left requires the Environment, so it will have to be handled in the interpreter implementation for now.
2025-11-12interpreter: move deprecation validation for *_pch to the interpreterDylan Baker
2025-11-12Interpreter: do basic validation of PCH files in interpeterDylan Baker
This moves the listification and string checking to the interpreter, as well as some basic size validation.
2025-11-11compilers: support prelinking with ClangAlois Wohlschlager
Clang supports prelinking using the same `-r` flag as GCC. There has been prior art in [1], which stalled at the time due to Clang inappropriately trying (and failing) to link libgcc_s. This issue does not occur any more with versions 14 and higher. [1] https://github.com/mesonbuild/meson/pull/8883
2025-11-11compilers: clang: allow ThinLTO with bfdSam James
bfd supports the 'gold' plugin API too, just the LLVM plugin is called 'LLVMgold'. Closes: https://github.com/mesonbuild/meson/issues/10798
2025-11-11vala: Remove space from --target-glib versionChris Mayo
If the dependency version contains a space: dependency('glib-2.0', version: '>= 2.40.0') Then the --target-glib version has a space: --target-glib ' 2.40.0' The quotes and space have no effect on valac. Tidy the output.
2025-11-10Fix detection of ifunc attribute on clang++Bruce Merry
clang++ seems to require the resolver function to have external linkage, so the test code that was used was failing even though clang does support the attribute. Closes #12413.
2025-11-09Fix inverted RTTI logic in Intel C++ compilerTudor Gradinaru
The IntelCPPCompiler was incorrectly adding -fno-rtti when RTTI was enabled (rtti=True) instead of when it was disabled. This change corrects the logic to match the behavior of GCC and Clang compilers, which properly add -fno-rtti when rtti=False. Fixes #15220
2025-11-09compilers: support GCC incremental LTOSam James
GCC 15 supports incremental LTO (caching). It's the same feature as Clang's ThinLTO caching. Unfortunately, for the Clang ThinLTO cache support, we chose a pretty vendor-specific option name, and I don't want to worry about deprecating that (-Db_thinlto_cache and -Db_thinlto_cache_dir) at this time, so... Wire -Db_thinlto_cache and -Db_thinlto_cache_dir for GCC in the obvious and natural way. Other notes: * GCC, unlike Clang, requires the cache dir to exist. If the user passes an invalid directory, that's on them, but for our default in meson-private, we should os.mkdir() it, so we do that now too. * I did wonder about adding -flto-partition=cache, but when I asked about this last year [0], the response was that it has too many caveats. Though Honza did recently [1] suggest it has some utility, so I don't know. I'll ask about it. [0] https://inbox.sourceware.org/gcc-patches/vjeanwm7b2jnedzmbwww4cy6jf4prty6ypxvz7x5d463xw2mys@bxzxuvgfaplf/ [1] https://inbox.sourceware.org/gcc-patches/aLnAGpln6SXbjV7e@kam.mff.cuni.cz/ Closes: https://github.com/mesonbuild/meson/issues/14428
2025-11-09compilers: gnu: prepare for more work in get_lto_compile_argsSam James
Stop early-returning as we're going to do more work in this function shortly for incremental LTO. Bug: https://github.com/mesonbuild/meson/issues/14428
2025-11-09compilers: gnu: clean up get_lto_link_argsSam James
... by calling self.get_lto_compile_args, as we expect the same arguments to be passed at both compile-time and link-time, and we're doing the exact same procedure to determine -flto=XXX. Bug: https://github.com/mesonbuild/meson/issues/9536
2025-11-09compilers: gnu: implement get_lto_link_argsSam James
Without this, we pass (say) `-flto=auto` at compile-time, but just `-flto` at link-time. See also https://gcc.gnu.org/PR114655 and the linked r12-824-g3cbcb5d0cfcd17, i.e. before GCC 12, we'd end up linking with 1 job. The clang mixin looks correct already. Closes: https://github.com/mesonbuild/meson/issues/9536
2025-11-06environment: handle machine file options sections with more than one subprojectDylan Baker
Instead of having a raw python exception, provide a helpful error message that `[sub:sub1:project options]` should just be `[sub1:project options]` No test is provided as this is basic error handling, and I felt it was not worth adding to our test runtime to test that we don't raise a raw exception. Fixes: #14222
2025-11-05interpreter: Move validation of BuildTarget(extra_files) to InterpreterDylan Baker
This gets us to the point that the build layer can assume it's getting valid inputs. This does two checks, an initial cheap check for generated sources, and then an I/O check via `source_strings_to_files`.
2025-11-05interpreter: move rust_api/rust_crate_type interaction to the interpreterDylan Baker
These are two ways to implement the same thing, and at the DSL level the `rust_abi` provides needed flexability, but at the lower level where a target is a thing, the `rust_crate_type` is still proving to be more useful. So, keep the `rust_abi` in the Interpreter and don't let it leak into the build layer.
2025-11-05interpreter: copy keyword arguments in `build_target`Dylan Baker
Because it's not clear how ownership is supposed to work here, and in the case of `both_libraries()`, if there are any mutations made to them then those propagate, which isn't what we want. I'd like to do some further refactoring here that would make this not necessary.
2025-11-05build: Use the Literal for rust_crate_typeDylan Baker
2025-11-05interpreter: add RUST_ABI to the build_target keyword argumentsDylan Baker
2025-11-05interpreter: Add rust_crate_type to kwargs TypeDictDylan Baker
2025-11-05interpreter: Move targetclass validation to top of build_targetDylan Baker
Why do work and then error out?
2025-11-05tests: Add a basic test for the codegen implementation codeDylan Baker
This just tests that it works, so it catches the previous bug. Not sure how to test this more thoroughly.
2025-11-05modules/codegen: fix typo bug introduced by rebaseDylan Baker
When the mechanism to set the name of methods was changed this bug was introduced.
2025-11-05ExternalProgram: add cmd_array to complete the offferingStéphane Cerveau
In case of python and especially in the case of pyInstaller where the python command is meson.exe runpython, it should not be full path to be used but cmd_array. Fixing #13834
2025-11-04Add build target keyword parameter 'build_subdir' [v8]Keith Packard
Place the build products in a directory of the specified name somewhere within the build directory. This allows use of the target that includes a specific directory name: #include <subdir/configure.h> This also allows creating targets with the same basename by using different subdirectory names. v2: Move build_subdir to Target class. Error if path separator in build_dir v3: Rename to 'build_subdir' to make it clear that the name is appended to a meson-specific build directory, and does not provide the user with a way to define the overall meson build hierarchy. Allow build_subdir to include path separators. Support 'build_subdir' for configure_file. build_subdir must not exist in the source directory and must not contain '..' Add documentation and tests v4: Rebase and prepare for version 1.9.1 Add failing test case when build_subdir is present in the project. Add release note snippet v5: Clarify wording on restrictions on the value of build_subdir. Use the same wording in each place this restriction is described. v6: Move path validation to shared function, validate_build_subdir, instead of duplicating the tests in two places. v7: Update version numbers to 1.10.0 Add TypedDict updates. Remove spurious build_subdir instance variable v8: Oops, missed one version number update. Signed-off-by: Keith Packard <keithp@keithp.com>
2025-11-03mlog: add a new log file with the setup logsStéphane Cerveau
Add meson-setup.txt to keep the configure log out of the debug logs.
2025-11-03backends: add CustomTargetIndexes to meson-{test,benchmark}-prereqPaolo Bonzini
If a CustomTargetIndex is passed as an argument to a test, running meson test (with no test glob) does not automatically build the custom_target before running the test, because CustomTargetIndex outputs are not added as prerequisites to the meson-test-prereq and meson-benchmark-prereq targets. Fixes: #14743 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-11-01Compilers: Add get_depfile_format() methodLuca Bacci
2025-10-31Avoid setting asycnio loop policy if possibleDylan Baker
The entire policy system has been deprecated in Python 3.14, and is slated for removal in 3.16. This has been caught by pylint, and is causing CI to fail. For our use case this is only relevant on Python 3.7 on Windows, as the default policy on 3.8 is set to the Proactor anyway.
2025-10-31Fix: Add OpenMP 6.0 macro definition to implementation tablejaideepkathiresan
2025-10-31dependencies: remove copy of self.libtype being setDylan Baker
This is a clear copy-n-paste or rebase error on my part.
2025-10-31ci: pin python for pylint to 3.13 to avoid "deprecated in 3.14"Eli Schwartz
It is not overridable via --py-version, astoundingly.
2025-10-31wrap: automatically utilize truststore, if it is installedEli Schwartz
https://truststore.readthedocs.io/ This library allows patching the stdlib ssl module to respect system certificates, which is a common source of "broken internet" for Windows users especially. Fixes: https://github.com/mesonbuild/meson/issues/15121
2025-10-31compilers: cpp: unset LIBCPP_HARDENING_MODE first for debugstlSam James
libc++ uses the same macro name, just with different values, for debugstl. If the distro or similar predefines a hardening mode lower than the mode debugstl wants (or in any other way not equal), we get an annoying redefinition warning. Closes: https://github.com/mesonbuild/meson/issues/13812
2025-10-31compilers: cpp: explain more wrt GCC versions vs assertionsSam James
Bug: https://github.com/mesonbuild/meson/issues/13978
2025-10-31compilers: cpp: stop trying to handle old libc++ for assertionsSam James
This has two problems: 1) it keeps breaking with Apple Clang (bug #14440, bug #14856) 2) it gets confused when using GCC with libc++ (a rare configuration) because compiler version != libc++ version There's no reason to keep catering for old libc++ here. The feature was somewhat immature in older libc++ anyway. Just rip it out and then we can go back and restore it for the niche case later. Bug: https://github.com/mesonbuild/meson/issues/14440 Bug: https://github.com/mesonbuild/meson/issues/14856 Closes: https://github.com/mesonbuild/meson/issues/13978