From c2e7d9080d2803934b3b2d463ee709e8077281b281ee1a4e1d800a33799e5adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 8 Apr 2019 08:39:26 +0000 Subject: [PATCH 1/2] Accepting request 692210 from home:bmwiedemann:branches:devel:languages:python Drop compile-time CPU detection. Add reproducible.patch to make package build reproducible (boo#1100677) and to not use SSE4.1 instructions OBS-URL: https://build.opensuse.org/request/show/692210 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-autobahn?expand=0&rev=17 --- python-autobahn.changes | 6 ++++++ python-autobahn.spec | 3 +++ reproducible.patch | 24 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 reproducible.patch diff --git a/python-autobahn.changes b/python-autobahn.changes index e35d016..79b27bd 100644 --- a/python-autobahn.changes +++ b/python-autobahn.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 8 07:32:05 UTC 2019 - Bernhard Wiedemann + +- Add reproducible.patch to make package build reproducible (boo#1100677) + and to not use SSE4.1 instructions + ------------------------------------------------------------------- Fri Apr 5 08:12:36 UTC 2019 - Tomáš Chvátal diff --git a/python-autobahn.spec b/python-autobahn.spec index e4c1596..fd6b1cb 100644 --- a/python-autobahn.spec +++ b/python-autobahn.spec @@ -25,6 +25,8 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/crossbario/autobahn-python Source: https://files.pythonhosted.org/packages/source/a/autobahn/autobahn-%{version}.tar.gz +# PATCH-FIX-OPENSUSE bmwiedemann -- https://bugzilla.opensuse.org/show_bug.cgi?id=1100677 +Patch0: reproducible.patch BuildRequires: %{python_module PyNaCl >= 1.0.1} BuildRequires: %{python_module PyQRCode >= 1.1} BuildRequires: %{python_module Twisted >= 12.1.0} @@ -87,6 +89,7 @@ asynchronous Remote Procedure Calls and Publish & Subscribe on top of WebSocket. %prep %setup -q -n autobahn-%{version} +%patch0 -p1 %build export AUTOBAHN_USE_NVX=true diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..700ccbe --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,24 @@ +Author: Bernhard M. Wiedemann +Date: 2019-04-08 + +This bug was found while working on reproducible builds for openSUSE. + +Without this patch, binaries would use SSE4.1 instructions if the build +machine's CPU had it available. +This could cause 'invalid instruction' faults on older user machines. + +https://bugzilla.opensuse.org/show_bug.cgi?id=1100677 + +Index: autobahn-19.3.3/autobahn/nvx/_utf8validator.py +=================================================================== +--- autobahn-19.3.3.orig/autobahn/nvx/_utf8validator.py ++++ autobahn-19.3.3/autobahn/nvx/_utf8validator.py +@@ -52,7 +52,7 @@ with open(os.path.join(os.path.dirname(_ + "_nvx_utf8validator", + c_source, + libraries=[], +- extra_compile_args=['-std=c99', '-Wall', '-Wno-strict-prototypes', '-O3', '-march=native'] ++ extra_compile_args=['-std=c99', '-Wall', '-Wno-strict-prototypes', '-O3'] + ) + + From 98ddf51a468168bf1b47d8dbd6fcfa6783169cc7094f7c8c5ecb251aeef8ae40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 8 Apr 2019 08:45:21 +0000 Subject: [PATCH 2/2] - Rename reproducible.patch to respect-cflags.patch and really make sure we respect all the cflags OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-autobahn?expand=0&rev=18 --- python-autobahn.changes | 6 ++++++ python-autobahn.spec | 5 +++-- reproducible.patch => respect-cflags.patch | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) rename reproducible.patch => respect-cflags.patch (97%) diff --git a/python-autobahn.changes b/python-autobahn.changes index 79b27bd..5af58c2 100644 --- a/python-autobahn.changes +++ b/python-autobahn.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 8 08:41:35 UTC 2019 - Tomáš Chvátal + +- Rename reproducible.patch to respect-cflags.patch and really make + sure we respect all the cflags + ------------------------------------------------------------------- Mon Apr 8 07:32:05 UTC 2019 - Bernhard Wiedemann diff --git a/python-autobahn.spec b/python-autobahn.spec index fd6b1cb..2281aca 100644 --- a/python-autobahn.spec +++ b/python-autobahn.spec @@ -25,8 +25,7 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/crossbario/autobahn-python Source: https://files.pythonhosted.org/packages/source/a/autobahn/autobahn-%{version}.tar.gz -# PATCH-FIX-OPENSUSE bmwiedemann -- https://bugzilla.opensuse.org/show_bug.cgi?id=1100677 -Patch0: reproducible.patch +Patch0: respect-cflags.patch BuildRequires: %{python_module PyNaCl >= 1.0.1} BuildRequires: %{python_module PyQRCode >= 1.1} BuildRequires: %{python_module Twisted >= 12.1.0} @@ -93,6 +92,7 @@ asynchronous Remote Procedure Calls and Publish & Subscribe on top of WebSocket. %build export AUTOBAHN_USE_NVX=true +export CFLAGS="%{optflags}" %python_build %install @@ -103,6 +103,7 @@ export AUTOBAHN_USE_NVX=true %check export USE_ASYNCIO=true export AUTOBAHN_USE_NVX=true +export PYTHONDONTWRITEBYTECODE=1 %pytest_arch %{buildroot}%{$python_sitearch}/autobahn/ %files %{python_files} diff --git a/reproducible.patch b/respect-cflags.patch similarity index 97% rename from reproducible.patch rename to respect-cflags.patch index 700ccbe..c0badf9 100644 --- a/reproducible.patch +++ b/respect-cflags.patch @@ -18,7 +18,7 @@ Index: autobahn-19.3.3/autobahn/nvx/_utf8validator.py c_source, libraries=[], - extra_compile_args=['-std=c99', '-Wall', '-Wno-strict-prototypes', '-O3', '-march=native'] -+ extra_compile_args=['-std=c99', '-Wall', '-Wno-strict-prototypes', '-O3'] ++ extra_compile_args=['-std=c99', '-Wall', '-Wno-strict-prototypes'] )