aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-08-10build: Throw an error instead of warning for sourceless targetsFlorian "sp1rit"​7-12/+10
We might run into an assertion failure down the road, if we don't fail here. Specifically project('proj') executable('bin', 'header.h') will throw during the ninja generation.
2025-08-10build: Also warn about header-only build targetsFlorian "sp1rit"​1-2/+2
Build targets that do not contain any actual source files and only headers should just be as affected as build targets with no sources specified whatsoever, so the 'Build target has no sources.' warning should be thrown for them too.
2025-08-10build: Ensure that linker requested in link_language is availableFlorian "sp1rit"​2-1/+6
Meson was running into an key lookup failure when evaluating the following: project('proj', 'c') executable('bin', link_language: 'cpp') and since 41eb18d also if the executable contained exclusively header sources.
2025-08-10options: ensure all build keys are changed to hostPaolo Bonzini2-1/+67
OptionStore.get_value did not change build keys to host when not cross-compiling. get_value_object_and_value_for also didn't when accessing self.augments. Make all accessors go through ensure_and_validate_key so that the conversion is done early. Otherwise, when "native: true" targets look up compiler options they do so with the "build.*" name, which does not exist when not cross compiling. This removes the distinction between get_value(), meant to be for global options, and get_value_for() which would be for project-specific options. While the distinction was added in commit d37d649b0 ("Make all Meson level options overridable per subproject.", 2025-02-13), it is not particularly useful and can be a source of bugs like the one in test_build_to_host_subproject testcase (corresponding to issue #14869). Fixes: #14869 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-10unittests: remove FakeCompilerOptionsPaolo Bonzini2-10/+1
It does not seem to be needed anymore, and the incomplete mock does not have for example the "yielding" attribute that is used by OptionStore.get_value_object_and_value_for. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-10minstall: allow missing symlink destination in `install_symlink`Konstantin Kharlamov2-8/+5
Currently there's an undocumented behavior where using `install_symlink()` to point to a file that does not exist results in failure `ERROR: Tried to install symlink to missing file`. Such behavior makes little sense because there's no reason the destination file should exist. The "destination file" may belong to another package, in particular to a package inside the same repo the Meson is controlling, in both cases there's no reason the other package should be present in the system, because installation does not typically happen into the system but rather to DESTDIR. And the file may not be present in DESTDIR either because it may belong to a different installation target (and different DESTDIR) even if it's in the same repo. Best backward-compatible decision here would be to just remove the check, which is done by this commit. Fixes: https://github.com/mesonbuild/meson/issues/12253
2025-08-10compiler,rust: No native-static-libs for wasm after 1.84Ruben Gonzalez1-0/+3
Rust 1.84 uses the latest emsdk 3.1.68 [1], and it fixed an issue with Emscripten dynamic linking and libc [2]. After that no native-static-libs in the output if running: ``` rustc --target=wasm32-unknown-emscripten --crate-type staticlib --print native-static-libs - < /dev/null ``` [1] https://github.com/rust-lang/rust/pull/131533 [2] https://github.com/rust-lang/libc/pull/4002
2025-08-10rewriter: Accept UnknownValue() in more placesVolker Weißmann4-6/+40
Fixes #14840
2025-08-10tests: host_machine instead of meson.host_machine()Volker Weißmann1-2/+2
2025-08-07cpp: handle Apple Clang deprecation of hardening macro for old versions tooSam James1-3/+4
a16ec8b0fb6d7035b669a13edd4d97ff0c307a0b changed the threshold to 17 for Apple Clang, but it needs to be 16 instead. Bug: https://github.com/mesonbuild/meson/issues/14440 Closes: https://github.com/mesonbuild/meson/issues/14856
2025-08-04build: fix introspection interpreter issue when project selects RustPaolo Bonzini3-2/+7
The introspection interpreter sometimes produces targets with no source files; BuildTarget will then pick a random compiler, according to the order in clink_langs. According to the comment in sort_clink, clink_langs are supposed to list languages from *lowest* to highest priority. However, process_compilers_late() process clink_langs in straight order and returns the first language; which is the one with lowest priority. This became visible with the addition of Rust to clink_langs, because Rust has limitation on the names of library targets, but the bug existed before. Fixes: e49f2f7283e1d9f18e2f5f54647c07287cd70339 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-02swift: Pass C++ base compile options to swiftcKatalin Rebhan2-4/+9
2025-08-02Add swift_interoperability_mode kwargKatalin Rebhan10-17/+47
2025-08-01dependencies: fill in defaults from DEPENDENCY_KWS when generating keyDylan Baker1-1/+5
Otherwise we run into issues where the key doesn't match when some values are empty and others are not. These values can be empty when they come from `find_external_dependency`, but will be initialized to a default when they come from the `Interpreter`.
2025-08-01interpreter: move dependency kwargs to shared moduleDylan Baker3-2/+9
We're going to use this in the Python module as well.
2025-08-01interpreter: Add annotation for existing keyword arguments of dependencyDylan Baker2-1/+6
2025-08-01dependencies: Allow None in dep_identifierDylan Baker1-2/+2
Because we're going to have None once we move to more typed_kwargs
2025-08-01Bump version number for rc1.1.9.0rc1Jussi Pakkanen2-2/+2
2025-08-01vala: Only pass the soname to the --shared-library argumentCorentin Noël1-1/+1
This argument requires only the filename, not the path and the actual library we want to use is the one defined with the soname. Closes: https://github.com/mesonbuild/meson/issues/14803
2025-08-01unittests/cargotests: add tests for workspace inheritancePaolo Bonzini1-1/+70
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: typing: describe which entries can be inherited from a workspacePaolo Bonzini1-21/+21
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: manifest: support workspace inheritancePaolo Bonzini2-11/+111
Add support for passing a workspace dictionary and setting fields from it into the dataclasses. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: typing: add missing fieldsPaolo Bonzini1-0/+5
Add a few fields to "package" that support workspace inheritance. Complete the Workspace dictionary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: change init-time computation to lazy propertiesPaolo Bonzini4-33/+44
Make the dataclasses closer to the TypedDicts. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: use _raw_to_dataclass for ManifestPaolo Bonzini1-15/+14
Prepare to add type checking. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: move library autodetection to Manifest.from_rawPaolo Bonzini2-17/+22
It makes sense to make the lib argument optional, so do the same for all the others as well because optional arguments must all go together. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01unittests/cargotests: add tests for Cargo.toml parsingPaolo Bonzini2-0/+185
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: fix path and crate-type for executable targetsPaolo Bonzini1-1/+30
Path cannot be empty and according to Cargo documentation these are always of bin type. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: move dataclasses out of interpreter modulePaolo Bonzini2-332/+277
Extracted from a patch by Xavier Classens. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: create dataclasses for Cargo.lockPaolo Bonzini3-40/+133
Start introducing a new simpler API for conversion of TypedDicts to dataclasses, and use it already for Cargo.lock. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: remove Fixed* dictionariesPaolo Bonzini2-99/+7
Create the dataclasses directly from the raw dictionaries, without an intermediate step. Extracted from a patch by Xavier Classens. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: move _convert_manifest to Manifest class, use keyword argsPaolo Bonzini1-18/+18
There are really many arguments, so use keyword arguments to be safe. While at it, move the function inside the dataclass. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: move TypedDicts for Cargo.toml to "raw" modulePaolo Bonzini3-194/+208
Fix a few issues: * Cargo.lock's version is an int * Different BuildTargets have different types for the argument of from_raw Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01cargo: Move toml implementation into its own moduleXavier Claessens2-48/+51
2025-08-01cargo: Convert PackageState into a dataclassXavier Claessens1-6/+6
2025-08-01cargo: Reconfigure when any Cargo.toml is modifiedXavier Claessens2-0/+5
2025-08-01cargo: Use -rs suffix only for rust ABIXavier Claessens4-11/+19
A cargo package can build multiple crate types for the same library. Using the same name in meson.override_dependency() fails. [pbonzini: adjust documentation]
2025-08-01wrap: wraps from subprojects can replace directories found with no wrapXavier Claessens5-6/+42
If main project finds a directory subprojects/foo with no corresponding foo.wrap, it creates a dummy PackageDefinition for it. If we later find a subproject that has foo.wrap, replace the dummy wrap with it. This happens for example when wrap-redirect have been deleted. It also happens for subprojects downloaded from some Cargo.lock which does not create a wrap-redirect. Avoid loading the same location twice, which can happen when preparing cargo subprojects.
2025-08-01unittests/cargotests: fix pylintPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-08-01Condense test directory names for 1.9.Jussi Pakkanen165-45/+46
2025-08-01format: add --source-file-path argument for stdinCharles Brunet3-2/+27
Fixes #14539. Otherwise, .editorconfig is read from current working directory, and there is no way to know what file name to filter to choose the right section of editor config.
2025-08-01format: use absolute paths to find .editorconfigCharles Brunet1-1/+1
Fixes #14538. Resolve the source file path before searching .editorconfig files, to ensure parents up to the root directory are visited.
2025-08-01call determine_rpath_dirs only when linker requires itCharles Brunet7-80/+65
2025-08-01Optimize determine_rpath_dirsCharles Brunet1-34/+40
When generating targets in ninja backend for my project, `determine_rpath_dirs` is the second most expensive function call. Here are some optimizations: - early exit when iterating for rpath arguments - compute system_dirs and external_rpaths once per target instead of recomputing them for every link args of the target (!!!)
2025-08-01move rpath functions from Backend to BuildTargetCharles Brunet3-111/+115
It is more logical, since those functions depend on a build target, and do not require anything specific to the backend. Furthermore, it will allow us to call determine_rpath_dirs from the linker in a following commit, without the need to depend on the backend.
2025-08-01typing: determine_rpath_dirs is only called with BuildTargetCharles Brunet1-6/+3
2025-08-01simplify get_external_rpath_dirsCharles Brunet1-6/+2
coredata.get_external_link_args always returns a list
2025-08-01wrap: Add basic sftp support to wrap.get_data()Amp Tell1-0/+17
This requires any credentials to be supplied in the url, or some other means of authentication (such as an identity file configured for the user) to be used. Supplying a password in the URL is not supported.
2025-08-01wrap: Break out hash_file() functionAmp Tell1-4/+7
2025-08-01wrap: Slightly improve error message on wrap get failureAmp Tell1-1/+1