| Age | Commit message (Collapse) | Author |
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
|
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.
|
|
We can't modify dict-valued kwargs (#14739) but this lets us at least read
them.
|
|
|
|
This is a new attribute released in GCC 15 and clang 18. It isn't
supported in C++ compilers at the moment.
|
|
Extracted from https://github.com/mesonbuild/meson/pull/15230
Co-authored-by: Charlie Hutcheson <chaz.hutcheson@gmail.com>
|
|
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>
|
|
Produce -Cembed-bitcode for Rust, and also disable bitcode
generation when LTO is not enabled.
|
|
|
|
What's left requires the Environment, so it will have to be handled in
the interpreter implementation for now.
|
|
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.
|
|
This just tests that it works, so it catches the previous bug. Not sure
how to test this more thoroughly.
|
|
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
|
|
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>
|
|
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>
|
|
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
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
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>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
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>
|
|
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.
|
|
Make sure that they are checked against the correct extension
on Darwin.
Fixes: #7964
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Stable HDF5 has a fixed .pc file, but we need to enable hdf5[cxx]
for H5Cpp.h.
|
|
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.
|
|
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>
|
|
This adds a similar wrapper to the Lex wrapper for yacc/bison/byacc. The
interface is equivalent.
|
|
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.
|
|
|
|
Fixes: #15028
|
|
Fixes: #15028
|
|
Fixes: #12519
|
|
|
|
Extracted from a patch by Xavier Claessens <xclaessens@netflix.com>,
adjusted to make it compile with cargo.
|
|
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>
|
|
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.
|
|
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.
|
|
|
|
|
|
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>
|
|
The parent `__init__` was setting cached_version back to None.
This fixes a regression caused by
https://github.com/mesonbuild/meson/pull/8885.
|
|
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>
|
|
Fixes: #2296
Fixes: #4481
Fixes: #5968
|
|
Fixes #14998
|