Skip to content

Target-specific bindings #62

@fpagliughi

Description

@fpagliughi

The pre-generated bindings were created on an x86_64 Linux machine. These are in paho-mqtt-sys/bindings/bindings_paho_mqtt_c_<version>.rs.

There seems to be problems using these bindings with other targets, particularly 32-bit ones, such as ARM v7 (RPi, BeagleBone, etc). The different word size causes mis-alignment of the C structs passed back and forth from the Paho C lib, and in the case of structs containing pointers, these get junk values causing segfaults.

The quick-fix, for now, is for client applications to use the "build_bindgen" feature of the library to always regenerate the bindings on every build.

A better fix, going forward might be to use target-specific bindings like *bindings_paho_mqtt_v_<version>-<target>.rs, like:

bindings_paho_mqtt_c_1.3.1-armv7-unknown-linux-gnueabihf.rs

The problem with this approach is that bindings need to be produced for every possible target in order for the default build to always succeed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions