From d6a6fdfcc7ede483a8dad59f603d9a3683584493 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 3 May 2019 14:59:01 -0700 Subject: [PATCH] Don't assert rustfmt succeeds Not all environments have it so only run it and hope it succeeds. --- crates/web-sys/build.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/web-sys/build.rs b/crates/web-sys/build.rs index dd720c76..f9014bf0 100644 --- a/crates/web-sys/build.rs +++ b/crates/web-sys/build.rs @@ -112,15 +112,11 @@ fn try_main() -> Result<(), failure::Error> { println!("cargo:rustc-env=BINDINGS={}", out_file_path.display()); // run rustfmt on the generated file - really handy for debugging + // + // This is opportunistic though so don't assert that it succeeds. println!("cargo:rerun-if-env-changed=WEBIDL_RUSTFMT_BINDINGS"); if env::var("WEBIDL_RUSTFMT_BINDINGS").ok() != Some("0".to_string()) { - let status = Command::new("rustfmt") - .arg(&out_file_path) - .status() - .context("running rustfmt")?; - if !status.success() { - println!("cargo:warning=rustfmt failed: {}", status) - } + drop(Command::new("rustfmt").arg(&out_file_path).status()); } Ok(())