diff --git a/plan.fmf b/plan.fmf index 9ad58d8..7a728ed 100644 --- a/plan.fmf +++ b/plan.fmf @@ -14,5 +14,6 @@ discover: - gcc-c++ test: | cd $(dirname $TMT_SOURCE_DIR/cffi-*/testing) && + patch -p1 < $TMT_TREE/tests-no-error-sign-conversion.patch && rm -rf cffi* && pytest-3.12 testing/cffi0 diff --git a/python3.12-cffi.spec b/python3.12-cffi.spec index d20fb55..cbc6f87 100644 --- a/python3.12-cffi.spec +++ b/python3.12-cffi.spec @@ -11,6 +11,11 @@ License: MIT and Python URL: https://github.com/python-cffi/cffi Source: %{url}/archive/v%{version}/cffi-%{version}.tar.gz +# The GCC version in RHEL 8 errors with -Werror=sign-conversion due to +# https://github.com/python/cpython/issues/112353 +# This patch unconditionally adds -Wno-error=sign-conversion for tests +Patch0: tests-no-error-sign-conversion.patch + BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: make diff --git a/tests-no-error-sign-conversion.patch b/tests-no-error-sign-conversion.patch new file mode 100644 index 0000000..ee568b1 --- /dev/null +++ b/tests-no-error-sign-conversion.patch @@ -0,0 +1,14 @@ +diff --git a/testing/support.py b/testing/support.py +index 063e52c..24c6148 100644 +--- a/testing/support.py ++++ b/testing/support.py +@@ -116,7 +116,8 @@ else: + # assume a standard gcc + extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion', + '-Wno-unused-parameter', +- '-Wno-unreachable-code'] ++ '-Wno-unreachable-code', ++ '-Wno-error=sign-conversion'] + + is_musl = False + if sys.platform == 'linux':