All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH V2 1/4] libgpiod: Generate rust FFI bindings
@ 2021-12-17  1:29 Gerard Ryan
  2021-12-17  5:50 ` Viresh Kumar
  0 siblings, 1 reply; 6+ messages in thread
From: Gerard Ryan @ 2021-12-17  1:29 UTC (permalink / raw)
  To: viresh.kumar
  Cc: alex.bennee, brgl, linus.walleij, linux-gpio,
	miguel.ojeda.sandonis, stratos-dev, vincent.guittot, warthog618,
	wedsonaf

Hello,

I submitted https://lore.kernel.org/all/CAKycSdDMxfto6oTqt06TbJxXY=S7p_gtEXWDQv8mz0d9zt3Gvw@mail.gmail.com/
and my attention was drawn here and have a few comments.

Firstly, I was wondering why you didn't create a separate *-sys crate
for these bindings?
see https://doc.rust-lang.org/cargo/reference/build-scripts.html#-sys-packages
for more information.

Secondly, I noticed when developing my aforementioned, patch that
`bindgen` adds quite a few dependencies that probably aren't needed by
the average consumer of this crate.
So I was wondering what are your thoughts about generating and
committing a bindings.rs then optionally using these dependencies via
a feature flag?

Lastly, With your `make` integration, it looks like we could also
remove the `cc` dependency by allowing `make` to build libgpiod
instead and just linking with that, instead of compiling libgpiod
twice.

Kind regards,

Gerard.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH V2 0/4] libgpiod: Add Rust bindings
@ 2021-12-02 11:22 Viresh Kumar
  2021-12-02 11:22 ` [PATCH V2 1/4] libgpiod: Generate rust FFI bindings Viresh Kumar
  0 siblings, 1 reply; 6+ messages in thread
From: Viresh Kumar @ 2021-12-02 11:22 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski
  Cc: Viresh Kumar, Vincent Guittot, linux-gpio, Kent Gibson,
	Miguel Ojeda, Wedson Almeida Filho, Alex Bennée,
	stratos-dev

Hi Bartosz,

This patch adds rust bindings for libgpiod v2.0, this is already partially
tested with the virtio rust backend I am developing, which uses these to talk to
the host kernel.

This is based of the next/post-libgpiod-2.0 branch.

I will be adding testing infrastructure later on, once other bindings are
converted to use gpiosim.

V1->V2:
- Added examples (I tested everything except gpiomon.rs, didn't have right
  hardware/mock device to test).
- Build rust bindings as part of Make, update documentation.

Thanks.

--
Viresh

Viresh Kumar (4):
  libgpiod: Generate rust FFI bindings
  libgpiod: Add rust wrappers
  rust: Add examples
  rust: Integrate building of rust bindings with make

 .gitignore                           |   5 +
 README                               |   8 +-
 TODO                                 |   8 -
 bindings/Makefile.am                 |   6 +
 bindings/rust/Cargo.toml             |  14 +
 bindings/rust/Makefile.am            |  29 ++
 bindings/rust/build.rs               |  60 ++++
 bindings/rust/examples/gpiodetect.rs |  38 +++
 bindings/rust/examples/gpiofind.rs   |  43 +++
 bindings/rust/examples/gpioget.rs    |  45 +++
 bindings/rust/examples/gpioinfo.rs   |  90 ++++++
 bindings/rust/examples/gpiomon.rs    |  73 +++++
 bindings/rust/examples/gpioset.rs    |  55 ++++
 bindings/rust/src/bindings.rs        |  16 +
 bindings/rust/src/chip.rs            | 197 ++++++++++++
 bindings/rust/src/edge_event.rs      |  78 +++++
 bindings/rust/src/event_buffer.rs    |  59 ++++
 bindings/rust/src/info_event.rs      |  70 +++++
 bindings/rust/src/lib.rs             | 268 +++++++++++++++++
 bindings/rust/src/line_config.rs     | 431 +++++++++++++++++++++++++++
 bindings/rust/src/line_info.rs       | 186 ++++++++++++
 bindings/rust/src/line_request.rs    | 217 ++++++++++++++
 bindings/rust/src/request_config.rs  | 118 ++++++++
 bindings/rust/wrapper.h              |   2 +
 configure.ac                         |  16 +
 25 files changed, 2121 insertions(+), 11 deletions(-)
 create mode 100644 bindings/rust/Cargo.toml
 create mode 100644 bindings/rust/Makefile.am
 create mode 100644 bindings/rust/build.rs
 create mode 100644 bindings/rust/examples/gpiodetect.rs
 create mode 100644 bindings/rust/examples/gpiofind.rs
 create mode 100644 bindings/rust/examples/gpioget.rs
 create mode 100644 bindings/rust/examples/gpioinfo.rs
 create mode 100644 bindings/rust/examples/gpiomon.rs
 create mode 100644 bindings/rust/examples/gpioset.rs
 create mode 100644 bindings/rust/src/bindings.rs
 create mode 100644 bindings/rust/src/chip.rs
 create mode 100644 bindings/rust/src/edge_event.rs
 create mode 100644 bindings/rust/src/event_buffer.rs
 create mode 100644 bindings/rust/src/info_event.rs
 create mode 100644 bindings/rust/src/lib.rs
 create mode 100644 bindings/rust/src/line_config.rs
 create mode 100644 bindings/rust/src/line_info.rs
 create mode 100644 bindings/rust/src/line_request.rs
 create mode 100644 bindings/rust/src/request_config.rs
 create mode 100644 bindings/rust/wrapper.h

-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-19  4:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17  1:29 [PATCH V2 1/4] libgpiod: Generate rust FFI bindings Gerard Ryan
2021-12-17  5:50 ` Viresh Kumar
2021-12-17 10:38   ` Miguel Ojeda
2021-12-17 10:49     ` Viresh Kumar
2021-12-19  4:04       ` Gerard Ryan
  -- strict thread matches above, loose matches on Subject: below --
2021-12-02 11:22 [PATCH V2 0/4] libgpiod: Add Rust bindings Viresh Kumar
2021-12-02 11:22 ` [PATCH V2 1/4] libgpiod: Generate rust FFI bindings Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.