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

0.47.0 introduced a dependency on libclang #434

Open
DaGaMs opened this issue Jul 5, 2024 · 3 comments
Open

0.47.0 introduced a dependency on libclang #434

DaGaMs opened this issue Jul 5, 2024 · 3 comments

Comments

@DaGaMs
Copy link

DaGaMs commented Jul 5, 2024

I tried to upgrade my code's dependency on rust-htslib to version 0.47.0 (from 0.46.0) but now when I do cargo build -r on Linux (eg in a docker container) without clang, I get:

thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.69.4/lib.rs:622:31:

Unable to find libclang: "couldn't find any valid shared libraries matching: ['[libclang.so](http://libclang.so/)', 'libclang-*.so', '[libclang.so](http://libclang.so/).*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"

Reverting back to 0.46.0 fixes the issue. I'm not sure what happened here, but I suspect it was not intentional?

@moold
Copy link

moold commented Jul 9, 2024

I also got a cargo build --release problem when I used rust-htslib v0.47.0, reverting to v0.46.0 solved the problem.

  --- stderr
  ./htslib/htslib/hts.h:31:10: fatal error: 'stddef.h' file not found
  thread 'main' panicked at hts-sys-2.1.4/build.rs:275:14:
  Unable to generate bindings.: ClangDiagnostic("./htslib/htslib/hts.h:31:10: fatal error: 'stddef.h' file not found\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@fxwiegand
Copy link
Contributor

fxwiegand commented Jul 9, 2024

I think i also ran into this a while ago. @FelixMoelder i think this might be caused by this recent change:

hts-sys = {version = "2.1.4", default-features = false, features = ["bindgen"]}

@DaGaMs
Copy link
Author

DaGaMs commented Jul 9, 2024

So, this is probably related to this feature request in bindgen:

rust-lang/rust-bindgen#918

What I don't understand is: why does 0.46.0 work but 0.47.0 doesn't? If dependency on libclang.a is a general issue of bindgen, then why does 0.46.0 build fine for me? And vice versa, why does adding one header to hts-sys suddenly break things? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants