mesonbuild / mesonbuild/wrapdb
luajit adds source to kwargs breaking linking with Rust
- Dominant language
- Meson
- Stars
- 118
- Forks
- 298
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 24
Description
The LuaJIT wrap adds the `luajit_h` target as a source, thus adding the file `luajit.h` when specifying luajit as a dependency. This is usually not a problem for C/C++, but when linking to Rust, this will cause the compilation to fail with "ERROR: Rust target FOO contains a non-rust source file.". The [offending code](https://github.com/mesonbuild/wrapdb/blob/master/subprojects/packagefiles/luajit/src/meson.build#L169) is:
```python
luajit_dep_kwargs = {
'include_directories': include_directories('.'),
'sources' : luajit_h,
'variables' : {
'INSTALL_CMOD' : install_cmod,
'INSTALL_LMOD' : install_lmod,
},
}
```
My code only hits the issue with the fallback, it works fine with the system library.
Contributor guide
No contributing guide indexed for this repository
Research direction
Open subprojects/packagefiles/luajit/src/meson.build around line 169 and inspect how luajit_dep_kwargs is assembled. Reproduce the fallback dependency with a Rust target, then verify that the dependency no longer contributes luajit.h as a source and the Rust target can compile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100