You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I see that the README gives a tl;dr of what needs to be done to use cargo-c.
Compared to how simple it is to get started with cbindgen, there seem to be a lot of steps (and dependencies) required, and I wonder if it might be worth explaining to end-users why cargo-c is configured this way.
To generate headers with cbindgen requires very little ceremony at all. As long as you can get the executable from somewhere, you can just invoke it from within a rust project, and it will output a header file. You don't actually need to write a cbindgen.toml file (though it's often handy to do so), and you don't need to alter your project in any way if you don't want to (other than making sure there are at least some #[no_mangle] pub functions or constants).
So why does cargo-c require that we create a capi.rs – why can't it just use the same functions etc. that cbindgen uses? Why does cargo-c require adding #[cfg(feature="capi")] to the project? Why does it require* creation of a cbindgen.toml file, when cbdingden itself doesn't?
* Or maybe it's just a suggestion, the README isn't clear. It says "Remember to add a cbindgen.toml", but doesn't make clear whether this is a requirement or only useful to do.
I may also have a misunderstanding of what cargo-c is doing, but it also seems odd to me that it should require OpenSSL headers or git as prerequisites. If its job is to "produce and install a correct pkg-config file, a static library and a dynamic library, and a C header" – the main addition over what cargo and cbindgen can already do seems to be generation of a .pc file, and that's just a text generation task, isn't it? Why should cargo-c need access to git or OpenSSL for that? No doubt there are good reasons, but it might be helpful to make them clear. A simple .pc generator like this one doesn't require access to git tooling or OpenSSL headers, so why does cargo-c?
The text was updated successfully, but these errors were encountered:
So, I see that the README gives a tl;dr of what needs to be done to use cargo-c.
Compared to how simple it is to get started with cbindgen, there seem to be a lot of steps (and dependencies) required, and I wonder if it might be worth explaining to end-users why cargo-c is configured this way.
To generate headers with cbindgen requires very little ceremony at all. As long as you can get the executable from somewhere, you can just invoke it from within a rust project, and it will output a header file. You don't actually need to write a
cbindgen.toml
file (though it's often handy to do so), and you don't need to alter your project in any way if you don't want to (other than making sure there are at least some#[no_mangle] pub
functions or constants).So why does cargo-c require that we create a
capi.rs
– why can't it just use the same functions etc. that cbindgen uses? Why does cargo-c require adding#[cfg(feature="capi")]
to the project? Why does it require* creation of acbindgen.toml
file, when cbdingden itself doesn't?* Or maybe it's just a suggestion, the README isn't clear. It says "Remember to add a cbindgen.toml", but doesn't make clear whether this is a requirement or only useful to do.
I may also have a misunderstanding of what cargo-c is doing, but it also seems odd to me that it should require OpenSSL headers or
git
as prerequisites. If its job is to "produce and install a correct pkg-config file, a static library and a dynamic library, and a C header" – the main addition over what cargo and cbindgen can already do seems to be generation of a.pc
file, and that's just a text generation task, isn't it? Why should cargo-c need access to git or OpenSSL for that? No doubt there are good reasons, but it might be helpful to make them clear. A simple.pc
generator like this one doesn't require access to git tooling or OpenSSL headers, so why does cargo-c?The text was updated successfully, but these errors were encountered: