Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindgen dependency requirement? #255

Open
plaes opened this issue May 20, 2024 · 0 comments
Open

Bindgen dependency requirement? #255

plaes opened this issue May 20, 2024 · 0 comments

Comments

@plaes
Copy link
Contributor

plaes commented May 20, 2024

Attempt to run gen.sh straight from current HEAD fails with following error:

+ for s in mbr s112 s113 s122 s132 s140
+ ./nrf-softdevice-gen/target/release/nrf-softdevice-gen ./softdevice/mbr/headers ./nrf-softdevice-mbr/src/bindings.rs
thread 'main' panicked at /home/plaes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.55.1/src/ir/context.rs:838:9:
"sd_mbr_command_t_union_(unnamed_at__/tmp/nrf_mbr_h_219_3)" is not a valid Ident
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

First version of bindgen which works is 0.62, though generated bindings seem to have some minor incompatibilities regarding newly introduced _bitfield_align_1 field:

Current binding in git generated with 0.55.2:

#[doc = "@brief GATT Characteristic Properties."]
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct ble_gatt_char_props_t {
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>,
}

Generated with 0.62:

#[doc = "@brief GATT Characteristic Properties."]
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct ble_gatt_char_props_t {
    pub _bitfield_align_1: [u8; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
}

Upstream PR which adds the extra alignment field is rust-lang/rust-bindgen#1950 and was introduced in bindgen 0.57.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant