Skip to content

Update abi-cafe #1523

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

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 5 additions & 4 deletions .github/workflows/abi-cafe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions: {}
jobs:
abi_cafe:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.env.TARGET_TRIPLE }}
cancel-in-progress: true
Expand All @@ -30,9 +30,10 @@ jobs:
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-msvc
- os: windows-latest
env:
TARGET_TRIPLE: x86_64-pc-windows-gnu
# FIXME Currently hangs. Re-enable once this is fixed or abi-cafe adds a timeout.
#- os: windows-latest
# env:
# TARGET_TRIPLE: x86_64-pc-windows-gnu

steps:
- uses: actions/checkout@v4
Expand Down
25 changes: 16 additions & 9 deletions build_system/abi_cafe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use crate::{build_sysroot, CodegenBackend, SysrootKind};
static ABI_CAFE_REPO: GitRepo = GitRepo::github(
"Gankra",
"abi-cafe",
"4c6dc8c9c687e2b3a760ff2176ce236872b37212",
"588df6d66abbe105",
"f1220cfd13b57f5c0082c26529163865ee25e115",
"fe93a9acd461425d",
"abi-cafe",
);

Expand Down Expand Up @@ -38,17 +38,23 @@ pub(crate) fn run(
eprintln!("Running abi-cafe");

let pairs = ["rustc_calls_cgclif", "cgclif_calls_rustc", "cgclif_calls_cc", "cc_calls_cgclif"];

let mut cmd = ABI_CAFE.run(bootstrap_host_compiler, dirs);
cmd.arg("--");
cmd.arg("--pairs");
cmd.args(
let pairs =
if cfg!(not(any(target_os = "macos", all(target_os = "windows", target_env = "msvc")))) {
&pairs[..]
} else {
&pairs[..2]
},
);
};

let mut cmd = ABI_CAFE.run(bootstrap_host_compiler, dirs);
cmd.arg("--");

// stdcall, vectorcall and such don't work yet
cmd.arg("--conventions").arg("c").arg("--conventions").arg("rust");

for pair in pairs {
cmd.arg("--pairs").arg(pair);
}

cmd.arg("--add-rustc-codegen-backend");
match cg_clif_dylib {
CodegenBackend::Local(path) => {
Expand All @@ -58,6 +64,7 @@ pub(crate) fn run(
cmd.arg(format!("cgclif:{name}"));
}
}

cmd.current_dir(ABI_CAFE.source_dir(dirs));

spawn_and_wait(cmd);
Expand Down

This file was deleted.

44 changes: 44 additions & 0 deletions patches/0002-abi-cafe-Disable-broken-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 378d9e451a8af1045b8cb32841198cd5ad5464a3 Mon Sep 17 00:00:00 2001
From: bjorn3 <[email protected]>
Date: Tue, 9 Jul 2024 11:25:14 +0000
Subject: [PATCH] Disable broken tests

---
src/abis/mod.rs | 6 +++---
src/report.rs | 4 ++++
2 files changed, 7 insertions(+), 3 deletions(-)

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

+ if cfg!(target_arch = "aarch64") && test.test == "F32Array" && test.options.convention == CallingConvention::C {
+ result.check = Busted(Check);
+ }
+
+ if cfg!(target_arch = "aarch64") && test.test == "OptionU128" && test.options.convention == CallingConvention::Rust && test.options.repr == LangRepr::C {
+ result.check = Busted(Check);
+ }
+
+ if cfg!(target_arch = "x86_64") && test.test == "OptionU128" && test.options.convention == CallingConvention::Rust && test.options.repr == LangRepr::Rust {
+ result.check = Busted(Run);
+ }
+
+ if cfg!(windows) && (test.test == "OptionU128" || test.test == "I64Array" || test.test == "simple") {
+ result.run = Skip; // Gives SIGILL on x86_64 windows.
+ }
+
+ if test.test == "f16" || test.test == "f128" {
+ result.run = Skip;
+ }
+
// END OF VENDOR RESERVED AREA
//
//
--
2.34.1