Crust of Rust: Build Scripts and Foreign-Function Interfaces (FFI)

Published: 24 September 2022
on channel: Jon Gjengset
38,788
880

This time we go over Cargo build scripts and Rust foreign-function interfaces, including looking at some widely used *-sys crates. We also wrote our own bindings against the libsodium C library: https://doc.libsodium.org/. You can find the Cargo book entry for build scripts at https://doc.rust-lang.org/cargo/refer..., and the nomicon entry for ffi at https://doc.rust-lang.org/nomicon/ffi....

Live version with chat:    • Crust of Rust: build.rs and FFI (live...  

0:00:00 Introduction
0:02:58 libsodium
0:04:28 Build scripts
0:07:00 OUT_DIR
0:18:01 cargo directives
0:34:09 Build script sandboxing
0:36:36 libgit2-sys
0:54:31 bindgen
1:08:08 libssh2-sys
1:14:38 openssl-sys
1:19:50 libsodium-sys
1:21:29 Writing our own libsodium-sys
1:40:11 Wrapping crypto_generichash
2:02:57 Reverse FFI
2:09:30 autocfg
2:12:14 cbindgen and cxx

The Rustacean Station Discord server is at   / discord  .


Watch video Crust of Rust: Build Scripts and Foreign-Function Interfaces (FFI) online without registration, duration hours minute second in high quality. This video was added by user Jon Gjengset 24 September 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 38,78 once and liked it 88 people.