We are now several layers deep in working around problems in this language. Rust's bindgen cannot even bind headers that reference <stdio.h> without tripping a Rust warning due to https://github.com/rust-lang/rust-bindgen/issues/2807 As a result we need to manually suppress the warning. However, that warning is not available until newer Rusts, so trying to suppress the warning causes a different warning in older Rusts. https://boringssl-review.googlesource.com/c/boringssl/+/80707 attempted to work around this Rust bug by using cfg_version, but that broke the Chromium build because it is not part of Stable Rust. Stable Rust has not yet caught up to C89 in having some way to condition code on version. Instead, suppress the future lint by just suppresing unknown lints. Also add some comments so we remember where all this nonsense came from. This unbreaks the Chromium roll. Change-Id: I47dcedadae5695b2edab05dfbc08a9cd8cfafdc1 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/80747 Commit-Queue: Adam Langley <agl@google.com> Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com>
bssl-sys
A low-level binding crate for Rust that moves in lockstop with BoringSSL.
How it works
bssl-sys uses bindgen as part of the cmake build process to generate Rust compatibility shims for the targeted platform. It is important to generate it for the correct platform because bindgen uses LLVM information for alignment which varies depending on architecture.
To Use
-
Build
boringsslwith-DRUST_BINDINGS=<rust-triple>, which should match the Rust target triple when buildingbssl-sys. For example, to build on 64-bit Linux:cmake -GNinja -B build -DRUST_BINDINGS=x86_64-unknown-linux-gnu ninja -C build -
Install
bindgen. -
Install
cargo-deny.
After that, the bssl-sys crate can be built via cargo. By default, it looks for bindgen output and BoringSSL static libraries in the build directory. This can be reconfigured with BORINGSSL_BUILD_DIR environment variable. Note the environment variable is evaluated relative to rust/bssl-sys/src, so using an absolute path may be more convenient.