From 7610be478f9e67a4e0e13cddb50f171e82cc3170 Mon Sep 17 00:00:00 2001 From: Afonso Bordado Date: Sat, 6 Aug 2022 21:24:38 +0100 Subject: [PATCH] Move abi-checker to y.rs test --- .github/workflows/main.yml | 5 ----- build_system/abi_checker.rs | 14 ++++++++++---- build_system/mod.rs | 24 +++++++++--------------- config.txt | 2 ++ 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b259369e61..e8897e9ae81 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -105,11 +105,6 @@ jobs: ./y.rs test - - - name: Run abi-checker - if: matrix.env.TARGET_TRIPLE == '' - run: ./y.rs abi-checker - - name: Package prebuilt cg_clif run: tar cvfJ cg_clif.tar.xz build diff --git a/build_system/abi_checker.rs b/build_system/abi_checker.rs index 21d9afc8231..b6dc0fa6922 100644 --- a/build_system/abi_checker.rs +++ b/build_system/abi_checker.rs @@ -1,4 +1,5 @@ use super::build_sysroot; +use super::config; use super::utils::spawn_and_wait_with_input; use build_system::SysrootKind; use std::env; @@ -13,10 +14,15 @@ pub(crate) fn run( host_triple: &str, target_triple: &str, ) { - assert_eq!( - host_triple, target_triple, - "abi-checker not supported on cross-compilation scenarios" - ); + if !config::get_bool("testsuite.abi-checker") { + eprintln!("[SKIP] abi-checker"); + return; + } + + if host_triple != target_triple { + eprintln!("[SKIP] abi-checker (cross-compilation not supported)"); + return; + } eprintln!("Building sysroot for abi-checker"); build_sysroot::build_sysroot( diff --git a/build_system/mod.rs b/build_system/mod.rs index c5b3e6619b7..c3706dc6f82 100644 --- a/build_system/mod.rs +++ b/build_system/mod.rs @@ -22,9 +22,6 @@ fn usage() { eprintln!( " ./y.rs test [--debug] [--sysroot none|clif|llvm] [--target-dir DIR] [--no-unstable-features]" ); - eprintln!( - " ./y.rs abi-checker [--debug] [--sysroot none|clif|llvm] [--target-dir DIR] [--no-unstable-features]" - ); } macro_rules! arg_error { @@ -39,7 +36,6 @@ macro_rules! arg_error { enum Command { Build, Test, - AbiChecker, } #[derive(Copy, Clone, Debug)] @@ -71,7 +67,6 @@ pub fn main() { } Some("build") => Command::Build, Some("test") => Command::Test, - Some("abi-checker") => Command::AbiChecker, Some(flag) if flag.starts_with('-') => arg_error!("Expected command found flag {}", flag), Some(command) => arg_error!("Unknown command {}", command), None => { @@ -147,6 +142,15 @@ pub fn main() { &host_triple, &target_triple, ); + + abi_checker::run( + channel, + sysroot_kind, + &target_dir, + &cg_clif_build_dir, + &host_triple, + &target_triple, + ); } Command::Build => { build_sysroot::build_sysroot( @@ -158,15 +162,5 @@ pub fn main() { &target_triple, ); } - Command::AbiChecker => { - abi_checker::run( - channel, - sysroot_kind, - &target_dir, - &cg_clif_build_dir, - &host_triple, - &target_triple, - ); - } } } diff --git a/config.txt b/config.txt index 5e4d230776d..2264d301d59 100644 --- a/config.txt +++ b/config.txt @@ -48,3 +48,5 @@ test.libcore test.regex-shootout-regex-dna test.regex test.portable-simd + +testsuite.abi-checker