eclipse / paho.mqtt.rust

paho.mqtt.rust
Other
511 stars 102 forks source link

paho-mqtt v0.12.1 not compatible with >= clang-16 (due to paho-mqtt-sys v0.8.0 dependency) #204

Closed dwrobel closed 9 months ago

dwrobel commented 1 year ago

Compiling maho-mqtt-sys on Fedora 38 with clang 16.0.2 fails as follows:

 debug:Using bindgen for Paho C
  debug:clang version: clang version 16.0.2 (Fedora 16.0.2-1.fc38)
  debug:bindgen include path: -I/home/dw/projects/modbus/sun2000-homie/target/release/build/paho-mqtt-sys-69b2a6d9e5bbfd11/out/include

  --- stderr
  fatal: not a git repository (or any parent up to mount point /)
  Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
  gmake[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  thread 'main' panicked at '"__mbstate_t_union_(unnamed_at_/usr/include/bits/types/__mbstate_t_h_16_3)" is not a valid Ident', /home/dw/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:811:9

The problem is in bindgen v0.52.0 and was fixed by https://github.com/rust-lang/rust-bindgen/pull/2319 as a result the minimum version of bindgen compatible with clang-16 is v0.62.0.

Once I bump paho-mqtt-sys to 0.8.1 in https://github.com/eclipse/paho.mqtt.rust/blob/058c4f8e020b4741283e3abd8871a2a9c709a401/Cargo.toml#L25 then the compilation succeeded as it changes the dependency on bindgen from:

$ cargo tree -i bindgen
bindgen v0.52.0
[build-dependencies]
└── paho-mqtt-sys v0.8.0
    └── paho-mqtt v0.12.1

to:

$ cargo tree -i bindgen
bindgen v0.64.0
[build-dependencies]
└── paho-mqtt-sys v0.8.1
    └── paho-mqtt v0.12.1

Please consider updating this dependency and release updated version of paho.mqtt crate.

fpagliughi commented 10 months ago

Thanks for reporting this! I was away for most of the summer, but am starting back on some open source projects now, and will get this in with the next set of bug fixes.

vlnzrv commented 10 months ago

This issue saved my day, thank you @dwrobel