Re: [PATCH V4 2/8] libgpiod: Add pre generated rust bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 27, 2022 at 11:30:24AM +0530, Viresh Kumar wrote:
> On 27-07-22, 13:31, Kent Gibson wrote:
> > On Wed, Jul 27, 2022 at 10:45:29AM +0530, Viresh Kumar wrote:
> > > On 27-07-22, 10:57, Kent Gibson wrote:
> > > > On Fri, Jul 08, 2022 at 05:04:55PM +0530, Viresh Kumar wrote:
> > > > > +## Updating bindings
> > > > > +1. Clone the source from
> > > > > +	<https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/>
> > > > > +2. run `cd libgpiod/bindings/rust/libgpiod-sys/`
> > > > > +2. run `cargo build --features generate`
> > > > > +3. Commit changes in `src/bindings.rs`
> > > > 
> > > > Those instructions do not force the regeneration of the bindings.
> > > 
> > > It does, just that the new file that got generated lands somewhere like this:
> > > 
> > > target/debug/build/libgpiod-sys-769f98853e1c0550/out/bindings.rs
> > > 
> > > and the end user crate will use this instead of the one in src/.
> > > 
> > 
> > But the instructions don't mention any of that, and the implication is
> > that src/bindings.rs will be regenerated.
> 
> Something like this is okay ?
> 
> diff --git a/bindings/rust/libgpiod-sys/README.md b/bindings/rust/libgpiod-sys/README.md
> index ea037d6d7803..7d4583519e87 100644
> --- a/bindings/rust/libgpiod-sys/README.md
> +++ b/bindings/rust/libgpiod-sys/README.md
> @@ -7,4 +7,5 @@ Automatically generated Rust FFI bindings via
>         <https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/>
>  2. run `cd libgpiod/bindings/rust/libgpiod-sys/`
>  2. run `cargo build --features generate`
> -3. Commit changes in `src/bindings.rs`
> +3. Copy the bindings 'cp target/debug/build/libgpiod-sys-###/out/bindings.rs src/bindings.rs'
> +4. Commit changes in `src/bindings.rs`
> 

Definitely clearer.

Still not sure how all this is easier than just calling bindgen directly,
but ok. I guess at least it specifies the appropriate-ish bindgen version.

Cheers,
Kent.




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux