summaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)Author
2025-12-10cmake: Fix version kwarg being added to static_library targetsRobotLeopard86
2025-11-28interpreter: Add a slice() method to arraysJouke Witteveen
This can come in handy for instance when a custom target creates both headers and sources. Slicing the output of a `to_list()` call provides convenient access to just the headers or just the sources.
2025-11-23Require GCC 15.3 or newer for import std tests.Jussi Pakkanen
2025-11-23Condense directory names for rc1.Jussi Pakkanen
2025-11-23Add import std support to MSVC.Jussi Pakkanen
2025-11-23Add basic import std support for GCC.Jussi Pakkanen
2025-11-23Add test case for import std (uses #include for now).Jussi Pakkanen
2025-11-21rewrite: fix duplicate objects for predefined globalsPaolo Bonzini
Global objects are treated as UnknownValue(), but unlike other variables their object is created on every call to get_cur_value_if_defined() instead of coming from a dictionary. This causes the dataflow DAG to have multiple objects from the same object. Fix this by building the UnknownValues at interpreter construction time. Fixes: #15261 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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-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: support project(license_files: )Benjamin Gilbert
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-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-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-12compilers: generalize -fembed-bitcodePaolo Bonzini
Produce -Cembed-bitcode for Rust, and also disable bitcode generation when LTO is not enabled.
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-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-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-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-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-10-31Always check if found libraries are linkableSam James
We don't always check if a library is actually linkable because of concerns that a library may not be standalone, so linking against it may still have unresolved references. We can workaround that by building a shared library as a test rather than an executable, and in fact we already do that in a bunch of cases since bb5f2ca3da821d7a8e865cd55a8d5d638e0aab22. This comes up in particular with Fedora and dependency('atomic') because on x86_64, they provide a libatomic.so linker script (so our file existence check passes), but trying to use it later on will fail if the backing package isn't installed. _get_file_from_list has not been deleted because the Ninja backend's guess_library_absolute_path uses it. We might be able to change it to also use a link test but I've left that alone. Test notes: * The _test_all_naming unittest has been tweaked because we were using a blank file rather than an actual shared library, which (as expected), now fails. * I've also added a test for dependency('atomic') providing a result that can actually be linked against. I've not made it check generally whether dependency('atomic') finds something when we expect to (at least for now) as it'll involve some CI whack-a-mole. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2352531 Bug: https://github.com/mesonbuild/meson/issues/14946 Closes: https://github.com/mesonbuild/meson/issues/10936
2025-10-29cargo: use subproject() if a workspace member is in subprojects/Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29cargo: only create dependencies if there is a [lib] tablePaolo Bonzini
In the long term, dependencies that do not have a [lib] table will not create an invocation of override_dependency; do not expect there to be a handwritten meson.build that does it. In particular, this is the case for extra-dep-1-rs in the "rust/22 cargo subproject" test case, so change that to use the extra_deps mechanism instead to invoke the subproject. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29environment: move tool detection functions to a new modulePaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29coredata: move cmd_line.txt and command line handling to a new modulePaolo Bonzini
cmd_line.txt is not related to serialized data, in fact it's a fallback for when serialized data cannot be used and is also related to setting up argparse for command line parsing. Since there is no code in common with the rest of coredata, move it to a new module. Fixes: #15081 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29Add snippets.symbol_visibility_header() methodXavier Claessens
Defining public API in a cross platform library is painful, especially on Windows. Since every library have to define pretty much the same macros, better do it in Meson.
2025-10-29test cases/rust: adjust expected installed paths for shared librariesPaolo Bonzini
Make sure that they are checked against the correct extension on Darwin. Fixes: #7964 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29tests: don't skip HDF5 for Gentoo anymoreSam James
Stable HDF5 has a fixed .pc file, but we need to enable hdf5[cxx] for H5Cpp.h.
2025-10-28cargo: Add library API version into its nameXavier Claessens
It is required to have unique library names for rust_dependency_map to work. In the case we have foo crate in multiple versions, we have to make sure their .rlib file have a different name.
2025-10-27rust: drop +SUFFIX from crate namePaolo Bonzini
Allow multiple targets for the same crate name, which is useful when the same crate is used for both the host and the build machine. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-24modules/codegen: Add support for bison/byacc/yaccDylan Baker
This adds a similar wrapper to the Lex wrapper for yacc/bison/byacc. The interface is equivalent.
2025-10-24modules/codegen: Add wrapper for lex/flex/reflexDylan Baker
This module is a bit of a dumping ground for code generators, particularly ones that are important and non-trivial to wrap, either due to multiple implementations, major command line changes, or complex outputs (such as those that may output a directory structure). The initially provided method is for lex. It provides a simple wrapper that handles win_flex, reflex, flex, and generic lex.
2025-10-24Switch C# test to use gtk-sharp-3Balló György
2025-10-23build: allow building staticlib and rlib togetherPaolo Bonzini
Fixes: #15028
2025-10-23cargo: use both_libraries when appropriatePaolo Bonzini
Fixes: #15028
2025-10-20interpreter: Fix extract_object subproject validationXavier Claessens
Fixes: #12519
2025-10-20Fix typos in authorship informationVlad-Stefan Harbuz
2025-10-17test cases: add test for cargo workspacesPaolo Bonzini
Extracted from a patch by Xavier Claessens <xclaessens@netflix.com>, adjusted to make it compile with cargo.
2025-10-16rust: work around unintuitive behavior of -l:-bundlePaolo Bonzini
When a Rust target depends on an intermediate Rust library (.rlib) which itself has a dependency on a native static library, Meson's generated rustc command line failed to collect and propagate the search paths for these indirect native dependencies, leading to a linker error: error: linking with `cc` failed: exit status: 1 = note: rust-lld: error: unable to find library -l:libf.a collect2: error: ld returned 1 exit status The root cause is that the intermediate .rlib's metadata correctly stores the requirement to link the native library (via the -l flag), but it does not store the library's search path (the -L flag); the responsibility for providing the search path is therefore deferred to the final link command. Ensures that search paths for all transitive dependencies are collected, allowing the final linker invocation to find and correctly link the required native libraries. Reported-by: Martin Kletzander <nert.pinx@gmail.com> Fixes: 018d22482 ("ninjabackend: unify conversion from path to -L/-l", 2025-10-08) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-15backend/ninja: Ensure that a rust file is found when using StructuredSourcesDylan Baker
When a structured source contains non rust files, the backend may select such a file to treat as the main file. That doesn't work obviously, so instead filter the main file such that it must be a rust file.
2025-10-15revert local_program()Eli Schwartz
This reverts https://github.com/mesonbuild/meson/pull/15107 Explicit objections regarding the design were raised and not answered, so it shouldn't have been merged. It needs to be discussed and revisited.
2025-10-15Add interpreter kwarg to local_program()Xavier Claessens
2025-10-15Add local_program() functionXavier Claessens
2025-10-14pkgconfig: Improve handling of empty string depsEyal Itkin
Fix the original bug fix for #13950 to only warn about empty required strings, instead of failing the entire build. This will simplify the workflow for users that build the string from a possibly empty list, and save them the need for the added if-check. Signed-off-by: Eyal Itkin <eyal.itkin@gmail.com>
2025-10-11Avoid running overriden program to get its versionXavier Claessens
The parent `__init__` was setting cached_version back to None. This fixes a regression caused by https://github.com/mesonbuild/meson/pull/8885.
2025-10-08rust: add test case for issue #15020Marc-André Lureau
Do not link with link_whole/bundle, to show linking issue with Apple ld. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-08vala: Add method to get generated GIR from a build_targetDylan Baker
Fixes: #2296 Fixes: #4481 Fixes: #5968
2025-10-08format: fix indentation at beginning of argumentsCharles Brunet
Fixes #14998