This time we go over Cargo build scripts and Rust foreign-function interfaces, including looking at some widely used *-sys crates.
17 Comments
Leave a Reply
You must be logged in to post a comment.
This time we go over Cargo build scripts and Rust foreign-function interfaces, including looking at some widely used *-sys crates.
You must be logged in to post a comment.
I feel like there is gonna be a r/whoosh joke here
Great one, Jon. Thanks a lot!!
Yeeeessssss
Watching this at night, I appreciate your care to keep the s reen dark on top of the excellent content!
My brother, thanks for the stream, it makes my day brighter
Hey Jon, I bought the rustaceans book, and I am loving it
Thanks a lot Jon.
He's back!!!
Just got on to some of your videos recently, thanks for making them! Unfortunately my job is in a rust-prohibitive ecosystem but in my own time the rust learning has been magic
Can't you just use non_exhaustive types or add a private member instead of using empty enums for opaque types? Tbh I'm kinda surprised that even works properly since an empty enum is more or less equivalent to the never type so I'd think the compiler considers it impossible for any such values to exist and would optimize accordingly. I guess if it's always behind a pointer it doesn't make a difference and there's not really anything else you can do wrong but it still seems very odd to me.
Hi Jon! Thanks, I learned something new! I didn't know the "vendored"-feature convention before (seen in the libgit2-sys crate). I'll look deeper into it as I'm also about to create a *-sys-crate for a C library.
PS: We had a short in-person chat at RustConf 😀
Thanks!
Thanks a lot.
API/ABI incompatible changes in C are big pain as well.
If the empty enum for opaque types is a common pattern, should rust consider introducing a less hacky way to do it? Maybe "pub opaque type_name;"
Thank you Jon! I've been needing to dig into these topics
Hey, always nice to see some in-depth Rust from you.
For the build scripts, I do get that it's slightly concerning that you're literally running arbitrary code any time you compile anything that has some dependency with a build script.. on the other hand it's the same issue you get from just using any external library at all, the only thing of note really is that maybe you shouldn't give cargo full access to your system, assuming you're already sandboxing other programs which realistically, people probably are not doing anyway and probably is the bigger issue here.
But for sure, there's more room for accidents here since you're likely to have a legitimate purpose to mess around outside of the project directory.