]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_codegen_cranelift/build_system/utils.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / compiler / rustc_codegen_cranelift / build_system / utils.rs
index da2a94a0a4ff84a3b307c22213e1813fd03ca55f..abc5bab49422468454948ea77f79891c6c5f873c 100644 (file)
@@ -121,10 +121,18 @@ fn build_cmd(&self, command: &str, compiler: &Compiler, dirs: &Dirs) -> Command
     }
 
     #[must_use]
-    pub(crate) fn fetch(&self, cargo: impl AsRef<Path>, dirs: &Dirs) -> Command {
+    pub(crate) fn fetch(
+        &self,
+        cargo: impl AsRef<Path>,
+        rustc: impl AsRef<Path>,
+        dirs: &Dirs,
+    ) -> Command {
         let mut cmd = Command::new(cargo.as_ref());
 
-        cmd.arg("fetch").arg("--manifest-path").arg(self.manifest_path(dirs));
+        cmd.env("RUSTC", rustc.as_ref())
+            .arg("fetch")
+            .arg("--manifest-path")
+            .arg(self.manifest_path(dirs));
 
         cmd
     }
@@ -271,5 +279,9 @@ pub(crate) fn copy_dir_recursively(from: &Path, to: &Path) {
 }
 
 pub(crate) fn is_ci() -> bool {
-    env::var("CI").as_deref() == Ok("true")
+    env::var("CI").is_ok()
+}
+
+pub(crate) fn is_ci_opt() -> bool {
+    env::var("CI_OPT").is_ok()
 }