1
Fork 0

Merge commit '8f9ac9c22d' into sync_cg_clif-2023-08-09

This commit is contained in:
bjorn3 2023-08-09 18:20:12 +00:00
commit 37751893cc
20 changed files with 194 additions and 110 deletions

View file

@ -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, LogGroup};
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");
@ -18,11 +18,11 @@ pub(crate) fn 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");
@ -42,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)