From 3edd6bed23855b8f3c54633497712de61200cc5cec2186ed681cc7ad4db40961 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Fri, 27 May 2016 09:26:18 +0000 Subject: [PATCH 1/3] Accepting request 398109 from home:badshah400:branches:openSUSE:Factory:Rings:2-TestDVD Update to v1.6.0; update fixes building against gcc >= 6 OBS-URL: https://build.opensuse.org/request/show/398109 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=27 --- cffi-1.5.2.tar.gz | 3 --- cffi-1.6.0.tar.gz | 3 +++ python-cffi.changes | 11 +++++++++++ python-cffi.spec | 4 ++-- 4 files changed, 16 insertions(+), 5 deletions(-) delete mode 100644 cffi-1.5.2.tar.gz create mode 100644 cffi-1.6.0.tar.gz diff --git a/cffi-1.5.2.tar.gz b/cffi-1.5.2.tar.gz deleted file mode 100644 index e6a5e63..0000000 --- a/cffi-1.5.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:da9bde99872e46f7bb5cff40a9b1cc08406765efafb583c704de108b6cb821dd -size 388793 diff --git a/cffi-1.6.0.tar.gz b/cffi-1.6.0.tar.gz new file mode 100644 index 0000000..6367eaa --- /dev/null +++ b/cffi-1.6.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7f75c4ef2362c0a0e54657add0a6c509fecbfa3b3807bc0925f5cb1c9f927db +size 397024 diff --git a/python-cffi.changes b/python-cffi.changes index 056c7b9..15eae29 100644 --- a/python-cffi.changes +++ b/python-cffi.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu May 26 02:33:02 UTC 2016 - badshah400@gmail.com + +- Update to version 1.6.0: + * ffi.list_types() + * ffi.unpack() + * extern “Python+C” + * in API mode, lib.foo.__doc__ contains the C signature now. + * Yet another attempt at robustness of ffi.def_extern() against + CPython’s interpreter shutdown logic. + ------------------------------------------------------------------- Mon Apr 11 14:45:11 UTC 2016 - jmatejek@suse.com diff --git a/python-cffi.spec b/python-cffi.spec index d14cfc6..50f11ec 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -17,13 +17,13 @@ Name: python-cffi -Version: 1.5.2 +Version: 1.6.0 Release: 0 Summary: Foreign Function Interface for Python calling C code License: MIT Group: Development/Languages/Python Url: http://cffi.readthedocs.org -Source0: https://pypi.python.org/packages/source/c/cffi/cffi-%{version}.tar.gz +Source0: https://pypi.io/packages/source/c/cffi/cffi-%{version}.tar.gz Source1: python-cffi-rpmlintrc BuildRequires: gcc-c++ BuildRequires: python-devel From 01151b11a58513bac0944c2f98ddf4a0b097248279048f5d0bcac49adad63f65 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Fri, 27 May 2016 13:52:37 +0000 Subject: [PATCH 2/3] Accepting request 398372 from home:matejcik:branches:devel:languages:python - disable "negative left shift" warning in test suite to prevent failures with gcc6, until upstream fixes the undefined code in question (boo#981848, cffi-1.5.2-wnoerror.patch) OBS-URL: https://build.opensuse.org/request/show/398372 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=28 --- cffi-1.5.2-wnoerror.patch | 13 +++++++++++++ python-cffi.changes | 7 +++++++ python-cffi.spec | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 cffi-1.5.2-wnoerror.patch diff --git a/cffi-1.5.2-wnoerror.patch b/cffi-1.5.2-wnoerror.patch new file mode 100644 index 0000000..07fb355 --- /dev/null +++ b/cffi-1.5.2-wnoerror.patch @@ -0,0 +1,13 @@ +Index: cffi-1.5.2/testing/cffi1/test_verify1.py +=================================================================== +--- cffi-1.5.2.orig/testing/cffi1/test_verify1.py ++++ cffi-1.5.2/testing/cffi1/test_verify1.py +@@ -20,7 +20,7 @@ else: + extra_compile_args.append('-Qunused-arguments') + else: + # assume a standard gcc +- extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion'] ++ extra_compile_args = ['-Werror', '-Wno-shift-negative-value', '-Wall', '-Wextra', '-Wconversion'] + + class FFI(FFI): + error = _cffi_backend.FFI.error diff --git a/python-cffi.changes b/python-cffi.changes index 15eae29..106ea00 100644 --- a/python-cffi.changes +++ b/python-cffi.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri May 27 13:00:22 UTC 2016 - jmatejek@suse.com + +- disable "negative left shift" warning in test suite to prevent + failures with gcc6, until upstream fixes the undefined code + in question (boo#981848, cffi-1.5.2-wnoerror.patch) + ------------------------------------------------------------------- Thu May 26 02:33:02 UTC 2016 - badshah400@gmail.com diff --git a/python-cffi.spec b/python-cffi.spec index 50f11ec..f04f3c7 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -25,6 +25,7 @@ Group: Development/Languages/Python Url: http://cffi.readthedocs.org Source0: https://pypi.io/packages/source/c/cffi/cffi-%{version}.tar.gz Source1: python-cffi-rpmlintrc +Patch0: cffi-1.5.2-wnoerror.patch BuildRequires: gcc-c++ BuildRequires: python-devel BuildRequires: python-setuptools @@ -47,6 +48,7 @@ is to provide a convenient and reliable way of calling C code from Python. %prep %setup -q -n cffi-%{version} +%patch0 -p1 %build CFLAGS="%{optflags}" python setup.py build From 68f8dd10a19f149593e3d6e079b53ad73be9e0d973b42564d1b17252cda454d8 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Mon, 30 May 2016 07:26:32 +0000 Subject: [PATCH 3/3] Accepting request 398809 from home:badshah400:branches:openSUSE:Factory:Rings:2-TestDVD Add upstream patch to actually fix problem with gcc >= 6; drop previous patch used to workaround issue. OBS-URL: https://build.opensuse.org/request/show/398809 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=29 --- cffi-1.5.2-wnoerror.patch | 13 ------- ...-cffi-avoid-bitshifting-negative-int.patch | 39 +++++++++++++++++++ python-cffi.changes | 9 +++++ python-cffi.spec | 3 +- 4 files changed, 50 insertions(+), 14 deletions(-) delete mode 100644 cffi-1.5.2-wnoerror.patch create mode 100644 python-cffi-avoid-bitshifting-negative-int.patch diff --git a/cffi-1.5.2-wnoerror.patch b/cffi-1.5.2-wnoerror.patch deleted file mode 100644 index 07fb355..0000000 --- a/cffi-1.5.2-wnoerror.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: cffi-1.5.2/testing/cffi1/test_verify1.py -=================================================================== ---- cffi-1.5.2.orig/testing/cffi1/test_verify1.py -+++ cffi-1.5.2/testing/cffi1/test_verify1.py -@@ -20,7 +20,7 @@ else: - extra_compile_args.append('-Qunused-arguments') - else: - # assume a standard gcc -- extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion'] -+ extra_compile_args = ['-Werror', '-Wno-shift-negative-value', '-Wall', '-Wextra', '-Wconversion'] - - class FFI(FFI): - error = _cffi_backend.FFI.error diff --git a/python-cffi-avoid-bitshifting-negative-int.patch b/python-cffi-avoid-bitshifting-negative-int.patch new file mode 100644 index 0000000..54bab94 --- /dev/null +++ b/python-cffi-avoid-bitshifting-negative-int.patch @@ -0,0 +1,39 @@ +# HG changeset patch +# User Armin Rigo +# Date 1464590378 -7200 +# Node ID bc14c64da0f41ba70f6fab821540b376f78e0a85 +# Parent f6d4b0a1e70b885352de186fcaeedf41365793c6 +Issue #260: don't use "x << 0" but "x | 0" to check that x is an +integer. It seems that "x << 0" is undefined, according to the C +standard, if x is any negative value... + +diff --git a/cffi/recompiler.py b/cffi/recompiler.py +--- a/cffi/recompiler.py ++++ b/cffi/recompiler.py +@@ -814,7 +814,7 @@ + try: + if ftype.is_integer_type() or fbitsize >= 0: + # accept all integers, but complain on float or double +- prnt(" (void)((p->%s) << 1); /* check that '%s.%s' is " ++ prnt(" (void)((p->%s) | 0); /* check that '%s.%s' is " + "an integer */" % (fname, cname, fname)) + continue + # only accept exactly the type declared, except that '[]' +@@ -991,7 +991,7 @@ + prnt('static int %s(unsigned long long *o)' % funcname) + prnt('{') + prnt(' int n = (%s) <= 0;' % (name,)) +- prnt(' *o = (unsigned long long)((%s) << 0);' ++ prnt(' *o = (unsigned long long)((%s) | 0);' + ' /* check that %s is an integer */' % (name, name)) + if check_value is not None: + if check_value > 0: +@@ -1250,7 +1250,7 @@ + + def _emit_bytecode_UnknownIntegerType(self, tp, index): + s = ('_cffi_prim_int(sizeof(%s), (\n' +- ' ((%s)-1) << 0 /* check that %s is an integer type */\n' ++ ' ((%s)-1) | 0 /* check that %s is an integer type */\n' + ' ) <= 0)' % (tp.name, tp.name, tp.name)) + self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s) + diff --git a/python-cffi.changes b/python-cffi.changes index 106ea00..997b382 100644 --- a/python-cffi.changes +++ b/python-cffi.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sun May 29 05:23:27 UTC 2016 - badshah400@gmail.com + +- Add python-cffi-avoid-bitshifting-negative-int.patch to actually + fix the "negative left shift" warning by replacing bitshifting + in appropriate places by bitwise and comparison to self; patch + taken from upstream git. Drop cffi-1.5.2-wnoerror.patch: no + longer required. + ------------------------------------------------------------------- Fri May 27 13:00:22 UTC 2016 - jmatejek@suse.com diff --git a/python-cffi.spec b/python-cffi.spec index f04f3c7..67b1d37 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -25,7 +25,8 @@ Group: Development/Languages/Python Url: http://cffi.readthedocs.org Source0: https://pypi.io/packages/source/c/cffi/cffi-%{version}.tar.gz Source1: python-cffi-rpmlintrc -Patch0: cffi-1.5.2-wnoerror.patch +# PATCH-FIX-UPSTREAM python-cffi-avoid-bitshifting-negative-int.patch boo#981848 badshah400@gmail.com -- Use bitwise AND instead of bitshifts to test for integer types; patch submitted upstream +Patch0: python-cffi-avoid-bitshifting-negative-int.patch BuildRequires: gcc-c++ BuildRequires: python-devel BuildRequires: python-setuptools