[Python-modules-commits] r27391 - in packages/python-cffi/trunk/debian (4 files)

stefanor at users.alioth.debian.org stefanor at users.alioth.debian.org
Wed Jan 22 11:24:01 UTC 2014


    Date: Wednesday, January 22, 2014 @ 11:24:00
  Author: stefanor
Revision: 27391

* Patch: link-libm. Fixes build failures on Sparc and S390x, where libm
  isn't implicitly linked (Closes: #733517)
* Patch: skip-sparc-failure. Skip a test on Sparc that crashes the test
  runner.

Added:
  packages/python-cffi/trunk/debian/patches/link-libm
  packages/python-cffi/trunk/debian/patches/skip-sparc-failure
Modified:
  packages/python-cffi/trunk/debian/changelog
  packages/python-cffi/trunk/debian/patches/series

Modified: packages/python-cffi/trunk/debian/changelog
===================================================================
--- packages/python-cffi/trunk/debian/changelog	2014-01-22 08:25:02 UTC (rev 27390)
+++ packages/python-cffi/trunk/debian/changelog	2014-01-22 11:24:00 UTC (rev 27391)
@@ -1,3 +1,12 @@
+python-cffi (0.8.1-2) UNRELEASED; urgency=medium
+
+  * Patch: link-libm. Fixes build failures on Sparc and S390x, where libm
+    isn't implicitly linked (Closes: #733517)
+  * Patch: skip-sparc-failure. Skip a test on Sparc that crashes the test
+    runner.
+
+ -- Stefano Rivera <stefanor at debian.org>  Sat, 18 Jan 2014 23:43:14 +0200
+
 python-cffi (0.8.1-1) unstable; urgency=medium
 
   * New upstream release.

Added: packages/python-cffi/trunk/debian/patches/link-libm
===================================================================
--- packages/python-cffi/trunk/debian/patches/link-libm	                        (rev 0)
+++ packages/python-cffi/trunk/debian/patches/link-libm	2014-01-22 11:24:00 UTC (rev 27391)
@@ -0,0 +1,154 @@
+Description: Link math tests using `sin()` to `libm`
+Origin: upstream, https://bitbucket.org/cffi/cffi/commits/f3dabd52fbeb54e814e14120cb27ceae3ad266ce
+Author: Vincent Bernat <bernat at luffy.cx>
+Bug-Debian: http://bugs.debian.org/733517
+Last-Update: 2014-01-21
+
+--- a/testing/test_verify.py
++++ b/testing/test_verify.py
+@@ -63,13 +63,13 @@
+ def test_simple_case():
+     ffi = FFI()
+     ffi.cdef("double sin(double x);")
+-    lib = ffi.verify('#include <math.h>')
++    lib = ffi.verify('#include <math.h>', libraries=["m"])
+     assert lib.sin(1.23) == math.sin(1.23)
+ 
+ def test_rounding_1():
+     ffi = FFI()
+     ffi.cdef("float sin(double x);")
+-    lib = ffi.verify('#include <math.h>')
++    lib = ffi.verify('#include <math.h>', libraries=["m"])
+     res = lib.sin(1.23)
+     assert res != math.sin(1.23)     # not exact, because of double->float
+     assert abs(res - math.sin(1.23)) < 1E-5
+@@ -77,7 +77,7 @@
+ def test_rounding_2():
+     ffi = FFI()
+     ffi.cdef("double sin(float x);")
+-    lib = ffi.verify('#include <math.h>')
++    lib = ffi.verify('#include <math.h>', libraries=["m"])
+     res = lib.sin(1.23)
+     assert res != math.sin(1.23)     # not exact, because of double->float
+     assert abs(res - math.sin(1.23)) < 1E-5
+@@ -103,7 +103,7 @@
+ def test_longdouble():
+     ffi = FFI()
+     ffi.cdef("long double sinl(long double x);")
+-    lib = ffi.verify('#include <math.h>')
++    lib = ffi.verify('#include <math.h>', libraries=["m"])
+     for input in [1.23,
+                   ffi.cast("double", 1.23),
+                   ffi.cast("long double", 1.23)]:
+--- a/testing/test_zdistutils.py
++++ b/testing/test_zdistutils.py
+@@ -25,7 +25,8 @@
+         ffi = FFI()
+         ffi.cdef("double sin(double x);")
+         csrc = '/*hi there %s!*/\n#include <math.h>\n' % self
+-        v = Verifier(ffi, csrc, force_generic_engine=self.generic)
++        v = Verifier(ffi, csrc, force_generic_engine=self.generic,
++                     libraries=["m"])
+         v.write_source()
+         with open(v.sourcefilename, 'r') as f:
+             data = f.read()
+@@ -35,7 +36,8 @@
+         ffi = FFI()
+         ffi.cdef("double sin(double x);")
+         csrc = '/*hi there %s!*/\n#include <math.h>\n' % self
+-        v = Verifier(ffi, csrc, force_generic_engine=self.generic)
++        v = Verifier(ffi, csrc, force_generic_engine=self.generic,
++                     libraries=["m"])
+         v.sourcefilename = filename = str(udir.join('write_source.c'))
+         v.write_source()
+         assert filename == v.sourcefilename
+@@ -47,7 +49,8 @@
+         ffi = FFI()
+         ffi.cdef("double sin(double x);")
+         csrc = '/*hi there %s!*/\n#include <math.h>\n' % self
+-        v = Verifier(ffi, csrc, force_generic_engine=self.generic)
++        v = Verifier(ffi, csrc, force_generic_engine=self.generic,
++                     libraries=["m"])
+         try:
+             from StringIO import StringIO
+         except ImportError:
+@@ -60,7 +63,8 @@
+         ffi = FFI()
+         ffi.cdef("double sin(double x);")
+         csrc = '/*hi there %s!*/\n#include <math.h>\n' % self
+-        v = Verifier(ffi, csrc, force_generic_engine=self.generic)
++        v = Verifier(ffi, csrc, force_generic_engine=self.generic,
++                     libraries=["m"])
+         v.compile_module()
+         assert v.get_module_name().startswith('_cffi_')
+         if v.generates_python_module():
+@@ -71,7 +75,8 @@
+         ffi = FFI()
+         ffi.cdef("double sin(double x);")
+         csrc = '/*hi there %s!2*/\n#include <math.h>\n' % self
+-        v = Verifier(ffi, csrc, force_generic_engine=self.generic)
++        v = Verifier(ffi, csrc, force_generic_engine=self.generic,
++                     libraries=["m"])
+         basename = self.__class__.__name__ + 'test_compile_module'
+         v.modulefilename = filename = str(udir.join(basename + '.so'))
+         v.compile_module()
+@@ -87,7 +92,8 @@
+             ffi = FFI()
+             ffi.cdef("%s sin(double x);" % csrc)
+             v = Verifier(ffi, "#include <math.h>",
+-                         force_generic_engine=self.generic)
++                         force_generic_engine=self.generic,
++                         libraries=["m"])
+             names.append(v.get_module_name())
+         assert names[0] == names[1] != names[2]
+ 
+@@ -104,7 +110,8 @@
+         ffi = FFI()
+         ffi.cdef("double sin(double x);")
+         csrc = '/*hi there %s!3*/\n#include <math.h>\n' % self
+-        v = Verifier(ffi, csrc, force_generic_engine=self.generic)
++        v = Verifier(ffi, csrc, force_generic_engine=self.generic,
++                     libraries=["m"])
+         library = v.load_library()
+         assert library.sin(12.3) == math.sin(12.3)
+ 
+@@ -114,7 +121,8 @@
+         csrc = '/*hi there %s!4*/#include "test_verifier_args.h"\n' % self
+         udir.join('test_verifier_args.h').write('#include <math.h>\n')
+         v = Verifier(ffi, csrc, include_dirs=[str(udir)],
+-                     force_generic_engine=self.generic)
++                     force_generic_engine=self.generic,
++                     libraries=["m"])
+         library = v.load_library()
+         assert library.sin(12.3) == math.sin(12.3)
+ 
+@@ -122,7 +130,8 @@
+         ffi = FFI()
+         ffi.cdef("double sin(double x);")
+         csrc = "/*6%s*/\n#include <math.h>" % self
+-        lib = ffi.verify(csrc, force_generic_engine=self.generic)
++        lib = ffi.verify(csrc, force_generic_engine=self.generic,
++                         libraries=["m"])
+         assert lib.sin(12.3) == math.sin(12.3)
+         assert isinstance(ffi.verifier, Verifier)
+         with open(ffi.verifier.sourcefilename, 'r') as f:
+@@ -139,7 +148,8 @@
+     #endif
+     '''
+         lib = ffi.verify(csrc, define_macros=[('TEST_EXTENSION_OBJECT', '1')],
+-                         force_generic_engine=self.generic)
++                         force_generic_engine=self.generic,
++                         libraries=["m"])
+         assert lib.sin(12.3) == math.sin(12.3)
+         v = ffi.verifier
+         ext = v.get_extension()
+@@ -152,7 +162,8 @@
+         ffi = FFI()
+         ffi.cdef("double sin(double x);")
+         csrc = '/*hi there9!%s*/\n#include <math.h>\n' % self
+-        v = Verifier(ffi, csrc, force_generic_engine=self.generic)
++        v = Verifier(ffi, csrc, force_generic_engine=self.generic,
++                     libraries=["m"])
+         assert not os.path.exists(v.sourcefilename)
+         v.get_extension()
+         assert os.path.exists(v.sourcefilename)

Modified: packages/python-cffi/trunk/debian/patches/series
===================================================================
--- packages/python-cffi/trunk/debian/patches/series	2014-01-22 08:25:02 UTC (rev 27390)
+++ packages/python-cffi/trunk/debian/patches/series	2014-01-22 11:24:00 UTC (rev 27391)
@@ -1 +1,3 @@
 py3.4-test-failure
+link-libm
+skip-sparc-failure

Added: packages/python-cffi/trunk/debian/patches/skip-sparc-failure
===================================================================
--- packages/python-cffi/trunk/debian/patches/skip-sparc-failure	                        (rev 0)
+++ packages/python-cffi/trunk/debian/patches/skip-sparc-failure	2014-01-22 11:24:00 UTC (rev 27391)
@@ -0,0 +1,20 @@
+Description: Test fails spectacularly on sparc. Skip.
+ The test is described as dodgy in the docstring, and takes down the python
+ interpreter.
+Author: Stefano Rivera <stefanor at debian.org>
+Forwarded: https://bitbucket.org/cffi/cffi/pull-request/24
+Last-Update: 2014-01-21
+Bug-Debian: http://bugs.debian.org/733517
+
+--- a/testing/test_verify.py
++++ b/testing/test_verify.py
+@@ -1133,6 +1133,9 @@
+     xxx
+ 
+ def test_opaque_integer_as_function_result():
++    import platform
++    if platform.machine().startswith('sparc'):
++        py.test.skip('Breaks horribly on sparc (SIGILL + corrupted stack)')
+     # XXX bad abuse of "struct { ...; }".  It only works a bit by chance
+     # anyway.  XXX think about something better :-(
+     ffi = FFI()




More information about the Python-modules-commits mailing list