rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* help installing the correct version of bindgen
@ 2022-05-23 20:28 Nick Desaulniers
  2022-05-24 12:08 ` Miguel Ojeda
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Desaulniers @ 2022-05-23 20:28 UTC (permalink / raw)
  To: rust-for-linux, Miguel Ojeda

Re: https://github.com/KyleMayes/clang-sys/issues/138

via the documentation patch
https://lore.kernel.org/lkml/20220523020209.11810-21-ojeda@kernel.org/

So after a defconfig, I see in my .config:
CONFIG_HAVE_RUST=y
but not
RUST_IS_AVAILABLE=y

$ make LLVM=1 -j72 rustavailable
make: *** [Makefile:1802: rustavailable] Error 1

$ cargo install --locked --version $(scripts/min-tool-version.sh
bindgen) bindgen
...
     Ignored package `bindgen v0.56.0` is already installed, use
--force to override

$ RUST_BACKTRACE=1 bindgen scripts/rust-is-available-bindgen-libclang.h
thread 'main' panicked at 'called `Result::unwrap()` on an `Err`
value: "could not run executable `/android0/llvm-project/clang`:
Permission denied (os error 13)"',
/usr/local/google/home/ndesaulniers/.cargo/registry/src/github.com-1ecc6299db9ec823/clang-sys-1.0.3/src/support.rs:165:58
stack backtrace:
   0: rust_begin_unwind
             at
/rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at
/rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
   2: core::result::unwrap_failed
             at
/rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/result.rs:1749:5
   3: clang_sys::support::run_clang
   4: clang_sys::support::parse_version
   5: clang_sys::support::Clang::find
   6: bindgen::Builder::generate
   7: bindgen::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a
verbose backtrace.

So it looks like bindgen is using clang-sys-1.0.3?
And it's finding my source code checkout of clang from the llvm-project.

Looking at https://github.com/rust-lang/rust-bindgen/tree/11ae35089e4748b7e2a6f50f6bef7709af72e724
specifically
https://github.com/rust-lang/rust-bindgen/blob/11ae35089e4748b7e2a6f50f6bef7709af72e724/Cargo.toml#L52
it just says "use version 1". But the latest version of clang-sys is
1.3.2 according to https://crates.io/crates/clang-sys.

What gives?
-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-25  0:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 20:28 help installing the correct version of bindgen Nick Desaulniers
2022-05-24 12:08 ` Miguel Ojeda
2022-05-24 22:28   ` Nick Desaulniers
2022-05-24 23:39     ` Miguel Ojeda
2022-05-25  0:30       ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).