Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find libclang #2089

Open
emlautarom1 opened this issue May 27, 2024 · 2 comments
Open

Unable to find libclang #2089

emlautarom1 opened this issue May 27, 2024 · 2 comments
Labels
bug Something isn't working triage Issue needs triage

Comments

@emlautarom1
Copy link

emlautarom1 commented May 27, 2024

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

  1. Get a Rust project with librocksdb-sys as a dependency
  2. Add [email protected] and [email protected] to your devbox.json file
  3. 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
@emlautarom1 emlautarom1 added bug Something isn't working triage Issue needs triage labels May 27, 2024
@emlautarom1
Copy link
Author

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.

@croots
Copy link

croots commented Jun 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs triage
Development

No branches or pull requests

2 participants