Thread (5 messages) 5 messages, 3 authors, 2021-12-19

Re: [PATCH V2 1/4] libgpiod: Generate rust FFI bindings

From: Gerard Ryan <hidden>
Date: 2021-12-19 04:04:36

On 17-12-2021, 3:50 PM, Viresh Kumar wrote:
followed by wrapper crate to contain the wrappers around it.
If by wrapper you mean the safe/idiomatic wrapper then I agree.
When I do a cargo build there (for vhost-device crate), it will try to build the
dependencies as well, i.e. libgpiod, and I need to build the libgpiod's C files
as well there. There are good chances that I need to build from source and
libgpiod isn't installed there. How do I do it with Make ?
Hmmm, I was thinking `pkg-config` or make from this repo would be enough.
I haven't used it myself as I don't do much c/cpp work anymore, but
I've looked into https://vcpkg.io/ seems quite good.
and there is https://crates.io/crates/vcpkg to integrate it.
for now, perhaps `cc` is enough.

On 17-12-2021, 8:49 PM, Viresh Kumar wrote:
Perhaps, we should make it compile-only for the time being. Once the ABI is
stable enough, we can think of committing something to the source tree.
Sounds good.

On Fri, Dec 17, 2021 at 8:49 PM Viresh Kumar [off-list ref] wrote:
On 17-12-21, 11:38, Miguel Ojeda wrote:
quoted
Having optional pre-generated bindings may be good for some users,
e.g. libsqlite3-sys does it. I guess the main question is whether you
are willing to support/maintain it. Also consider cross-compilation.

But I wouldn't only provide pre-generated ones if you are using
`bindgen` anyway.
The pre-generated ones are normally good for kernel headers, where the userspace
ABI is stable and so we don't need to change the generated bindings soon.

But in our case here, the ABI isn't that stable and will likely change soon
again for the first few months after v2.0 is released for libgpiod.

Perhaps, we should make it compile-only for the time being. Once the ABI is
stable enough, we can think of committing something to the source tree.
quoted
In any case, I am not a Rust expert, so please take that with a grain of salt :)
:)

--
viresh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help