raymanfx / libv4l-rs

Video4Linux2 bindings for Rust
MIT License
152 stars 65 forks source link

Fails to build on Fedora "v4l2_pix_format_union_(anonymous_at_/usr/include/linux/videodev2_h_500_2)" is not a valid Ident #95

Closed faern closed 8 months ago

faern commented 8 months ago

When I try to build v4l2-sys-mit v0.2.0 on Fedora it fails with the error below. I have tried in a clean Fedora container with the same results. Works in a Ubuntu container.

   Compiling v4l2-sys-mit v0.2.0
error: failed to run custom build command for `v4l2-sys-mit v0.2.0`

Caused by:
  process didn't exit successfully: `/webcam/target/debug/build/v4l2-sys-mit-8a538bcaf39af04d/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.56.0/src/ir/context.rs:846:9:
  "v4l2_pix_format_union_(anonymous_at_/usr/include/linux/videodev2_h_500_2)" is not a valid Ident
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
raymanfx commented 8 months ago

You could try bumping bindgen to the latest upstream version and see whether this helps. Which version of Fedora is this, by the way?

faern commented 8 months ago

The latest version works (v4l2-sys-mit v0.3.0). It was just 0.2.0 that did not build. I just need to push my dependency to update this dependency then. I'm consuming v4l2-sys-mit via nokhwa :)

I run the latest Fedora (39) btw.

faern commented 8 months ago

Thas was apparently already brought up in https://github.com/l1npengtul/nokhwa/issues/147. Sorry for the noise!