Open linkmauve opened 2 years ago
How should meson know whether any given argument is vital to operation?
I think what you actually want to do is divide the dependency object in two:
dependencies: valgrind_dep.partial_dependency(link_args: true, links: true)
valgrind_dep.partial_dependency(compile_args: true, includes: true)
... except the unstable_rust module cannot actually process a dependency object? It seems to solely assume you are bindgen'ing a header that is in your project sources.
Yeah, right now the bindgen helper in the rust module assumes you're working with a local header (since that's what my use case was when I added it).
We really should figure out the includes though to rust targets automatically, but we really need to do some refactoring of the way dependencies work to fix that I think.
Are there any compile_args that rustc should receive?
Likely yes, but not that we can handle. Our handling of dependencies is currently very C-family centric. We assume that compile_args are C-like in basically every case.
That's what I thought, so it's easier to just ignore them altogether in rustc command lines.
Likely for now, yes. We should mark that ignoring them is a work around
I think this should be fixed with https://github.com/mesonbuild/meson/pull/11674 ?
Describe the bug When passing
dependency()
to a Rust target, if the .pc file includes a non-system header, meson passes it to therustc
invocation, making it fail. Here is an example using valgrind.pc:To Reproduce
test.rs
can contain anything, the issue happens before that.Expected behavior meson would not pass the
-I
torustc
, nor any other argument this compiler doesn’t know, and the compilation would continue properly.system parameters
meson --version
: 0.60.3ninja --version
if it's a Ninja build: 1.10.2