diff options
Diffstat (limited to 'compiler/rustc_codegen_cranelift/build_system/build_backend.rs')
-rw-r--r-- | compiler/rustc_codegen_cranelift/build_system/build_backend.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler/rustc_codegen_cranelift/build_system/build_backend.rs b/compiler/rustc_codegen_cranelift/build_system/build_backend.rs index 6855c1a7f..e434c36f9 100644 --- a/compiler/rustc_codegen_cranelift/build_system/build_backend.rs +++ b/compiler/rustc_codegen_cranelift/build_system/build_backend.rs @@ -1,9 +1,9 @@ -use std::env; use std::path::PathBuf; -use super::path::{Dirs, RelPath}; -use super::rustc_info::get_file_name; -use super::utils::{is_ci, is_ci_opt, maybe_incremental, CargoProject, Compiler}; +use crate::path::{Dirs, RelPath}; +use crate::rustc_info::get_file_name; +use crate::shared_utils::{rustflags_from_env, rustflags_to_cmd_env}; +use crate::utils::{is_ci, is_ci_opt, maybe_incremental, CargoProject, Compiler, LogGroup}; pub(crate) static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif"); @@ -13,14 +13,16 @@ pub(crate) fn build_backend( bootstrap_host_compiler: &Compiler, use_unstable_features: bool, ) -> PathBuf { + let _group = LogGroup::guard("Build backend"); + let mut cmd = CG_CLIF.build(&bootstrap_host_compiler, dirs); maybe_incremental(&mut cmd); - let mut rustflags = env::var("RUSTFLAGS").unwrap_or_default(); + let mut rustflags = rustflags_from_env("RUSTFLAGS"); if is_ci() { // Deny warnings on CI - rustflags += " -Dwarnings"; + rustflags.push("-Dwarnings".to_owned()); if !is_ci_opt() { cmd.env("CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS", "true"); @@ -40,10 +42,10 @@ pub(crate) fn build_backend( _ => unreachable!(), } - cmd.env("RUSTFLAGS", rustflags); + rustflags_to_cmd_env(&mut cmd, "RUSTFLAGS", &rustflags); eprintln!("[BUILD] rustc_codegen_cranelift"); - super::utils::spawn_and_wait(cmd); + crate::utils::spawn_and_wait(cmd); CG_CLIF .target_dir(dirs) |