From 32a6e9093dc85ba4f4f11ee91636e61cfb46aa3d Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 23 Jun 2021 23:47:32 -0400 Subject: [PATCH] Install bindgen in the build environment I tested locally that this only installs bindgen when new versions are published, not on every build. --- src/docbuilder/rustwide_builder.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/docbuilder/rustwide_builder.rs b/src/docbuilder/rustwide_builder.rs index abb73cff6..897e19031 100644 --- a/src/docbuilder/rustwide_builder.rs +++ b/src/docbuilder/rustwide_builder.rs @@ -147,6 +147,13 @@ impl RustwideBuilder { log::info!("continuing anyway, since this must be the first build"); } + let cargo = + Command::new(&self.workspace, self.toolchain.cargo()).args(&["install", "bindgen"]); + if let Err(err) = cargo.run() { + log::warn!("failed to install bindgen: {}", err); + log::info!("continuing anyway, since bindgen is non-essential"); + } + self.rustc_version = self.detect_rustc_version()?; if old_version.as_deref() != Some(&self.rustc_version) { self.add_essential_files()?;