Skip to content

Commit 1bab6df

Browse files
committed
Remove all checks for CI in the build system
And introduce the CG_CLIF_EXPENSIVE_CHECKS env var in the place.
1 parent f269cdd commit 1bab6df

File tree

4 files changed

+14
-26
lines changed

4 files changed

+14
-26
lines changed

.github/workflows/main.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
runs-on: ${{ matrix.os }}
4545
timeout-minutes: 60
4646

47+
env:
48+
CG_CLIF_EXPENSIVE_CHECKS: 1
49+
4750
strategy:
4851
fail-fast: false
4952
matrix:
@@ -182,10 +185,10 @@ jobs:
182185
run: ./y.sh prepare
183186

184187
- name: Build
185-
run: CI_OPT=1 ./y.sh build --sysroot none
188+
run: ./y.sh build --sysroot none
186189

187190
- name: Benchmark
188-
run: CI_OPT=1 ./y.sh bench
191+
run: ./y.sh bench
189192

190193

191194
dist:
@@ -237,10 +240,10 @@ jobs:
237240
run: ./y.sh prepare
238241

239242
- name: Build backend
240-
run: CI_OPT=1 ./y.sh build --sysroot none
243+
run: ./y.sh build --sysroot none
241244

242245
- name: Build sysroot
243-
run: CI_OPT=1 ./y.sh build
246+
run: ./y.sh build
244247

245248
- name: Package prebuilt cg_clif
246249
run: tar cvfJ cg_clif.tar.xz dist

build_system/build_backend.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
use std::env;
12
use std::path::PathBuf;
23

34
use crate::path::{Dirs, RelPath};
45
use crate::rustc_info::get_file_name;
56
use crate::shared_utils::{rustflags_from_env, rustflags_to_cmd_env};
6-
use crate::utils::{is_ci, is_ci_opt, CargoProject, Compiler, LogGroup};
7+
use crate::utils::{CargoProject, Compiler, LogGroup};
78

89
pub(crate) static CG_CLIF: CargoProject = CargoProject::new(&RelPath::SOURCE, "cg_clif");
910

@@ -21,11 +22,10 @@ pub(crate) fn build_backend(
2122

2223
rustflags.push("-Zallow-features=rustc_private".to_owned());
2324

24-
if is_ci() {
25-
if !is_ci_opt() {
26-
cmd.env("CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS", "true");
27-
cmd.env("CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS", "true");
28-
}
25+
if env::var("CG_CLIF_EXPENSIVE_CHECKS").is_ok() {
26+
// Enabling debug assertions implicitly enables the clif ir verifier
27+
cmd.env("CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS", "true");
28+
cmd.env("CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS", "true");
2929
}
3030

3131
if use_unstable_features {

build_system/main.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::env;
66
use std::path::PathBuf;
77
use std::process;
88

9-
use self::utils::{is_ci, is_ci_opt, Compiler};
9+
use self::utils::Compiler;
1010

1111
mod abi_cafe;
1212
mod bench;
@@ -60,13 +60,6 @@ fn main() {
6060
}
6161
env::set_var("CG_CLIF_DISABLE_INCR_CACHE", "1");
6262

63-
if is_ci() {
64-
if !is_ci_opt() {
65-
// Enable the Cranelift verifier
66-
env::set_var("CG_CLIF_ENABLE_VERIFIER", "1");
67-
}
68-
}
69-
7063
// Force incr comp even in release mode unless in CI or incremental builds are explicitly disabled
7164
if env::var_os("CARGO_BUILD_INCREMENTAL").is_none() {
7265
env::set_var("CARGO_BUILD_INCREMENTAL", "true");

build_system/utils.rs

-8
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,6 @@ pub(crate) fn copy_dir_recursively(from: &Path, to: &Path) {
254254
}
255255
}
256256

257-
pub(crate) fn is_ci() -> bool {
258-
env::var("CI").is_ok()
259-
}
260-
261-
pub(crate) fn is_ci_opt() -> bool {
262-
env::var("CI_OPT").is_ok()
263-
}
264-
265257
static IN_GROUP: AtomicBool = AtomicBool::new(false);
266258
pub(crate) struct LogGroup {
267259
is_gha: bool,

0 commit comments

Comments
 (0)