aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-08-01modules/pkgconfig: Resolve dependencies in case of an internal dependencyCorentin Noël9-0/+70
When giving a dependency object as requires, allow to use the dependency from a subproject (that is an InternalDepdency).
2025-08-01gnome: make ToolType an alias and use itFlorian "sp1rit"​1-6/+5
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2025-08-01gnome: early exit from _gir_has_option if g-ir-scanner is executableFlorian "sp1rit"​1-1/+1
_gir_has_option runs g-ir-scanner --help | grep <option> to determine if the current version of g-ir-scanner supports a particular option. This already early exists if g-ir-scanner is a OverrideProgram, as it cannot be executed if it is (technically OverridePrograms can actually be executed during configure time, but not g-ir-scanner; as it depends on native modules). Do the same in case g-ir-scanner is an executable (it currently isn't but I might want to move it into one, as to avoid the rule-dependency issue with the aforementioned native module)
2025-08-01gnome: support generate_gir on cross buildsFlorian "sp1rit"​2-20/+47
This requires g-ir-scanner >=1.85.0, if this isn't the case we'll just fail.
2025-08-01gnome: Provide fallback for legacy gi-scanner without --versionFlorian "sp1rit"​1-4/+12
The --version argument was only added in g-ir-scanner 1.58, but the bionic ci still uses g-ir-scanner 1.56. Don't fail if that is the case and assume the version comparison is void.
2025-08-01gnome: Don't rely on gobject-introspection-1.0 anymoreFlorian "sp1rit"​1-12/+9
There isn't really any point in doing this, given that it doesn't provide any headers & libraries by itself and means projects that conditionally build introspection behind a feature only need to check for the existence of g-ir-scanner, not gobject-introspection-1.0 anymore.
2025-07-31Convert builddist to a Python script.Jussi Pakkanen2-19/+32
2025-07-31Guard against use of Unix tools.Jussi Pakkanen2-0/+71
2025-07-29Replace deprecated setup.py install commandCharles Brunet1-5/+16
In `run_meson_command_tests.py`. Replace it with `pip install .` if `pip` is available. Replace it with 'gpep517 install-from-source` if available. Else keep the old behaviour. Fixes #14522.
2025-07-29subprojects: add --filter optionPaolo Bonzini1-4/+9
2025-07-29subprojects: allow passing a fnmatch patternPaolo Bonzini1-3/+5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29build: allow non-Rust files in non-structured sourcesPaolo Bonzini3-4/+15
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29test cases: add test for mixed Rust/C++ executablePaolo Bonzini3-0/+17
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29docs: update for mixed Rust/non-Rust sourcesPaolo Bonzini2-4/+14
2025-07-29ninjabackend: pass objects to generate_rust_target from non-Rust sourcesPaolo Bonzini2-24/+20
Make generate_rust_target essentially a replacement from generate_link, plus the actual generation of rustc compiler arguments. Remove the parts (especially flatten_object_list and get_fortran_order_deps) that generate_target already does, and add any objects files that were produced by compiling non-Rust sources. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29build: allow picking 'rust' as a link_languagePaolo Bonzini2-1/+8
rustc only needs to be a linker if there are any Rust-ABI dependencies. Skip it whenever linking to a C-ABI dependency. This makes it possible for Meson to pick 'rust' whenever it sees Rust sources, but not whenever it sees Rust used by a dependency with "rust_abi: 'c'". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29build: use PIE for Rust as wellPaolo Bonzini1-0/+2
Ensure that mixed Rust/C executables compile the non-Rust translation units with a compatible relocation model. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29ninjabackend: handle specially TUs where compilation and linking happens ↵Paolo Bonzini4-0/+13
together Rust sources are not compiled separately: generation of the .a or .so or binary happens at the same time as compilation. There is no separate compilation phase where the .o file is created. In preparation for moving generate_rust_target where generate_link is now, make the compilation phase of generate_target skip them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29ninjabackend: remove one level of indentation from for loopPaolo Bonzini1-15/+16
Makes the code more similar to the earlier loop for generated sources. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29ninjabackend: move generate_generator_list_rules to common codePaolo Bonzini1-4/+3
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29build: reject invalid link_language for Rust targetsPaolo Bonzini4-0/+22
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29test cases: avoid missing_abi warning with recent RustPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29fix formatting issue in the previous commitEli Schwartz1-7/+5
2025-07-29c: add more exceptions to -Wno-*Henrik Lehtonen2-7/+29
Commit eca1ac18dc1978b15b500c9f1710c05cb1ccc0ec (#14252) added support for properly detecting the -Wno-vla-larger-than flag: a value must be specified for its positive form (-Wvla-larger-than=N), or GCC will exit with the error "missing argument to ‘-Walloc-size-larger-than=’". There is a handful of other -Wno-* flags whose positive form act in the same manner, but are not covered here: * -Wno-alloc-size-larger-than (GCC >=7.1.0) * -Wno-alloca-larger-than (GCC >=7.1.0) * -Wno-frame-larger-than (GCC >=4.4.0) * -Wno-stack-usage (GCC >=4.7.0) Add logic to treat these in the same way. Signed-off-by: Henrik Lehtonen <eigengrau@vm86.se>
2025-07-28docs: Reduce reading comprehension requirements for install functionsNirbheek Chauhan4-0/+11
As we are becoming more popular, the docs have to be clearer because we're being exposed to a wider base of users with highly variable English language ability. Some of those can be helped with translations, but for the rest, let's repeat ourselves. Fixes https://github.com/mesonbuild/meson/issues/14843
2025-07-25Add swift_module_name target argumentKatalin Rebhan5-6/+20
Allows explicitly setting the Swift module name. By default, this is set to the target name, which we might want to change for various reasons, for example when it isn't a valid module name, or when building two targets with the same module name (e.g. a host and native variant).
2025-07-25build/process_compilers: Skip throwing error for headersFlorian "sp1rit"​5-1/+52
Dependencies should be able to provide headers in its sources, even tho the target which uses the dependency may not use the language that header is for. A specific example is vala, where C and Vala dependencies share the same name, so in meson they ought to share the same dependency object in order to provide a Vala and/or C dependency depending on who is using it. Doing so right now however fails, if the project of the dependency user doesn't list vala in its used languages, even tho they might just be interested in the C part of the dependency.
2025-07-24Add suffix function to the fs moduleJouke Witteveen4-2/+35
2025-07-24Work around os.path.isabs bug in fs moduleJouke Witteveen2-3/+10
2025-07-24Restructure fs module in terms of os.pathJouke Witteveen2-54/+55
2025-07-24Add -parse-as-library to Swift library targetsKatalin Rebhan20-3/+67
2025-07-22mintro: Record rpath_dirs_to_remove in install_planDaniele Nicolodi2-3/+24
This is required by meson-python to fix RPATH entries when building a wheel.
2025-07-22unittests: allow running with pytest/unittest directlyChristoph Reiter2-40/+47
Currently the unittests are not runnable with pytest or unittest without going through the run_unittests.py wrapper, or setting certain env vars like MESON_UNIT_TEST_BACKEND. This has that downside that the common "pytest ..." fails and integration with things like VSCode fails too. To work around that we set everything that is needed to run the tests in __init__.py and run_unittests is only one more variant to invoke them by providing different defaults and settings. To make sure that pytest/unittest discover and run_unittests don't diverge implement an automatic test discovery in run_unittests to avoid hardcoding the tests to run there. There shouldn't be any functional changes.
2025-07-22Docs: standardize between list and array as arrayDylan Baker45-192/+191
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 Bonzini2-1/+27
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 Bonzini1-0/+4
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 targetsSahnvour3-2/+27
clang-tidy can't be ran as is on every source file and header
2025-07-19interpreter: Add a flatten() method to arraysDylan Baker4-1/+32
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órny2-2/+16
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 Bonzini2-1/+9
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úrca1-10/+14
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 Chauhan1-1/+15
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 Claessens2-0/+14
2025-07-18Fix use of a .pxi Cython include file as source from `configure_file`Ralf Gommers2-2/+9
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 Seurer1-1/+1
Avoids errors like `ERROR: Invalid variable name: 16bit_arithmetic_dir`.
2025-07-18Use os.path.normpath to make paths prettierVolker Weißmann1-1/+1
`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 Bonzini6-5/+41
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 Bonzini1-5/+5
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 Bonzini1-15/+25
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 Bonzini1-0/+4
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>