| Age | Commit message (Collapse) | Author |
|
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
|
|
This allows us to simplify running mypy, as we can just mypy the entire
utils module regardless of the platform we're using. As an added bonus,
this means we open one less module.
|
|
If any dependency has "sources" in it, the file from the dependency might
end up in the rustc command line.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Fixes #15019
|
|
Fixes #15054
|
|
- Split long expressions in () according to max line length
- Partly revert d028502 . Fixes #14935.
- Fixes #15032.
|
|
If a depedency includes object files, they have to be added to the doctest.
However, NinjaBackend was not running flatten_object_list on the doctest.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This reverts commit 9b1eb8b8ed434d1c2fdca0d8ac46b79c9b91bb0f.
It is not needed anymore since the pre-1.8 semantics were the
good ones.
Only leave in place the new and clearer testcase names.
|
|
This reverts commit 5ab871be5287aa5cce1e8dfdfb7c4a6b07b4f2f7.
It is not needed anymore since the pre-1.8 semantics were the
good ones.
|
|
If a subproject had its SubprojectHolder created, but was disabled, its options were not
parsed; therefore the subproject should not be checked for unknown options.
Fixes: #14969
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
|
|
Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
|
Can be tested with adding -stdlib=libc++ to C++ flags.
In file included from /usr/include/c++/v1/stdio.h:93:
In file included from /usr/include/c++/v1/__config:14:
In file included from /usr/include/c++/v1/__configuration/abi.h:15:
/usr/include/c++/v1/__configuration/platform.h:35:7: error: function-like macro '__has_include' is not defined
35 | # if __has_include(<features.h>)
| ^
/usr/include/c++/v1/__configuration/platform.h:48:5: error: function-like macro '__has_include' is not defined
48 | #if __has_include(<picolibc.h>)
| ^
1 warning and 2 errors generated.
'
|
|
|
|
Force multiline arguments when there is a trailing comma.
This is the behavior of muon.
Fixes #14721.
|
|
The test has a custom .h target that has the same name as the input in the
test's source directory. Sometimes a compiler could build a target that
intends to use the file in the source tree, but finds an incomplete
output of the custom_target, causing the test to fail.
To fix this, move the generated headers in a subdirectory of the build
tree.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The compiler and linker argument options are special and are only
added when the compiler is first discovered. Thus any project-specific
values in a child project will remain sitting in pending_options
after initialize_from_subproject_call; coredata needs to inform
the option store that they now exist.
Fixes: #14939
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
If the parent project has not enabled a language, the child project's
project-specific compiler option values are sitting in pending_options
after initialize_from_subproject_call, and the option store has to be
informed that they now exist.
Fixes: #14939
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Fix my misunderstanding of the code before commit aede231ef ("ninjabackend:
pass objects to generate_rust_target from non-Rust sources", 2025-07-29).
Object files were added by get_rust_compiler_deps_and_args() to both the
main target and the doctest command lines:
objs, od = self.flatten_object_list(target)
for o in objs:
args.append(f'-Clink-arg={o}')
deps.append(o)
therefore they now need to be passed as the final argument of
get_rust_compiler_deps_and_args() for both command lines as well.
Failure to do so causes problems building doctests when the main
target has objects as well.
Add a regression test as well.
Fixes: #14897
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Fixes another problem with running "meson configure" on Mesa.
Related: #14840
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This reverts commit 651aede977179c5fe382744e3dd91ca8e01d050c.
This was most certainly not acceptable.
|
|
|
|
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.
|
|
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.
|
|
Fixes #14840
|
|
|
|
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>
|
|
|
|
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.
|
|
|
|
When giving a dependency object as requires, allow to use the dependency from a
subproject (that is an InternalDepdency).
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|