Hello community,
here is the log from the commit of package python-python-prctl for
openSUSE:Factory checked in at 2020-09-07 21:36:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-prctl (Old)
and /work/SRC/openSUSE:Factory/.python-python-prctl.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-prctl"
Mon Sep 7 21:36:56 2020 rev:3 rq:832778 version:1.7
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-python-prctl/python-python-prctl.changes
2020-08-19 18:58:29.595900413 +0200
+++
/work/SRC/openSUSE:Factory/.python-python-prctl.new.3399/python-python-prctl.changes
2020-09-07 21:37:13.221432581 +0200
@@ -1,0 +2,10 @@
+Fri Sep 4 13:48:25 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- Fixing arch-dependent test failures (bsc#1176085):
+ * renamed failing-on-i586.patch to memory_failure_early_kill.patch
+ * and modified it to skip the test also on s390x
+ * added bigendian.patch
+ * added powerpc.patch
+ * huge thanks to Michal Suchánek
+
+-------------------------------------------------------------------
Old:
----
failing-on-i586.patch
New:
----
bigendian.patch
memory_failure_early_kill.patch
powerpc.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-python-prctl.spec ++++++
--- /var/tmp/diff_new_pack.R0hxVO/_old 2020-09-07 21:37:14.385433120 +0200
+++ /var/tmp/diff_new_pack.R0hxVO/_new 2020-09-07 21:37:14.385433120 +0200
@@ -26,7 +26,9 @@
Source:
https://files.pythonhosted.org/packages/source/p/python-prctl/python-prctl-%{version}.tar.gz
Source99:
https://raw.githubusercontent.com/seveas/python-prctl/master/COPYING
Patch0: disable-sandboxed-test.patch
-Patch1: failing-on-i586.patch
+Patch1: memory_failure_early_kill.patch
+Patch2: bigendian.patch
+Patch3: powerpc.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -48,8 +50,7 @@
%prep
%setup -q -n python-prctl-%{version}
-%patch0 -p1
-%patch1 -p1
+%autopatch -p1
cp %{SOURCE99} .
%build
++++++ bigendian.patch ++++++
Index: python-prctl-1.7/_prctlmodule.c
===================================================================
--- python-prctl-1.7.orig/_prctlmodule.c
+++ python-prctl-1.7/_prctlmodule.c
@@ -50,6 +50,7 @@ prctl_prctl(PyObject *self, PyObject *ar
{
long option = 0;
long arg = 0;
+ int intarg = 0;
char *argstr = NULL;
char name[17] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
int result;
@@ -286,12 +287,12 @@ prctl_prctl(PyObject *self, PyObject *ar
#ifdef PR_GET_TID_ADDRESS
case(PR_GET_TID_ADDRESS):
#endif
- result = prctl(option, &arg, 0, 0, 0);
+ result = prctl(option, &intarg, 0, 0, 0);
if(result < 0) {
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
- return PyInt_FromLong(arg);
+ return PyInt_FromLong(intarg);
case(PR_SET_NAME):
case(PR_GET_NAME):
result = prctl(option, name, 0, 0, 0);
++++++ memory_failure_early_kill.patch ++++++
Index: python-prctl-1.7/test_prctl.py
===================================================================
--- python-prctl-1.7.orig/test_prctl.py
+++ python-prctl-1.7/test_prctl.py
@@ -155,6 +155,7 @@ class PrctlTest(unittest.TestCase):
self.assertEqual(prctl.get_keepcaps(), False)
@require('set_mce_kill')
+ @unittest.skipIf(sys.maxsize <= 2**32 or arch == 's390x', 'no such file on
this architecture')
def test_mce_kill(self):
"""Test the MCE_KILL setting"""
fd = open('/proc/sys/vm/memory_failure_early_kill')
++++++ powerpc.patch ++++++
diff -ur python-prctl-1.7.orig/test_prctl.py python-prctl-1.7/test_prctl.py
--- python-prctl-1.7.orig/test_prctl.py 2020-09-07 11:09:38.544700725 +0200
+++ python-prctl-1.7/test_prctl.py 2020-09-07 12:28:11.482301401 +0200
@@ -44,6 +44,8 @@
class PrctlTest(unittest.TestCase):
# There are architecture specific tests
arch = os.uname()[4]
+ if arch == 'ppc' or arch == 'ppc64' or arch == 'ppc64le':
+ arch = 'powerpc'
# prctl behaviour differs when root, so you should test as root and
non-root
am_root = os.geteuid() == 0
@@ -110,6 +112,7 @@
self.assertEqual(prctl.get_dumpable(), False)
self.assertRaises(TypeError, prctl.get_dumpable, "42")
+ @unittest.skip('cannot change endianness of running python interpreter')
def test_endian(self):
"""Test manipulation of the endianness setting"""
if self.arch == 'powerpc':
@@ -136,13 +139,55 @@
self.assertRaises(OSError, prctl.get_fpemu)
self.assertRaises(OSError, prctl.set_fpemu, prctl.FPEMU_SIGFPE)
+# define PR_FP_EXC_SW_ENABLE 0x80 /* Use FPEXC for FP exception enables */
+# define PR_FP_EXC_DIV 0x010000 /* floating point divide by
zero */
+# define PR_FP_EXC_OVF 0x020000 /* floating point overflow */
+# define PR_FP_EXC_UND 0x040000 /* floating point underflow */
+# define PR_FP_EXC_RES 0x080000 /* floating point inexact
result */
+# define PR_FP_EXC_INV 0x100000 /* floating point invalid
operation */
+# define PR_FP_EXC_DISABLED 0 /* FP exceptions disabled */
+# define PR_FP_EXC_NONRECOV 1 /* async non-recoverable exc. mode */
+# define PR_FP_EXC_ASYNC 2 /* async recoverable exception mode */
+# define PR_FP_EXC_PRECISE 3 /* precise exception mode */
+ def print_fpexc(self, fpexc):
+ if fpexc == 0:
+ print("PR_FP_EXC_DISABLED")
+ else:
+ if fpexc & 3 == _prctl.PR_FP_EXC_ASYNC:
+ print('PR_FP_EXC_ASYNC')
+ if fpexc & 3 == _prctl.PR_FP_EXC_NONRECOV:
+ print('PR_FP_EXC_NONRECOV')
+ if fpexc & 3 == _prctl.PR_FP_EXC_PRECISE:
+ print('PR_FP_EXC_PRECISE')
+ if fpexc & prctl.PR_FP_EXC_SW_ENABLE:
+ print('PR_FP_EXC_SW_ENABLE')
+ if fpexc & _prctl.PR_FP_EXC_DIV:
+ print('PR_FP_EXC_DIV')
+ if fpexc & _prctl.PR_FP_EXC_OVF:
+ print('PR_FP_EXC_OVF')
+ if fpexc & _prctl.PR_FP_EXC_UND:
+ print('PR_FP_EXC_UND')
+ if fpexc & _prctl.PR_FP_EXC_RES:
+ print('PR_FP_EXC_RES')
+ if fpexc & _prctl.PR_FP_EXC_INV:
+ print('PR_FP_EXC_INV')
+ print('\n');
+
def test_fpexc(self):
"""Test manipulation of the fpexc setting"""
if self.arch == 'powerpc':
- # FIXME - untested
- prctl.set_fpexc(prctl.FP_EXC_SW_ENABLE)
- self.assertEqual(prctl.get_fpexc() & prctl.PR_FP_EXC_SW_ENABLE,
prctl.PR_FP_EXC_SW_ENABLE)
+ fpexc = prctl.get_fpexc()
+ self.print_fpexc(fpexc)
+ # Did not find a sane combination of flags that is supported.
+ self.assertRaises(OSError, prctl.set_fpexc,
+ prctl.FP_EXC_SW_ENABLE | _prctl.PR_FP_EXC_ASYNC |
_prctl.PR_FP_EXC_DIV | _prctl.PR_FP_EXC_INV)
+ self.print_fpexc(prctl.get_fpexc())
+ self.assertEqual(prctl.get_fpexc(), fpexc)
+ prctl.set_fpexc(_prctl.PR_FP_EXC_DISABLED)
+ self.print_fpexc(prctl.get_fpexc())
+ self.assertEqual(prctl.get_fpexc(), _prctl.PR_FP_EXC_DISABLED)
self.assertRaises(ValueError, prctl.set_fpexc, 999)
+ prctl.set_fpexc(fpexc)
else:
self.assertRaises(OSError, prctl.get_fpexc)
self.assertRaises(OSError, prctl.set_fpexc)