Unable to find libclang
What happened?
Currently I'm working on a Rust project that uses librocksdb-sys as a dependency and I'm unable to build the package when working inside a devbox shell though I can build it outside.
Steps to reproduce
- Get a Rust project with
librocksdb-sysas a dependency - Add
[email protected]and[email protected]to yourdevbox.jsonfile - Try to build the project using
cargo build
Command
No response
devbox.json
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.10.6/.schema/devbox.schema.json",
"packages": [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
],
"env": {
"NIX_HARDENING_ENABLE": ""
},
"include": [
"github:jetify-com/devbox-plugins?dir=rabbitmq"
],
"shell": {
"init_hook": [
],
"scripts": {
"test": [
"echo \"Error: no test specified\" && exit 1"
]
}
}
}
Devbox version
0.10.7
Nix version
nix (Nix) 2.18.1
What system does this bug occur on?
Linux (x86-64)
Debug logs
Relevant parts only:
thread 'main' panicked at /home/emlautarom1/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.65.1/lib.rs:603:31:
Unable to find libclang: "the `libclang` shared library at /usr/lib64/libclang.so.17.0.6 could not be opened: libLLVM-17.so: cannot open shared object file: No such file or directory"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Note that /usr/lib64/libclang.so.17.0.6 exists and it's a proper shared object. The issue seems to be when trying to use it from the devbox shell. What I don't understand is why is it picking up the native one instead of the one stored in the Nix store.
Also having this issue.
Apparently there's a nix hook rustPlatform.bindgenHook but its not clear how to instruct devbox to use hooks.
Worse than that, now my environment outside of devbox also fails until I restart my shell