Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
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.
|
|
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>
|
|
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>
|
|
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
|
|
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
|
|
Fixes #14840
|
|
|
|
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
|
|
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>
|
|
|
|
|
|
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`.
|
|
We're going to use this in the Python module as well.
|
|
|
|
Because we're going to have None once we move to more typed_kwargs
|
|
|
|
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
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Add support for passing a workspace dictionary and setting fields from it into
the dataclasses.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Add a few fields to "package" that support workspace inheritance.
Complete the Workspace dictionary.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Make the dataclasses closer to the TypedDicts.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Prepare to add type checking.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
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>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Path cannot be empty and according to Cargo documentation these are
always of bin type.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Extracted from a patch by Xavier Classens.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
|
|
|
|
A cargo package can build multiple crate types for the same library.
Using the same name in meson.override_dependency() fails.
[pbonzini: adjust documentation]
|
|
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.
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
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.
|
|
Fixes #14538.
Resolve the source file path before searching .editorconfig files,
to ensure parents up to the root directory are visited.
|
|
|
|
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 (!!!)
|
|
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.
|
|
|
|
coredata.get_external_link_args always returns a list
|
|
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.
|
|
|
|
|