Closed Sympatron closed 11 months ago
In Rust it's common to have a libosdp-sys
crate that contains only the bindgen
-generated FFI and a libosdp
crate which contains the safe wrapper types and functions.
The libosdp-sys
crate would also need to contain all the C source and header files required to build the library.
I don't quite understand how it is currently meant to work.
Thank you for checking out the rust support. At this point rust support is super experimental and has many rough edges. I'd wait until the upcoming v3.0.0
of libosdp or v0.0.1
of osdpctl tool (rewritten in rust) before trying it out.
I have only been building it locally from sources so I didn't encounter this issue in crates.io crate. I have reproduced this issue locally, next crates.io release should fix it.
This issue should be fixed in the latest version v0.1.5 (https://crates.io/crates/libosdp)
Wow, that was quick! Thank you very much.
I already used libosdp
in a C project and it worked great. So I wanted to try it in Rust, too. Maybe I can help in the future.
What do you think about splitting the crate? I think it would be more idiomatic in Rust.
Sure, we can do that, but not right now. Are there any advantages in doing so? I mean apart from being idiomatic rust.
I haven't given much thought to this yet. Maybe the split would help manage different versions of C library against different versions of the "safe-rust" wrapper.
Looks like we do have a reason to have a libosdp-sys crate after all :)
https://users.rust-lang.org/t/sys-crate-c-source-files-from-a-different-directory/103657/11
The current documentation of the
libosdp
seems to be missing information. I am unable to compile my project with justcargo add libosdp
.Describe the bug I get this error:
Additional context The build script seems to be trying to copy the
osdp_config.h.in
file from thelibosdp
directory, but there are no C files in this directory.