You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your reply. LC_ALL=C bindgen scripts/rust_is_available_bindgen_libclang.h returns this:
thread 'main' panicked at 'Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-.so', 'libclang.so.', 'libclang-.so.'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (invalid: [])"', src/lib.rs:2117:31
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
If I set LIBCLANG_PATH to /usr/lib/llvm/15/lib64 in the environment variables, then it works correctly;
As for why it changed for you, did something change on your setup/environment? Perhaps try to use the expected versions to confirm it isn't related to that. @pvdrz may also know if something changed recently in bindgen.
I'm not being able to reproduce this with the same bindgen and rustc versions. However I have clang 14 instead, so I suspect clang 15 is the real culprit.
The error message you're seeing comes from the clang-sys crate which added clang 15 support in 1.4.0 and the latest bindgen release uses clang-sys 1.3.3
We can bump the clang-sys version and do a new bindgen release but then you'd have to update your bindgen version to that.
@fvalenduc In the patch above I used your GitHub handle for the Reported-by tag, but it would be nice to have at least your email, and ideally your real name too. I will Cc you on the patch there if you provide it to me.
Thanks for your work and sorry for my quite late answer. My name is
François Valenduc and my email address is ***@***.***
Le mar. 10 janv. 2023, 01:26, Miguel Ojeda ***@***.***> a
écrit :
No worries! Thanks for the reply -- the email address appears to be redacted, could you please try to separate the @ symbol or similar? Or maybe just send me a quick email to ojeda@kernel.org with it.
Activity
ojeda commentedon Dec 5, 2022
Given the other messages appear to be correct, I am guessing there is a problem with the value of
bindgen_libclang_version.Could you please show what the following returns?
Thanks for reporting this!
fvalenduc commentedon Dec 5, 2022
Thanks for your reply. LC_ALL=C bindgen scripts/rust_is_available_bindgen_libclang.h returns this:
thread 'main' panicked at 'Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-.so', 'libclang.so.', 'libclang-.so.'], set the
LIBCLANG_PATHenvironment variable to a path where one of these files can be found (invalid: [])"', src/lib.rs:2117:31note: run with
RUST_BACKTRACE=1environment variable to display a backtraceIf I set LIBCLANG_PATH to /usr/lib/llvm/15/lib64 in the environment variables, then it works correctly;
22:12 francois@pc-francois /usr/src/linux-6.1% LIBCLANG_PATH=/usr/lib/llvm/15/lib64 LC_ALL=C bindgen scripts/rust_is_available_bindgen_libclang.h
22:13 francois@pc-francois /usr/src/linux-6.1% make rustavailable
*** Rust compiler 'rustc' is too new. This may or may not work.
*** Your version: 1.65.0
*** Expected version: 1.62.0
*** Rust bindings generator 'bindgen' is too new. This may or may not work.
*** Your version: 0.59.1
*** Expected version: 0.56.0
Rust is available!
Previously, this was not needed.
[-]rust compiler not founf[/-][+]rust compiler not found[/+]ojeda commentedon Dec 5, 2022
Sorry about that -- the error comes from
bindgenitself and then the script gets confused.I think we could improve things on our side by catching any such error/panic and, in that case, print a proper message, possibly pointing the user to the docs at https://github.com/rust-lang/rust-bindgen#environment-variables and https://github.com/KyleMayes/clang-sys#environment-variables
As for why it changed for you, did something change on your setup/environment? Perhaps try to use the expected versions to confirm it isn't related to that. @pvdrz may also know if something changed recently in
bindgen.pvdrz commentedon Dec 6, 2022
@ojeda I don't remember any particular change but I'll try to bisect this and figure out what happened.
pvdrz commentedon Dec 6, 2022
I'm not being able to reproduce this with the same bindgen and rustc versions. However I have clang 14 instead, so I suspect clang 15 is the real culprit.
The error message you're seeing comes from the clang-sys crate which added clang 15 support in 1.4.0 and the latest bindgen release uses clang-sys 1.3.3
We can bump the clang-sys version and do a new bindgen release but then you'd have to update your bindgen version to that.
ojeda commentedon Dec 6, 2022
Thanks a lot -- I have linked it from our
bindgenlist (even if it may or may not be related).ojeda commentedon Jan 9, 2023
Submitted better error handling/docs for this in this series: https://lore.kernel.org/rust-for-linux/20230109204520.539080-1-ojeda@kernel.org/
ojeda commentedon Jan 10, 2023
@fvalenduc In the patch above I used your GitHub handle for the
Reported-bytag, but it would be nice to have at least your email, and ideally your real name too. I will Cc you on the patch there if you provide it to me.fvalenduc commentedon Jan 11, 2023
ojeda commentedon Jan 11, 2023
No worries! Thanks for the reply -- the email address appears to be redacted, could you please try to separate the
@symbol or similar? Or maybe just send me a quick email to ojeda@kernel.org with it.kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
8 remaining items
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation
kbuild: rust_is_available: add check for `bindgen` invocation