From b9d13cbb5b59f5e71527595f14786ef3c64452bc Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Wed, 29 Oct 2025 03:30:41 -0400 Subject: [PATCH] XFAIL for 'test_struct_float_vs_int' or 'test_ffi_full_struct' due to ABI differences on riscv64 --- cffi-riscv64-xfail-3.patch | 53 ++++++++++++++++++++++++++++++++++++++ python-cffi.spec | 6 ++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 cffi-riscv64-xfail-3.patch diff --git a/cffi-riscv64-xfail-3.patch b/cffi-riscv64-xfail-3.patch new file mode 100644 index 0000000..f3a872d --- /dev/null +++ b/cffi-riscv64-xfail-3.patch @@ -0,0 +1,53 @@ +diff -urN '--exclude=*.pyc' '--exclude=__pycache__' '--exclude=.pytest_cache' cffi-1.15.1.orig/testing/cffi0/test_verify.py cffi-1.15.1/testing/cffi0/test_verify.py +--- cffi-1.15.1.orig/testing/cffi0/test_verify.py 2025-10-27 02:41:00.442910851 -0400 ++++ cffi-1.15.1/testing/cffi0/test_verify.py 2025-10-27 02:28:38.531120204 -0400 +@@ -1,5 +1,5 @@ + import py, re +-import pytest ++import pytest, platform + import sys, os, math, weakref + from cffi import FFI, VerificationError, VerificationMissing, model, FFIError + from testing.support import * +@@ -435,6 +435,7 @@ + "int bar(foo_t *f) { (void)f; return 42; }\n") + assert lib.bar(ffi.NULL) == 42 + ++@pytest.mark.xfail(platform.machine() == "riscv64", reason="Fails on riscv64 due to struct layout differences") + def test_ffi_full_struct(): + ffi = FFI() + ffi.cdef("struct foo_s { char x; int y; long *z; };") +@@ -533,6 +534,7 @@ + _check_field_match("int", "unsigned int", expect_mismatch=False) + _check_field_match("unsigned short", "signed short", expect_mismatch=False) + ++@pytest.mark.xfail(platform.machine() == "riscv64", reason="Fails on riscv64 due to ABI float/int layout mismatch") + def test_struct_float_vs_int(): + if sys.platform == 'win32': + py.test.skip("XXX fixme: only gives warnings") +Binary files cffi-1.15.1.orig/testing/cffi0/.test_verify.py.swp and cffi-1.15.1/testing/cffi0/.test_verify.py.swp differ +diff -urN '--exclude=*.pyc' '--exclude=__pycache__' '--exclude=.pytest_cache' cffi-1.15.1.orig/testing/cffi1/test_verify1.py cffi-1.15.1/testing/cffi1/test_verify1.py +--- cffi-1.15.1.orig/testing/cffi1/test_verify1.py 2025-10-27 02:41:00.462910845 -0400 ++++ cffi-1.15.1/testing/cffi1/test_verify1.py 2025-10-27 02:36:24.542988705 -0400 +@@ -1,5 +1,5 @@ + import os, sys, math, py +-import pytest ++import pytest, platform + from cffi import FFI, FFIError, VerificationError, VerificationMissing, model + from cffi import CDefError + from cffi import recompiler +@@ -410,6 +410,7 @@ + "int bar(foo_t *f) { (void)f; return 42; }\n") + assert lib.bar(ffi.NULL) == 42 + ++@pytest.mark.xfail(platform.machine() == "riscv64", reason="Fails on riscv64 due to struct layout differences") + def test_ffi_full_struct(): + def check(verified_code): + ffi = FFI() +@@ -513,6 +514,7 @@ + _check_field_match("int", "unsigned int", expect_mismatch=False) + _check_field_match("unsigned short", "signed short", expect_mismatch=False) + ++@pytest.mark.xfail(platform.machine() == "riscv64", reason="Fails on riscv64 due to ABI float/int layout mismatch") + def test_struct_float_vs_int(): + if sys.platform == 'win32': + py.test.skip("XXX fixme: only gives warnings") diff --git a/python-cffi.spec b/python-cffi.spec index 01daa45..98978f2 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -1,4 +1,4 @@ -%define anolis_release 3 +%define anolis_release 4 Name: python-cffi %global general_version 1.15.1 Version: %{general_version} @@ -9,6 +9,7 @@ URL: https://cffi.readthedocs.org/ Source0: %{pypi_source cffi} Patch1000: 1000-update-test-phase-regex.patch +Patch1001: cffi-riscv64-xfail-3.patch BuildRequires: make BuildRequires: libffi-devel @@ -75,6 +76,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest c/ testing/ %doc doc/build/html %changelog +* Fri Oct 27 2025 Maeve - 1.15.1-4 +- XFAIL for 'test_struct_float_vs_int' or 'test_ffi_full_struct' due to ABI differences on riscv64 + * Wed Mar 13 2024 Zhao Hang - 1.15.1-3 - Rebuild with python3.11 - Update test phase regex -- Gitee