Skip to content

Commit

Permalink
Have bindgen target correct rustc version
Browse files Browse the repository at this point in the history
It should match the version in rust-toolchain.toml. Unfortunately, it’s
not possible to reference that directly, so this adds comments to remind
contributors to update them together.
  • Loading branch information
sellout committed Dec 9, 2024
1 parent 884d81f commit f6857f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ impl fmt::Display for Error {

impl std::error::Error for Error {}

// `bindgen::RustTarget::Stable_*` is deprecated in bindgen >= 0.71.0, but we are constrained
// downstream by the version supported by librocksdb-sys. However, one of our CI jobs still manages
// to pull a newer version, so this silences the deprecation on that job.
#[allow(deprecated)]
fn bindgen_headers() -> Result<()> {
println!("cargo:rerun-if-changed=depend/zcash/src/script/zcash_script.h");

Expand All @@ -31,6 +35,9 @@ fn bindgen_headers() -> Result<()> {
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
// This should not reference a version newer than rust-toolchain.toml. See
// rust-lang/rust-bindgen#3049 for a potential future solution.
.rust_target(bindgen::RustTarget::Stable_1_73)
// Finish the builder and generate the bindings.
.generate()
.map_err(|_| Error::GenerateBindings)?;
Expand Down

0 comments on commit f6857f1

Please sign in to comment.