Re: [libgpiod][bug] building rust bindings requires clang headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 09, 2023 at 11:48:12AM +0530, Viresh Kumar wrote:
> On 09-06-23, 10:37, Kent Gibson wrote:
> > 
> > When trying to build the libgpiod rust bindings on my Debian bullseye VM I get:
> > 
> >    Compiling gpiosim-sys v0.1.0 (/home/dev/libgpiod/bindings/rust/gpiosim-sys)
> > error: failed to run custom build command for `gpiosim-sys v0.1.0 (/home/dev/libgpiod/bindings/rust/gpiosim-sys)`
> > 
> > Caused by:
> >   process didn't exit successfully: `/home/dev/libgpiod/bindings/rust/target/release/build/gpiosim-sys-dfa257ecee3f0e2e/build-script-build` (exit status: 101)
> >   --- stdout
> >   cargo:rerun-if-changed=../../../tests/gpiosim/gpiosim.h
> > 
> >   --- stderr
> >   ../../../tests/gpiosim/gpiosim.h:7:10: fatal error: 'stdbool.h' file not found
> >   thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("../../../tests/gpiosim/gpiosim.h:7:10: fatal error: 'stdbool.h' file not found\n")', gpiosim-sys/build.rs:27:10
> >   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
> > 
> > The source of the error appears to be bindgen using libclang to parse
> > the gpiosim header, and that failing if the requisite headers are not
> > installed.
> > 
> > If I install them:
> > 
> > apt install libclang-common-11-dev
> > 
> > the build passes.
> > 
> > Can a dependency be added to the autotools configuration to check for
> > the availability of those headers if building the rust bindings?
> 
> I am not very experienced with autotools, but won't something like this help ?
> 
> AC_CHECK_HEADERS([stdbool.h], [], [HEADER_NOT_FOUND_LIB([stdbool.h])])
> 

I think that is what the AC_HEADER_STDBOOL already does - but that
detects the gcc header, and the additional check needs to be for the clang
header.

Unless you can convince clang to use the gcc headers?

Cheers,
Kent.

> > I would add it myself, but I'm not sure how - or if there is some better
> > solution.
> > The configure.ac already has a AC_HEADER_STDBOOL, but that checks for
> > the gcc headers, not clang.
> 
> -- 
> viresh



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux