Skip to content

doesn't compile because bindgen doesn't generate some struct fields #17

Description

@d4mn13l

Hi,
i tried using this library but it does not compile because bindgen fails to generate the fields of the whisper_full_params struct.

to reproduce, run:
$ cargo init
$ cargo add whisper-cpp-plus
$ cargo build

The full cargo error log is here:
https://gist.github.com/d4mn13l/4988f839366fe48f3d058765ed596308
but all of them are "no field ... on type whisper_full_params".

The definition of whisper_full_params in the generated bindings.rs (at target/debug/build/whisper-cpp-plus-sys-(random value)/out/) looks like this:

#[repr(C)]
#[derive(Debug,Default, Copy, Clone)]
pub struct whisper_full_params {
    pub _address: u8,
}

which is what bindgen generates for a forward declared struct.

I also tested the latest commit on the main and chore/whisper-cpp-1.9 branch but the same thing happened.

I am pretty sure that this happens because the original struct in the whisper.cpp library is first forward declared and only later defined. From what i've tested bindgen 0.69 (which is used here) doesnt handle that properly, but bindgen 0.72+ does.

Ive tried forking and bumping the bindgen version to 0.72 but that lead to different build problems.

Im very confused because i dont understand how this could be a bug in either bindgen or this library that nobody had noticed but also i dont know what i could be doing wrong.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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