jobserver-rs
jobserver-rs copied to clipboard
Would it be safe to alias `c_int` ?
related to https://github.com/rust-lang/cc-rs/issues/721
I was wondering if it would be safe to alias c_int
along the lines of what is done here
https://github.com/tcharding/rust-bitcoinconsensus/blob/9b3496a5c827e99cf10debe2c36f7b20fd622cc4/src/types.rs
This would allow this lib to not depend on libc
on unix?
c_int
is not the only thing jobserver-rs uses libc
for; it's also invoking various functions via libc
. That would be a lot harder to work around.
If it saved substantial build time for many crates, it might be worth working around, but it's also not obvious how to do so.
it's also invoking various functions via
libc
. That would be a lot harder to work around.
Yes, you would have to manually define syscalls
using assembly, which really cannot be "vendored".
Though it's possible for cc
to vendor jobserver
since it only uses a subset of its API and already vendored windows-sys APIs and have function for making anonymous pipe on Unix and Windows.
If it saved substantial build time for many crates, it might be worth working around, but it's also not obvious how to do so.
If libc can bump its MSRV, then its build.rs
could be reduced in size and faster to compile.