Disable incr comp globally on CI
This commit is contained in:
parent
41d547892c
commit
e7bc81cc77
@ -2,6 +2,8 @@ use std::env;
|
|||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
|
use super::utils::is_ci;
|
||||||
|
|
||||||
pub(crate) fn build_backend(
|
pub(crate) fn build_backend(
|
||||||
channel: &str,
|
channel: &str,
|
||||||
host_triple: &str,
|
host_triple: &str,
|
||||||
@ -14,12 +16,9 @@ pub(crate) fn build_backend(
|
|||||||
|
|
||||||
let mut rustflags = env::var("RUSTFLAGS").unwrap_or_default();
|
let mut rustflags = env::var("RUSTFLAGS").unwrap_or_default();
|
||||||
|
|
||||||
if env::var("CI").as_ref().map(|val| &**val) == Ok("true") {
|
if is_ci() {
|
||||||
// Deny warnings on CI
|
// Deny warnings on CI
|
||||||
rustflags += " -Dwarnings";
|
rustflags += " -Dwarnings";
|
||||||
|
|
||||||
// Disabling incr comp reduces cache size and incr comp doesn't save as much on CI anyway
|
|
||||||
cmd.env("CARGO_BUILD_INCREMENTAL", "false");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if use_unstable_features {
|
if use_unstable_features {
|
||||||
|
@ -2,6 +2,8 @@ use std::env;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process;
|
use std::process;
|
||||||
|
|
||||||
|
use self::utils::is_ci;
|
||||||
|
|
||||||
mod build_backend;
|
mod build_backend;
|
||||||
mod build_sysroot;
|
mod build_sysroot;
|
||||||
mod config;
|
mod config;
|
||||||
@ -48,6 +50,11 @@ pub fn main() {
|
|||||||
// The target dir is expected in the default location. Guard against the user changing it.
|
// The target dir is expected in the default location. Guard against the user changing it.
|
||||||
env::set_var("CARGO_TARGET_DIR", "target");
|
env::set_var("CARGO_TARGET_DIR", "target");
|
||||||
|
|
||||||
|
if is_ci() {
|
||||||
|
// Disabling incr comp reduces cache size and incr comp doesn't save as much on CI anyway
|
||||||
|
env::set_var("CARGO_BUILD_INCREMENTAL", "false");
|
||||||
|
}
|
||||||
|
|
||||||
let mut args = env::args().skip(1);
|
let mut args = env::args().skip(1);
|
||||||
let command = match args.next().as_deref() {
|
let command = match args.next().as_deref() {
|
||||||
Some("prepare") => {
|
Some("prepare") => {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
use std::env;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
@ -55,3 +56,7 @@ pub(crate) fn copy_dir_recursively(from: &Path, to: &Path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn is_ci() -> bool {
|
||||||
|
env::var("CI").as_ref().map(|val| &**val) == Ok("true")
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user