The package rpms/python-awscrt.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/python-awscrt.git/commit/?id=e8ee8b6... https://src.fedoraproject.org/cgit/rpms/python-awscrt.git/commit/?id=26a34e8....
Change: +%ifarch %{ix86} +ExcludeArch: s390x
Thanks.
Full change: ============
commit d3cc5f50859236b33abb798b24da21e507e11579 Author: Nikola Forró nforro@redhat.com Date: Wed Mar 22 20:12:19 2023 +0100
Add ExcludeArch bugzilla for s390x
diff --git a/python-awscrt.spec b/python-awscrt.spec index 7184b12..febf40a 100644 --- a/python-awscrt.spec +++ b/python-awscrt.spec @@ -31,7 +31,7 @@ BuildRequires: openssl-devel
BuildRequires: python%{python3_pkgversion}-websockets
-# some parts of the code are not big endian friendly +# https://bugzilla.redhat.com/show_bug.cgi?id=2180988 ExcludeArch: s390x
commit e8ee8b630a92334c9d9614d3c2e9d77bfda36b95 Author: Nikola Forró nforro@redhat.com Date: Wed Mar 22 19:46:50 2023 +0100
Workaround a crash on %%ix86
diff --git a/python-awscrt.spec b/python-awscrt.spec index 2f76da8..7184b12 100644 --- a/python-awscrt.spec +++ b/python-awscrt.spec @@ -4,7 +4,7 @@ Python bindings for the AWS Common Runtime}
Name: python-awscrt Version: 0.16.13 -Release: 1%{?dist} +Release: 2%{?dist}
Summary: Python bindings for the AWS Common Runtime # All files are licensed under Apache-2.0, except: @@ -56,6 +56,11 @@ Summary: %{summary}
%build +%ifarch %{ix86} +# disable SSE2 instructions to prevent a crash in aws-c-common thread handling +# probably caused by a compiler bug +export CFLAGS="%{optflags} -mno-sse2" +%endif export AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO=1 %pyproject_wheel
@@ -74,5 +79,8 @@ PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}" %{py
%changelog +* Wed Mar 22 2023 Nikola Forró nforro@redhat.com - 0.16.13-2 +- Workaround a crash on %%ix86 + * Thu Mar 16 2023 Nikola Forró nforro@redhat.com - 0.16.13-1 - Initial package
commit 26a34e8c0c3de6a708327514fc051705a0fae951 Author: Nikola Forró nforro@redhat.com Date: Mon Mar 20 15:50:12 2023 +0100
Initial package
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..48f7351 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/awscrt-0.16.13.tar.gz diff --git a/README.md b/README.md index 4487e53..e801db2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # python-awscrt
-The python-awscrt package +Python bindings for the AWS Common Runtime diff --git a/python-awscrt.spec b/python-awscrt.spec new file mode 100644 index 0000000..2f76da8 --- /dev/null +++ b/python-awscrt.spec @@ -0,0 +1,78 @@ +%global desc %{expand: +Python bindings for the AWS Common Runtime} + + +Name: python-awscrt +Version: 0.16.13 +Release: 1%{?dist} + +Summary: Python bindings for the AWS Common Runtime +# All files are licensed under Apache-2.0, except: +# - crt/aws-c-common/include/aws/common/external/cJSON.h is MIT +# - crt/aws-c-common/source/external/cJSON.c is MIT +# - crt/s2n/pq-crypto/kyber_r3/KeccakP-brg_endian_avx2.h is BSD-3-Clause +License: Apache-2.0 AND MIT AND BSD-3-Clause +URL: https://github.com/awslabs/aws-crt-python + +Source0: %{pypi_source awscrt} + +# https://github.com/awslabs/aws-crt-python/pull/456 +Patch0: use-system-libcrypto.patch + +# one test requires internet connection, skip it +Patch1: skip-test-requiring-network.patch + +BuildRequires: python%{python3_pkgversion}-devel + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: cmake +BuildRequires: openssl-devel + +BuildRequires: python%{python3_pkgversion}-websockets + +# some parts of the code are not big endian friendly +ExcludeArch: s390x + + +%description +%{desc} + + +%package -n python%{python3_pkgversion}-awscrt +Summary: %{summary} + + +%description -n python%{python3_pkgversion}-awscrt +%{desc} + + +%prep +%autosetup -p1 -n awscrt-%{version} + + +%generate_buildrequires +%pyproject_buildrequires + + +%build +export AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO=1 +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files _awscrt awscrt + + +%check +PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}" %{python3} -m unittest + + +%files -n python%{python3_pkgversion}-awscrt -f %{pyproject_files} +%doc README.md + + +%changelog +* Thu Mar 16 2023 Nikola Forró nforro@redhat.com - 0.16.13-1 +- Initial package diff --git a/skip-test-requiring-network.patch b/skip-test-requiring-network.patch new file mode 100644 index 0000000..1cd7b50 --- /dev/null +++ b/skip-test-requiring-network.patch @@ -0,0 +1,12 @@ +diff --git a/test/test_http_client.py b/test/test_http_client.py +index 5af87b6..dd2631a 100644 +--- a/test/test_http_client.py ++++ b/test/test_http_client.py +@@ -347,6 +347,7 @@ class TestClient(NativeResourceTest): + tls_connection_options=tls_conn_opt) + return connection_future.result(self.timeout) + ++ @unittest.skip("Requires network") + def test_h2_client(self): + url = urlparse("https://d1cz66xoahf9cl.cloudfront.net/http_test_doc.txt") + connection = self._new_h2_client_connection(url) diff --git a/sources b/sources new file mode 100644 index 0000000..aa34de0 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (awscrt-0.16.13.tar.gz) = 4f5d3309c2e12f64b74b264a24a3e341f9b6e03579ca0b8631ca065577b863381bc85491d7619f820ba3196961289c2ef82f5cd3cedde1e5247600de24afcdfe diff --git a/use-system-libcrypto.patch b/use-system-libcrypto.patch new file mode 100644 index 0000000..1ede7d5 --- /dev/null +++ b/use-system-libcrypto.patch @@ -0,0 +1,77 @@ +diff --git a/crt/CMakeLists.txt b/crt/CMakeLists.txt +index a2aa142..2484781 100644 +--- a/crt/CMakeLists.txt ++++ b/crt/CMakeLists.txt +@@ -29,10 +29,14 @@ include(CTest) + # On Unix we use S2N for TLS and AWS-LC crypto. + # (On Windows and Apple we use the default OS libraries) + if(UNIX AND NOT APPLE) +- set(DISABLE_GO ON CACHE BOOL "Build without using Go, we don't want the extra dependency") +- set(DISABLE_PERL ON CACHE BOOL "Build without using Perl, we don't want the extra dependency") +- set(BUILD_LIBSSL OFF CACHE BOOL "Don't need libssl, only need libcrypto") +- add_subdirectory(aws-lc) ++ option(USE_OPENSSL "Set this if you want to use your system's OpenSSL compatible libcrypto" OFF) ++ ++ if(NOT USE_OPENSSL) ++ set(DISABLE_GO ON CACHE BOOL "Build without using Go, we don't want the extra dependency") ++ set(DISABLE_PERL ON CACHE BOOL "Build without using Perl, we don't want the extra dependency") ++ set(BUILD_LIBSSL OFF CACHE BOOL "Don't need libssl, only need libcrypto") ++ add_subdirectory(aws-lc) ++ endif() + + set(UNSAFE_TREAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "") + add_subdirectory(s2n) +diff --git a/setup.py b/setup.py +index e85948c..d7c6291 100644 +--- a/setup.py ++++ b/setup.py +@@ -121,6 +121,10 @@ def get_cmake_path(): + raise Exception("CMake must be installed to build from source.") + + ++def using_system_libcrypto(): ++ return os.getenv('AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO') == '1' ++ ++ + class AwsLib: + def __init__(self, name, extra_cmake_args=[], libname=None): + self.name = name +@@ -132,8 +136,9 @@ class AwsLib: + # They're built along with the extension. + AWS_LIBS = [] + if sys.platform != 'darwin' and sys.platform != 'win32': +- # aws-lc produces libcrypto.a +- AWS_LIBS.append(AwsLib('aws-lc', libname='crypto')) ++ if not using_system_libcrypto(): ++ # aws-lc produces libcrypto.a ++ AWS_LIBS.append(AwsLib('aws-lc', libname='crypto')) + AWS_LIBS.append(AwsLib('s2n')) + AWS_LIBS.append(AwsLib('aws-c-common')) + AWS_LIBS.append(AwsLib('aws-c-sdkutils')) +@@ -182,6 +187,9 @@ class awscrt_build_ext(setuptools.command.build_ext.build_ext): + f'-DCMAKE_BUILD_TYPE={build_type}', + ]) + ++ if using_system_libcrypto(): ++ cmake_args.append('-DUSE_OPENSSL=ON') ++ + if sys.platform == 'darwin': + # build lib with same MACOSX_DEPLOYMENT_TARGET that python will ultimately + # use to link everything together, otherwise there will be linker warnings. +@@ -298,13 +306,13 @@ def awscrt_ext(): + extra_link_args += ['-framework', 'Security'] + + else: # unix +- # linker will prefer shared libraries over static if it can find both. +- # force linker to choose static variant by using using "-l:libcrypto.a" syntax instead of just "-lcrypto". +- libraries = [':lib{}.a'.format(x) for x in libraries] + # OpenBSD doesn't have librt; functions are found in libc instead. + if not sys.platform.startswith('openbsd'): + libraries += ['rt'] + ++ if using_system_libcrypto(): ++ libraries += ['crypto'] ++ + # hide the symbols from libcrypto.a + # this prevents weird crashes if an application also ends up using + # libcrypto.so from the system's OpenSSL installation.
arch-excludes@lists.fedoraproject.org