Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add abi-checker to y.rs and run it on CI #1255

Merged
merged 7 commits into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions build_system/abi_checker.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::build_sysroot;
use super::config;
use super::utils::spawn_and_wait_with_input;
use super::utils::spawn_and_wait;
use build_system::SysrootKind;
use std::env;
use std::path::Path;
Expand Down Expand Up @@ -56,13 +56,5 @@ pub(crate) fn run(
cmd.arg("--add-rustc-codegen-backend");
cmd.arg(format!("cgclif:{}", cg_clif_dylib_path.display()));

let output = spawn_and_wait_with_input(cmd, "".to_string());

// TODO: The correct thing to do here is to check the exit code, but abi-checker
// currently doesn't return 0 on success, so check for the test fail count.
// See: https://github.com/Gankra/abi-checker/issues/10
let failed = !(output.contains("0 failed") && output.contains("0 completely failed"));
if failed {
panic!("abi-checker failed!");
}
spawn_and_wait(cmd);
}
3 changes: 2 additions & 1 deletion build_system/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ pub(crate) fn prepare() {
"abi-checker",
"Gankra",
"abi-checker",
"7c1571da6e43f9a37347623e7d5c7d51be664a7b",
"a2232d45f202846f5c02203c9f27355360f9a2ff",
);
apply_patches("abi-checker", Path::new("abi-checker"));

clone_repo_shallow_github(
"rand",
Expand Down
36 changes: 36 additions & 0 deletions patches/0029-abi-checker-Disable-failing-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 1a315ba225577dbbd1f449d9609f16f984f68708 Mon Sep 17 00:00:00 2001
afonso360 marked this conversation as resolved.
Show resolved Hide resolved
From: Afonso Bordado <afonso360@users.noreply.github.com>
Date: Fri, 12 Aug 2022 22:51:58 +0000
Subject: [PATCH] Disable abi-checker tests

---
src/report.rs | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/src/report.rs b/src/report.rs
index 7346f5e..8347762 100644
--- a/src/report.rs
+++ b/src/report.rs
@@ -45,6 +45,20 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl
//
// THIS AREA RESERVED FOR VENDORS TO APPLY PATCHES

+ // Currently MSVC has some broken ABI issues. Furthermore, they cause
+ // a STATUS_ACCESS_VIOLATION, so we can't even run them. Ensure that they compile and link.
+ if cfg!(windows) && (test.test_name == "bool" || test.test_name == "ui128") {
+ result.run = Link;
+ result.check = Pass(Link);
+ }
+
+ // structs is broken in the current release of cranelift for aarch64.
+ // It has been fixed for cranelift 0.88: https://github.com/bytecodealliance/wasmtime/pull/4634
+ if cfg!(target_arch = "aarch64") && test.test_name == "structs" {
+ result.run = Link;
+ result.check = Pass(Link);
+ }
+
// END OF VENDOR RESERVED AREA
//
//
--
2.34.1