From 7905fa92ce86167625d5b87c402bc0cef9497124 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Thu, 4 May 2023 11:24:58 +0000 Subject: [PATCH] Fix rustc test suite --- scripts/rustc-clif.rs | 4 +++- scripts/rustdoc-clif.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/rustc-clif.rs b/scripts/rustc-clif.rs index ab496a4a684..7ef3488672d 100644 --- a/scripts/rustc-clif.rs +++ b/scripts/rustc-clif.rs @@ -22,7 +22,9 @@ fn main() { let mut codegen_backend_arg = OsString::from("-Zcodegen-backend="); codegen_backend_arg.push(cg_clif_dylib_path); args.push(codegen_backend_arg); - if !passed_args.contains(&OsString::from("--sysroot")) { + if !passed_args.iter().any(|arg| { + arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true) + }) { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap())); } diff --git a/scripts/rustdoc-clif.rs b/scripts/rustdoc-clif.rs index 545844446c5..72024e0d494 100644 --- a/scripts/rustdoc-clif.rs +++ b/scripts/rustdoc-clif.rs @@ -22,7 +22,9 @@ fn main() { let mut codegen_backend_arg = OsString::from("-Zcodegen-backend="); codegen_backend_arg.push(cg_clif_dylib_path); args.push(codegen_backend_arg); - if !passed_args.contains(&OsString::from("--sysroot")) { + if !passed_args.iter().any(|arg| { + arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true) + }) { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap())); }