Closed xieyuschen closed 1 month ago
@xieyuschen
I like your proposal to let the build.rs
suggest that the user shall install clang
. Also, this would be a nice entry for our getting started documentation to install clang. Maybe also an FAQ entry: What shall I do when stddef.h
cannot be found?
@xieyuschen
I like your proposal to let the
build.rs
suggest that the user shall installclang
. Also, this would be a nice entry for our getting started documentation to install clang. Maybe also an FAQ entry: What shall I do whenstddef.h
cannot be found?
Sure, i think this is a good idea and let me help to create a PR for it. Besides, I cannot install clang
in my ubuntu as the dependencies are messy now and i don't want to tackle them at all.
For me, adding a clang_arg
call is enough, but it's of course rediculous to merge the path which only makes sense in my own desktop. Hence, I proposed we support an env var ICEORYX2_CLANG_ARG
in build.rs
to do so.
close as it could be solved by export BINDGEN_EXTRA_CLANG_ARGS
, see https://github.com/rust-lang/rust-bindgen?tab=readme-ov-file#environment-variables.
sorry for missing the bindgen documentation.
I have tried to read iceoryx2 in my weekend at my linux:
However, I encountered error when i tried to buld
iceoryx2/iceoryx2-pal/posix
. However, it's fine to build a.c
file withstddef.h
import. Hence, I tried to check more about it. I found the bindgen respects the/usr/include/x86_64-linux-gnu/
only, but thestddef.h
actually locates in/usr/lib/gcc/x86_64-linux-gnu/9/include
(I found it by callingecho | gcc -E -x c - -v
). Note that I haven't installedclang
due to the system issue.I proposed to add a check in
iceoryx2-pal/posix/build.rs
to check whether theclang
is installed, if not, let thebuild.rs
suggests users to install it. Or at least it reports some warnings so I can aware that I need to find thestddef.h
by myself and set up it the bindgen builder:How do you think about it? This should be an document issue for us to improve.