summaryrefslogtreecommitdiffstats
path: root/third_party/rust/thiserror/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/thiserror/build.rs')
-rw-r--r--third_party/rust/thiserror/build.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/third_party/rust/thiserror/build.rs b/third_party/rust/thiserror/build.rs
index 0b995d8ea0..ad42f256f5 100644
--- a/third_party/rust/thiserror/build.rs
+++ b/third_party/rust/thiserror/build.rs
@@ -1,5 +1,6 @@
use std::env;
use std::ffi::OsString;
+use std::iter;
use std::path::Path;
use std::process::{self, Command, Stdio};
@@ -66,15 +67,15 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
let out_dir = cargo_env_var("OUT_DIR");
let probefile = Path::new("build").join("probe.rs");
- // Make sure to pick up Cargo rustc configuration.
- let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") {
- let mut cmd = Command::new(wrapper);
- // The wrapper's first argument is supposed to be the path to rustc.
- cmd.arg(rustc);
- cmd
- } else {
- Command::new(rustc)
- };
+ let rustc_wrapper = env::var_os("RUSTC_WRAPPER").filter(|wrapper| !wrapper.is_empty());
+ let rustc_workspace_wrapper =
+ env::var_os("RUSTC_WORKSPACE_WRAPPER").filter(|wrapper| !wrapper.is_empty());
+ let mut rustc = rustc_wrapper
+ .into_iter()
+ .chain(rustc_workspace_wrapper)
+ .chain(iter::once(rustc));
+ let mut cmd = Command::new(rustc.next().unwrap());
+ cmd.args(rustc);
if !rustc_bootstrap {
cmd.env_remove("RUSTC_BOOTSTRAP");
@@ -84,6 +85,7 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
.arg("--edition=2018")
.arg("--crate-name=thiserror")
.arg("--crate-type=lib")
+ .arg("--cap-lints=allow")
.arg("--emit=dep-info,metadata")
.arg("--out-dir")
.arg(out_dir)