Stefano Rivera (800ec150) at 14 May 12:09
merge py3.10
Stefano Rivera (97957124) at 14 May 12:09
Backed out changeset b9b73c670a2e
Stefano Rivera (800ec150) at 13 May 23:27
Stefano Rivera (3bbb78a3) at 13 May 23:27
Backed out changeset e169c8518a07
Stefano Rivera (f0ebf126) at 13 May 22:39
Tests: Skip AppTestSocket tests on ConnectionRefusedError
Stefano Rivera (cc71c180) at 13 May 22:39
Tests: Ignore NaN mismatch on app tests under cPython 2.7
From http://buildd.debian-ports.org/status/fetch.php?pkg=python-cffi&arch=hppa&ver=0.9.0-1&stamp=1425533217 0.9.0 fails tests on hppa:
============================= test session starts ==============================
platform linux2 -- Python 2.7.9 -- py-1.4.26 -- pytest-2.6.3
collected 1197 items
c/test_c.py .........s...............................................................................................................................s....................s..........................
testing/test_cdata.py .
testing/test_ctypes.py ..................s...............s.s.s.......s........................ssssss..s..s.............................ssssss.
testing/test_ffi_backend.py .................................................................................s...s.........................................s...........s........s..........s.s...s.
testing/test_function.py .....s...........ss..ss..ss
testing/test_model.py ............
testing/test_ownlib.py ..ss...
testing/test_parsing.py ..................s..
testing/test_platform.py ....
testing/test_unicode_literals.py ............
testing/test_verify.py ..................F...F.......s..........................................................s.................sF...........................F...s...s...
testing/test_verify2.py ..................F...F.......s..........................................................s.................sF...........................F...s...s...
testing/test_version.py .....
testing/test_vgen.py ..............................s..........................................................s.................s................................s...s...
testing/test_vgen2.py ..............................s..........................................................s.................s................................s...s...
testing/test_zdistutils.py ......................................
testing/test_zintegration.py .......
=================================== FAILURES ===================================
_______________________ test_all_integer_and_float_types _______________________
def test_all_integer_and_float_types():
typenames = []
for typename in all_primitive_types:
if (all_primitive_types[typename] == 'c' or
typename == '_Bool' or typename == 'long double'):
pass
else:
typenames.append(typename)
#
ffi = FFI()
ffi.cdef('\n'.join(["%s foo_%s(%s);" % (tp, tp.replace(' ', '_'), tp)
for tp in typenames]))
lib = ffi.verify('\n'.join(["%s foo_%s(%s x) { return (%s)(x+1); }" %
(tp, tp.replace(' ', '_'), tp, tp)
> for tp in typenames]))
testing/test_verify.py:258:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testing/test_verify.py:28: in verify
*args, extra_compile_args=extra_compile_args, **kwds)
cffi/api.py:367: in verify
lib = self.verifier.load_library()
cffi/verifier.py:96: in load_library
self._compile_module()
cffi/verifier.py:192: in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
cffi/ffiplatform.py:28: in compile
outputfilename = _build(tmpdir, ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '/«PKGBUILDDIR»/testing/__pycache__'
ext = <distutils.extension.Extension instance at 0xf9878058>
def _build(tmpdir, ext):
# XXX compact but horrible :-(
from distutils.core import Distribution
import distutils.errors
#
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
dist.run_command('build_ext')
except (distutils.errors.CompileError,
distutils.errors.LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E VerificationError: CompileError: command 'hppa-linux-gnu-gcc' failed with exit status 1
cffi/ffiplatform.py:54: VerificationError
----------------------------- Captured stderr call -----------------------------
testing/__pycache__/_cffi__x1a992f88xe0dfa334.c: In function \u2018_cffi_f_foo_uint16_t\u2019:\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:92:5: error: conversion to \u2018uint16_t {aka short unsigned int}\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:539:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, uint16_t);\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c: In function \u2018_cffi_f_foo_uint8_t\u2019:\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:92:5: error: conversion to \u2018uint8_t {aka unsigned char}\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:599:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, uint8_t);\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c: In function \u2018_cffi_f_foo_unsigned_char\u2019:\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:92:5: error: conversion to \u2018unsigned char\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:639:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned char);\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c: In function \u2018_cffi_f_foo_unsigned_short\u2019:\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:92:5: error: conversion to \u2018short unsigned int\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:719:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned short);\n ^\ncc1: all warnings being treated as errors
________________________ test_fn_unsigned_integer_types ________________________
def test_fn_unsigned_integer_types():
ffi = FFI()
lst = all_unsigned_integer_types(ffi)
cdefsrc = "\n".join(["%s somefn_%s(%s);" % (tp, tp.replace(' ', '_'), tp)
for tp in lst])
ffi.cdef(cdefsrc)
verifysrc = "\n".join(["%s somefn_%s(%s x) { return x; }" %
(tp, tp.replace(' ', '_'), tp) for tp in lst])
> lib = ffi.verify(verifysrc)
testing/test_verify.py:346:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testing/test_verify.py:28: in verify
*args, extra_compile_args=extra_compile_args, **kwds)
cffi/api.py:367: in verify
lib = self.verifier.load_library()
cffi/verifier.py:96: in load_library
self._compile_module()
cffi/verifier.py:192: in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
cffi/ffiplatform.py:28: in compile
outputfilename = _build(tmpdir, ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '/«PKGBUILDDIR»/testing/__pycache__'
ext = <distutils.extension.Extension instance at 0xf9b63f80>
def _build(tmpdir, ext):
# XXX compact but horrible :-(
from distutils.core import Distribution
import distutils.errors
#
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
dist.run_command('build_ext')
except (distutils.errors.CompileError,
distutils.errors.LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E VerificationError: CompileError: command 'hppa-linux-gnu-gcc' failed with exit status 1
cffi/ffiplatform.py:54: VerificationError
----------------------------- Captured stderr call -----------------------------
testing/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c: In function \u2018_cffi_f_somefn_uint16_t\u2019:\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:92:5: error: conversion to \u2018uint16_t {aka short unsigned int}\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:266:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, uint16_t);\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c: In function \u2018_cffi_f_somefn_uint8_t\u2019:\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:92:5: error: conversion to \u2018uint8_t {aka unsigned char}\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:326:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, uint8_t);\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c: In function \u2018_cffi_f_somefn_unsigned_char\u2019:\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:92:5: error: conversion to \u2018unsigned char\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:366:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned char);\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c: In function \u2018_cffi_f_somefn_unsigned_short\u2019:\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:92:5: error: conversion to \u2018short unsigned int\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:446:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned short);\n ^\ncc1: all warnings being treated as errors
____________________________ test_cannot_pass_float ____________________________
def test_cannot_pass_float():
for basetype in ['char', 'short', 'int', 'long', 'long long']:
for sign in ['signed', 'unsigned']:
type = '%s %s' % (sign, basetype)
ffi = FFI()
ffi.cdef("struct foo_s { %s x; };\n"
"int foo(%s);" % (type, type))
lib = ffi.verify("""
struct foo_s { %s x; };
int foo(%s arg) {
return !arg;
}
> """ % (type, type))
testing/test_verify.py:1468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testing/test_verify.py:28: in verify
*args, extra_compile_args=extra_compile_args, **kwds)
cffi/api.py:367: in verify
lib = self.verifier.load_library()
cffi/verifier.py:96: in load_library
self._compile_module()
cffi/verifier.py:192: in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
cffi/ffiplatform.py:28: in compile
outputfilename = _build(tmpdir, ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '/«PKGBUILDDIR»/testing/__pycache__'
ext = <distutils.extension.Extension instance at 0xfaa90828>
def _build(tmpdir, ext):
# XXX compact but horrible :-(
from distutils.core import Distribution
import distutils.errors
#
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
dist.run_command('build_ext')
except (distutils.errors.CompileError,
distutils.errors.LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E VerificationError: CompileError: command 'hppa-linux-gnu-gcc' failed with exit status 1
cffi/ffiplatform.py:54: VerificationError
----------------------------- Captured stderr call -----------------------------
testing/__pycache__/_cffi__x98589f21x8b53330b.c: In function \u2018_cffi_f_foo\u2019:\ntesting/__pycache__/_cffi__x98589f21x8b53330b.c:92:5: error: conversion to \u2018unsigned char\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x98589f21x8b53330b.c:220:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned char);\n ^\ncc1: all warnings being treated as errors
__________________________ test_various_calls_direct ___________________________
def test_various_calls_direct():
> _test_various_calls(force_libffi=False)
testing/test_verify.py:1974:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testing/test_verify.py:1941: in _test_various_calls
""")
testing/test_verify.py:28: in verify
*args, extra_compile_args=extra_compile_args, **kwds)
cffi/api.py:367: in verify
lib = self.verifier.load_library()
cffi/verifier.py:96: in load_library
self._compile_module()
cffi/verifier.py:192: in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
cffi/ffiplatform.py:28: in compile
outputfilename = _build(tmpdir, ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '/«PKGBUILDDIR»/testing/__pycache__'
ext = <distutils.extension.Extension instance at 0xf9d1d760>
def _build(tmpdir, ext):
# XXX compact but horrible :-(
from distutils.core import Distribution
import distutils.errors
#
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
dist.run_command('build_ext')
except (distutils.errors.CompileError,
distutils.errors.LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E VerificationError: CompileError: command 'hppa-linux-gnu-gcc' failed with exit status 1
cffi/ffiplatform.py:54: VerificationError
----------------------------- Captured stderr call -----------------------------
testing/__pycache__/_cffi__x6f70f964x821955ff.c: In function \u2018_cffi_f_tf_bB\u2019:\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c:92:5: error: conversion to \u2018unsigned char\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c:261:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x1 = _cffi_to_c_int(arg1, unsigned char);\n ^\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c: In function \u2018_cffi_f_tf_bH\u2019:\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c:92:5: error: conversion to \u2018short unsigned int\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c:321:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x1 = _cffi_to_c_int(arg1, unsigned short);\n ^\ncc1: all warnings being treated as errors
_______________________ test_all_integer_and_float_types _______________________
def test_all_integer_and_float_types():
typenames = []
for typename in all_primitive_types:
if (all_primitive_types[typename] == 'c' or
typename == '_Bool' or typename == 'long double'):
pass
else:
typenames.append(typename)
#
ffi = FFI()
ffi.cdef('\n'.join(["%s foo_%s(%s);" % (tp, tp.replace(' ', '_'), tp)
for tp in typenames]))
lib = ffi.verify('\n'.join(["%s foo_%s(%s x) { return (%s)(x+1); }" %
(tp, tp.replace(' ', '_'), tp, tp)
> for tp in typenames]))
testing/test_verify.py:258:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testing/test_verify.py:28: in verify
*args, extra_compile_args=extra_compile_args, **kwds)
cffi/api.py:367: in verify
lib = self.verifier.load_library()
cffi/verifier.py:96: in load_library
self._compile_module()
cffi/verifier.py:192: in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
cffi/ffiplatform.py:28: in compile
outputfilename = _build(tmpdir, ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '/«PKGBUILDDIR»/testing/__pycache__'
ext = <distutils.extension.Extension instance at 0xf9af6378>
def _build(tmpdir, ext):
# XXX compact but horrible :-(
from distutils.core import Distribution
import distutils.errors
#
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
dist.run_command('build_ext')
except (distutils.errors.CompileError,
distutils.errors.LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E VerificationError: CompileError: command 'hppa-linux-gnu-gcc' failed with exit status 1
cffi/ffiplatform.py:54: VerificationError
----------------------------- Captured stderr call -----------------------------
testing/__pycache__/_cffi__x1a992f88xe0dfa334.c: In function \u2018_cffi_f_foo_uint16_t\u2019:\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:92:5: error: conversion to \u2018uint16_t {aka short unsigned int}\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:539:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, uint16_t);\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c: In function \u2018_cffi_f_foo_uint8_t\u2019:\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:92:5: error: conversion to \u2018uint8_t {aka unsigned char}\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:599:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, uint8_t);\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c: In function \u2018_cffi_f_foo_unsigned_char\u2019:\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:92:5: error: conversion to \u2018unsigned char\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:639:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned char);\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c: In function \u2018_cffi_f_foo_unsigned_short\u2019:\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:92:5: error: conversion to \u2018short unsigned int\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x1a992f88xe0dfa334.c:719:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned short);\n ^\ncc1: all warnings being treated as errors
________________________ test_fn_unsigned_integer_types ________________________
def test_fn_unsigned_integer_types():
ffi = FFI()
lst = all_unsigned_integer_types(ffi)
cdefsrc = "\n".join(["%s somefn_%s(%s);" % (tp, tp.replace(' ', '_'), tp)
for tp in lst])
ffi.cdef(cdefsrc)
verifysrc = "\n".join(["%s somefn_%s(%s x) { return x; }" %
(tp, tp.replace(' ', '_'), tp) for tp in lst])
> lib = ffi.verify(verifysrc)
testing/test_verify.py:346:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testing/test_verify.py:28: in verify
*args, extra_compile_args=extra_compile_args, **kwds)
cffi/api.py:367: in verify
lib = self.verifier.load_library()
cffi/verifier.py:96: in load_library
self._compile_module()
cffi/verifier.py:192: in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
cffi/ffiplatform.py:28: in compile
outputfilename = _build(tmpdir, ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '/«PKGBUILDDIR»/testing/__pycache__'
ext = <distutils.extension.Extension instance at 0xf9eda968>
def _build(tmpdir, ext):
# XXX compact but horrible :-(
from distutils.core import Distribution
import distutils.errors
#
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
dist.run_command('build_ext')
except (distutils.errors.CompileError,
distutils.errors.LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E VerificationError: CompileError: command 'hppa-linux-gnu-gcc' failed with exit status 1
cffi/ffiplatform.py:54: VerificationError
----------------------------- Captured stderr call -----------------------------
testing/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c: In function \u2018_cffi_f_somefn_uint16_t\u2019:\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:92:5: error: conversion to \u2018uint16_t {aka short unsigned int}\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:266:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, uint16_t);\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c: In function \u2018_cffi_f_somefn_uint8_t\u2019:\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:92:5: error: conversion to \u2018uint8_t {aka unsigned char}\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:326:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, uint8_t);\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c: In function \u2018_cffi_f_somefn_unsigned_char\u2019:\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:92:5: error: conversion to \u2018unsigned char\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:366:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned char);\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c: In function \u2018_cffi_f_somefn_unsigned_short\u2019:\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:92:5: error: conversion to \u2018short unsigned int\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6b0c9c48xe5d68d0f.c:446:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned short);\n ^\ncc1: all warnings being treated as errors
____________________________ test_cannot_pass_float ____________________________
def test_cannot_pass_float():
for basetype in ['char', 'short', 'int', 'long', 'long long']:
for sign in ['signed', 'unsigned']:
type = '%s %s' % (sign, basetype)
ffi = FFI()
ffi.cdef("struct foo_s { %s x; };\n"
"int foo(%s);" % (type, type))
lib = ffi.verify("""
struct foo_s { %s x; };
int foo(%s arg) {
return !arg;
}
> """ % (type, type))
testing/test_verify.py:1468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testing/test_verify.py:28: in verify
*args, extra_compile_args=extra_compile_args, **kwds)
cffi/api.py:367: in verify
lib = self.verifier.load_library()
cffi/verifier.py:96: in load_library
self._compile_module()
cffi/verifier.py:192: in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
cffi/ffiplatform.py:28: in compile
outputfilename = _build(tmpdir, ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '/«PKGBUILDDIR»/testing/__pycache__'
ext = <distutils.extension.Extension instance at 0xf9c9d198>
def _build(tmpdir, ext):
# XXX compact but horrible :-(
from distutils.core import Distribution
import distutils.errors
#
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
dist.run_command('build_ext')
except (distutils.errors.CompileError,
distutils.errors.LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E VerificationError: CompileError: command 'hppa-linux-gnu-gcc' failed with exit status 1
cffi/ffiplatform.py:54: VerificationError
----------------------------- Captured stderr call -----------------------------
/«PKGBUILDDIR»/cffi/vengine_cpy.py:184: UserWarning: reimporting '_cffi__xba49e658xffbca8da' might overwrite older definitions\n % (self.verifier.get_module_name()))\ntesting/__pycache__/_cffi__x98589f21x8b53330b.c: In function \u2018_cffi_f_foo\u2019:\ntesting/__pycache__/_cffi__x98589f21x8b53330b.c:92:5: error: conversion to \u2018unsigned char\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x98589f21x8b53330b.c:220:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x0 = _cffi_to_c_int(arg0, unsigned char);\n ^\ncc1: all warnings being treated as errors
__________________________ test_various_calls_direct ___________________________
def test_various_calls_direct():
> _test_various_calls(force_libffi=False)
testing/test_verify.py:1974:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
testing/test_verify.py:1941: in _test_various_calls
""")
testing/test_verify.py:28: in verify
*args, extra_compile_args=extra_compile_args, **kwds)
cffi/api.py:367: in verify
lib = self.verifier.load_library()
cffi/verifier.py:96: in load_library
self._compile_module()
cffi/verifier.py:192: in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
cffi/ffiplatform.py:28: in compile
outputfilename = _build(tmpdir, ext)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '/«PKGBUILDDIR»/testing/__pycache__'
ext = <distutils.extension.Extension instance at 0xf9b9e648>
def _build(tmpdir, ext):
# XXX compact but horrible :-(
from distutils.core import Distribution
import distutils.errors
#
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
dist.run_command('build_ext')
except (distutils.errors.CompileError,
distutils.errors.LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E VerificationError: CompileError: command 'hppa-linux-gnu-gcc' failed with exit status 1
cffi/ffiplatform.py:54: VerificationError
----------------------------- Captured stderr call -----------------------------
testing/__pycache__/_cffi__x6f70f964x821955ff.c: In function \u2018_cffi_f_tf_bB\u2019:\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c:92:5: error: conversion to \u2018unsigned char\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c:261:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x1 = _cffi_to_c_int(arg1, unsigned char);\n ^\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c: In function \u2018_cffi_f_tf_bH\u2019:\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c:92:5: error: conversion to \u2018short unsigned int\u2019 from \u2018int\u2019 may alter its value [-Werror=conversion]\n (sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \\\n ^\ntesting/__pycache__/_cffi__x6f70f964x821955ff.c:321:8: note: in expansion of macro \u2018_cffi_to_c_int\u2019\n x1 = _cffi_to_c_int(arg1, unsigned short);\n ^\ncc1: all warnings being treated as errors
============= 8 failed, 1129 passed, 60 skipped in 816.83 seconds ==============
If I understand correctly in https://bugs.debian.org/1024271#25 this was an upstream libffi bug, and is now resolved.
A couple of years ago the libffi port for hppa-linux was changed from using a trampoline executed on the stack to the function descriptor technique used by ia64. This doesn't require an executable stack and is simpler. However, function pointers need to have the PLABEL bit set in the pointer. As a result, a simple cast can't be used to convert closure pointers to function pointers.
python-cffi uses its own closure allocation so the problem can't be fixed in libffi.
I added a macro CFFI_FN to do the conversion. It shouldn't affect other architectures. There is a similar define in libffi.
Fixes: https://bugs.debian.org/1024271
--HG-- branch : hppa
Stefano Rivera (ab11bfa5) at 19 Dec 23:43
Fix the test failures on hppa
Confirmed the source of this is the same change that caused #533.
Python 3.11 pydebug builds trigger this assertion failure:
$ python3.11-dbg -m pytest --tb=native c testing/cffi0/test_verify.py -vv -k test_ffi_gc_size_arg -s
==================================== test session starts =====================================
platform linux -- Python 3.11.0+, pytest-7.1.2, pluggy-1.0.0+repack -- /usr/bin/python3.11-dbg
cachedir: .pytest_cache
rootdir: /tmp/cffi/testarea
plugins: mock-3.8.2, xonsh-0.13.3, cov-4.0.0
collected 396 items / 394 deselected / 2 selected
testing/cffi0/test_verify.py::test_ffi_gc_size_arg ../Modules/gcmodule.c:442: update_refs: Assertion "gc_get_refs(gc) != 0" failed
Enable tracemalloc to get the memory block allocation traceback
object address : 0x7ff93cbccb40
object refcount : 0
object type : 0x7ff93f251b40
object type name: _cffi_backend.__CDataGCP
object repr : <refcnt 0 at 0x7ff93cbccb40>
Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized
Current thread 0x00007ff93feac040 (most recent call first):
Garbage-collecting
File "/tmp/cffi/testarea/testing/cffi0/test_verify.py", line 2483 in test_ffi_gc_size_arg
File "/usr/lib/python3/dist-packages/_pytest/python.py", line 192 in pytest_pyfunc_call
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/lib/python3/dist-packages/_pytest/python.py", line 1761 in runtest
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 166 in pytest_runtest_call
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 259 in <lambda>
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 338 in from_call
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 258 in call_runtest_hook
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 219 in call_and_report
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 130 in runtestprotocol
File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 111 in pytest_runtest_protocol
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 347 in pytest_runtestloop
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 322 in _main
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 268 in wrap_session
File "/usr/lib/python3/dist-packages/_pytest/main.py", line 315 in pytest_cmdline_main
File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line 39 in _multicall
File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line 80 in _hookexec
File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 265 in __call__
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 164 in main
File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 187 in console_main
File "/usr/lib/python3/dist-packages/pytest/__main__.py", line 5 in <module>
File "/usr/lib/python3.11/runpy.py", line 88 in _run_code
File "/usr/lib/python3.11/runpy.py", line 198 in _run_module_as_main
Extension modules: _cffi_backend, _cffi__xb171839ex98cfdaa (total: 2)
Aborted
See https://bugs.debian.org/1024767 for a full description.
This raises a ResourceWarning under Python 3.11 pydebug builds:
from cffi import FFI
ffi = FFI()
p = ffi.new("int *", 123)
ffi.gc(p, lambda x: None)
gc:0: ResourceWarning: Object of type _cffi_backend.__CDataGCP is not untracked before destruction
You can find similar code in testing/cffi0/test_ffi_backend.py
, so just running that and looking for warning is good enough.
To add a test for the warning, we could:
with warnings.catch_warnings(record=True) as w:
ffi.gc(p, lambda x: None)
assert w == []
Python 3.11 added ResourceWarnings if PyObject_GC_UnTrack
isn't called.
In some cases, this warning seems to trigger an assertion failure on big-endian PPC, which is why I looked at it.
Stefano Rivera (616d6a19) at 28 Jan 02:49
pycparser isn't required, it's vendored
Stefano Rivera (09759a07) at 28 Jan 01:29
This is version 7.3.8
Stefano Rivera (28636b5e) at 22 Jan 16:48
bpo-43920: Make load_verify_locations(cadata) error message consist...
... and 1 more commit
Stefano Rivera (1bb775cd) at 22 Jan 16:21
bpo-43794: OpenSSL 3.0.0: set OP_IGNORE_UNEXPECTED_EOF by default