Move many env vars from CI configuration to the build system

This commit is contained in:
bjorn3 2022-12-15 14:12:46 +00:00
parent e082eebb5f
commit cc3ac006a2
6 changed files with 15 additions and 57 deletions

View File

@ -15,9 +15,4 @@ task:
- ./y.rs prepare
test_script:
- . $HOME/.cargo/env
- # Enable backtraces for easier debugging
- export RUST_BACKTRACE=1
- # Reduce amount of benchmark runs as they are slow
- export COMPILE_RUNS=2
- export RUN_RUNS=2
- ./y.rs test

View File

@ -104,18 +104,7 @@ jobs:
- name: Test
env:
TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1
# Reduce amount of benchmark runs as they are slow
export COMPILE_RUNS=2
export RUN_RUNS=2
# Enable extra checks
export CG_CLIF_ENABLE_VERIFIER=1
./y.rs test
run: ./y.rs test
- name: Package prebuilt cg_clif
run: tar cvfJ cg_clif.tar.xz dist
@ -195,16 +184,6 @@ jobs:
- name: Test
run: |
# Enable backtraces for easier debugging
$Env:RUST_BACKTRACE=1
# Reduce amount of benchmark runs as they are slow
$Env:COMPILE_RUNS=2
$Env:RUN_RUNS=2
# Enable extra checks
$Env:CG_CLIF_ENABLE_VERIFIER=1
# WIP Disable some tests
# This fails due to some weird argument handling by hyperfine, not an actual regression

View File

@ -45,15 +45,4 @@ jobs:
- name: Build
run: ./y.rs build --sysroot none
- name: Test
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1
# Reduce amount of benchmark runs as they are slow
export COMPILE_RUNS=2
export RUN_RUNS=2
# Enable extra checks
export CG_CLIF_ENABLE_VERIFIER=1
./test.sh
run: ./test.sh

View File

@ -37,14 +37,7 @@ jobs:
./y.rs prepare
- name: Test
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1
# Enable extra checks
export CG_CLIF_ENABLE_VERIFIER=1
./scripts/test_bootstrap.sh
run: ./scripts/test_bootstrap.sh
rustc_test_suite:
runs-on: ubuntu-latest
@ -78,11 +71,4 @@ jobs:
./y.rs prepare
- name: Test
run: |
# Enable backtraces for easier debugging
export RUST_BACKTRACE=1
# Enable extra checks
export CG_CLIF_ENABLE_VERIFIER=1
./scripts/test_rustc_tests.sh
run: ./scripts/test_rustc_tests.sh

View File

@ -64,12 +64,18 @@ pub(crate) enum SysrootKind {
}
pub fn main() {
if env::var("RUST_BACKTRACE").is_err() {
env::set_var("RUST_BACKTRACE", "1");
}
env::set_var("CG_CLIF_DISPLAY_CG_TIME", "1");
env::set_var("CG_CLIF_DISABLE_INCR_CACHE", "1");
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");
// Enable the Cranelift verifier
env::set_var("CG_CLIF_ENABLE_VERIFIER", "1");
}
let mut args = env::args().skip(1);

View File

@ -4,7 +4,7 @@
use super::prepare::GitRepo;
use super::rustc_info::get_wrapper_file_name;
use super::utils::{
hyperfine_command, spawn_and_wait, spawn_and_wait_with_input, CargoProject, Compiler,
hyperfine_command, is_ci, spawn_and_wait, spawn_and_wait_with_input, CargoProject, Compiler,
};
use super::SysrootKind;
use std::env;
@ -281,7 +281,10 @@ const fn new(config: &'static str, func: &'static dyn Fn(&TestRunner)) -> Self {
}
}),
TestCase::new("bench.simple-raytracer", &|runner| {
let run_runs = env::var("RUN_RUNS").unwrap_or("10".to_string()).parse().unwrap();
let run_runs = env::var("RUN_RUNS")
.unwrap_or(if is_ci() { "2" } else { "10" }.to_string())
.parse()
.unwrap();
if runner.is_native {
eprintln!("[BENCH COMPILE] ebobby/simple-raytracer");