Skip to content

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

@dwrobel

Description

@dwrobel

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.202132.xyz-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:811:9

The problem is in bindgen v0.52.0 and was fixed by rust-lang/rust-bindgen#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fix addedA fix was added to an unreleased branch

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions