cffi_tests.cffi1.test_verify1:test_struct_signedness_ignored
self = <distutils.unixccompiler.UnixCCompiler object at 0x12e80d90>
obj = './verify42.o', src = 'verify42.c', ext = '.c'
cc_args = ['-I/buildbot/slave/pypy-c-jit-linux-x86-32/venv/pypy-venv/include', '-I/buildbot/slave/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c']
extra_postargs = ['-Werror', '-Wall', '-Wextra', '-Wconversion', '-Wno-unused-parameter', '-Wno-unreachable-code']
pp_opts = ['-I/buildbot/slave/pypy-c-jit-linux-x86-32/venv/pypy-venv/include', '-I/buildbot/slave/pypy-c-jit-linux-x86-32/build/include/pypy3.12']
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
compiler_so = compiler_fixup(self.compiler_so, cc_args + extra_postargs)
try:
> self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/unixccompiler.py:188:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <distutils.unixccompiler.UnixCCompiler object at 0x12e80d90>
cmd = ['gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-I/buildbot/slave/pypy-c-jit-linux-x86-32/venv/pypy-venv/include', ...]
kwargs = {}
def spawn(self, cmd, **kwargs):
> spawn(cmd, dry_run=self.dry_run, **kwargs)
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/ccompiler.py:1041:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cmd = '/opt/rh/gcc-toolset-14/root/usr/bin/gcc', search_path = 1, verbose = 0
dry_run = 0
env = {'AUDITWHEEL_ARCH': 'i686', 'AUDITWHEEL_PLAT': 'manylinux_2_28_i686', 'AUDITWHEEL_POLICY': 'manylinux_2_28', 'DEVTOOLSET_ROOTPATH': '/opt/rh/gcc-toolset-14/root', ...}
def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None): # noqa: C901
"""Run another program, specified as a command list 'cmd', in a new process.
'cmd' is just the argument list for the new process, ie.
cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
There is no way to run a program with a name different from that of its
executable.
If 'search_path' is true (the default), the system's executable
search path will be used to find the program; otherwise, cmd[0]
must be the exact path to the executable. If 'dry_run' is true,
the command will not actually be run.
Raise DistutilsExecError if running the program fails in any way; just
return on success.
"""
# cmd is documented as a list, but just in case some code passes a tuple
# in, protect our %-formatting code against horrible death
cmd = list(cmd)
log.info(subprocess.list2cmdline(cmd))
if dry_run:
return
if search_path:
executable = find_executable(cmd[0])
if executable is not None:
cmd[0] = executable
env = env if env is not None else dict(os.environ)
if sys.platform == 'darwin':
from distutils.util import MACOSX_VERSION_VAR, get_macosx_target_ver
macosx_target_ver = get_macosx_target_ver()
if macosx_target_ver:
env[MACOSX_VERSION_VAR] = macosx_target_ver
try:
proc = subprocess.Popen(cmd, env=env)
proc.wait()
exitcode = proc.returncode
except OSError as exc:
if not DEBUG:
cmd = cmd[0]
raise DistutilsExecError(f"command {cmd!r} failed: {exc.args[-1]}") from exc
if exitcode:
if not DEBUG:
cmd = cmd[0]
> raise DistutilsExecError(f"command {cmd!r} failed with exit code {exitcode}")
E distutils.errors.DistutilsExecError: command '/opt/rh/gcc-toolset-14/root/usr/bin/gcc' failed with exit code 1
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py:68: DistutilsExecError
During handling of the above exception, another exception occurred:
tmpdir = '.', ext = <setuptools.extension.Extension('verify42') at 0xb1a4a30>
compiler_verbose = 1, debug = 0
def _build(tmpdir, ext, compiler_verbose=0, debug=None):
# XXX compact but horrible :-(
from cffi._shimmed_dist_utils import Distribution, CompileError, LinkError, set_threshold, set_verbosity
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
if debug is None:
debug = sys.flags.debug
options['debug'] = ('ffiplatform', debug)
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
old_level = set_threshold(0) or 0
try:
set_verbosity(compiler_verbose)
> dist.run_command('build_ext')
../build/lib_pypy/cffi/ffiplatform.py:84:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <setuptools.dist.Distribution object at 0x122f38b0>
command = 'build_ext'
def run_command(self, command):
self.set_defaults()
# Postpone defaults until all explicit configuration is considered
# (setup() args, config files, command line and plugins)
> super().run_command(command)
pypy-venv/lib/pypy3.12/site-packages/setuptools/dist.py:968:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <setuptools.dist.Distribution object at 0x122f38b0>
command = 'build_ext'
def run_command(self, command):
"""Do whatever it takes to run a command (including nothing at all,
if the command has already been run). Specifically: if we have
already created and run the command named by 'command', return
silently without doing anything. If the command named by 'command'
doesn't even have a command object yet, create one. Then invoke
'run()' on that command object (or an existing one).
"""
# Already been here, done that? then return silently.
if self.have_run.get(command):
return
log.info("running %s", command)
cmd_obj = self.get_command_obj(command)
cmd_obj.ensure_finalized()
> cmd_obj.run()
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/dist.py:988:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <setuptools.command.build_ext.build_ext object at 0x12e80db0>
def run(self):
"""Build extensions in build directory, then copy if --inplace"""
old_inplace, self.inplace = self.inplace, 0
> _build_ext.run(self)
pypy-venv/lib/pypy3.12/site-packages/setuptools/command/build_ext.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <setuptools.command.build_ext.build_ext object at 0x12e80db0>
def run(self): # noqa: C901
from ..ccompiler import new_compiler
# 'self.extensions', as supplied by setup.py, is a list of
# Extension instances. See the documentation for Extension (in
# distutils.extension) for details.
#
# For backwards compatibility with Distutils 0.8.2 and earlier, we
# also allow the 'extensions' list to be a list of tuples:
# (ext_name, build_info)
# where build_info is a dictionary containing everything that
# Extension instances do except the name, with a few things being
# differently named. We convert these 2-tuples to Extension
# instances as needed.
if not self.extensions:
return
# If we were asked to build any C/C++ libraries, make sure that the
# directory where we put them is in the library search path for
# linking extensions.
if self.distribution.has_c_libraries():
build_clib = self.get_finalized_command('build_clib')
self.libraries.extend(build_clib.get_library_names() or [])
self.library_dirs.append(build_clib.build_clib)
# Setup the CCompiler object that we'll use to do all the
# compiling and linking
self.compiler = new_compiler(
compiler=self.compiler,
verbose=self.verbose,
dry_run=self.dry_run,
force=self.force,
)
customize_compiler(self.compiler)
# If we are cross-compiling, init the compiler now (if we are not
# cross-compiling, init would not hurt, but people may rely on
# late initialization of compiler even if they shouldn't...)
if os.name == 'nt' and self.plat_name != get_platform():
self.compiler.initialize(self.plat_name)
# And make sure that any compile/link-related options (which might
# come from the command-line or from the setup script) are set in
# that CCompiler object -- that way, they automatically apply to
# all compiling and linking done here.
if self.include_dirs is not None:
self.compiler.set_include_dirs(self.include_dirs)
if self.define is not None:
# 'define' option is a list of (name,value) tuples
for name, value in self.define:
self.compiler.define_macro(name, value)
if self.undef is not None:
for macro in self.undef:
self.compiler.undefine_macro(macro)
if self.libraries is not None:
self.compiler.set_libraries(self.libraries)
if self.library_dirs is not None:
self.compiler.set_library_dirs(self.library_dirs)
if self.rpath is not None:
self.compiler.set_runtime_library_dirs(self.rpath)
if self.link_objects is not None:
self.compiler.set_link_objects(self.link_objects)
# Now actually compile and link everything.
> self.build_extensions()
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/command/build_ext.py:359:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <setuptools.command.build_ext.build_ext object at 0x12e80db0>
def build_extensions(self):
# First, sanity-check the 'extensions' list
self.check_extensions_list(self.extensions)
if self.parallel:
self._build_extensions_parallel()
else:
> self._build_extensions_serial()
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/command/build_ext.py:479:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <setuptools.command.build_ext.build_ext object at 0x12e80db0>
def _build_extensions_serial(self):
for ext in self.extensions:
with self._filter_build_errors(ext):
> self.build_extension(ext)
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/command/build_ext.py:505:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <setuptools.command.build_ext.build_ext object at 0x12e80db0>
ext = <setuptools.extension.Extension('verify42') at 0xb1a4a30>
def build_extension(self, ext):
ext._convert_pyx_sources_to_lang()
_compiler = self.compiler
try:
if isinstance(ext, Library):
self.compiler = self.shlib_compiler
> _build_ext.build_extension(self, ext)
pypy-venv/lib/pypy3.12/site-packages/setuptools/command/build_ext.py:252:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <setuptools.command.build_ext.build_ext object at 0x12e80db0>
ext = <setuptools.extension.Extension('verify42') at 0xb1a4a30>
def build_extension(self, ext):
sources = ext.sources
if sources is None or not isinstance(sources, (list, tuple)):
raise DistutilsSetupError(
"in 'ext_modules' option (extension '%s'), "
"'sources' must be present and must be "
"a list of source filenames" % ext.name
)
# sort to make the resulting .so file build reproducible
sources = sorted(sources)
ext_path = self.get_ext_fullpath(ext.name)
depends = sources + ext.depends
if not (self.force or newer_group(depends, ext_path, 'newer')):
log.debug("skipping '%s' extension (up-to-date)", ext.name)
return
else:
log.info("building '%s' extension", ext.name)
# First, scan the sources for SWIG definition files (.i), run
# SWIG on 'em to create .c files, and modify the sources list
# accordingly.
sources = self.swig_sources(sources, ext)
# Next, compile the source code to object files.
# XXX not honouring 'define_macros' or 'undef_macros' -- the
# CCompiler API needs to change to accommodate this, and I
# want to do one thing at a time!
# Two possible sources for extra compiler arguments:
# - 'extra_compile_args' in Extension object
# - CFLAGS environment variable (not particularly
# elegant, but people seem to expect it and I
# guess it's useful)
# The environment variable should take precedence, and
# any sensible compiler will give precedence to later
# command line args. Hence we combine them in order:
extra_args = ext.extra_compile_args or []
macros = ext.define_macros[:]
for undef in ext.undef_macros:
macros.append((undef,))
> objects = self.compiler.compile(
sources,
output_dir=self.build_temp,
macros=macros,
include_dirs=ext.include_dirs,
debug=self.debug,
extra_postargs=extra_args,
depends=ext.depends,
)
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/command/build_ext.py:560:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <distutils.unixccompiler.UnixCCompiler object at 0x12e80d90>
sources = ['verify42.c'], output_dir = '.', macros = [], include_dirs = []
debug = 0, extra_preargs = None
extra_postargs = ['-Werror', '-Wall', '-Wextra', '-Wconversion', '-Wno-unused-parameter', '-Wno-unreachable-code']
depends = []
def compile(
self,
sources,
output_dir=None,
macros=None,
include_dirs=None,
debug=0,
extra_preargs=None,
extra_postargs=None,
depends=None,
):
"""Compile one or more source files.
'sources' must be a list of filenames, most likely C/C++
files, but in reality anything that can be handled by a
particular compiler and compiler class (eg. MSVCCompiler can
handle resource files in 'sources'). Return a list of object
filenames, one per source filename in 'sources'. Depending on
the implementation, not all source files will necessarily be
compiled, but all corresponding object filenames will be
returned.
If 'output_dir' is given, object files will be put under it, while
retaining their original path component. That is, "foo/bar.c"
normally compiles to "foo/bar.o" (for a Unix implementation); if
'output_dir' is "build", then it would compile to
"build/foo/bar.o".
'macros', if given, must be a list of macro definitions. A macro
definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
The former defines a macro; if the value is None, the macro is
defined without an explicit value. The 1-tuple case undefines a
macro. Later definitions/redefinitions/ undefinitions take
precedence.
'include_dirs', if given, must be a list of strings, the
directories to add to the default include file search path for this
compilation only.
'debug' is a boolean; if true, the compiler will be instructed to
output debug symbols in (or alongside) the object file(s).
'extra_preargs' and 'extra_postargs' are implementation- dependent.
On platforms that have the notion of a command-line (e.g. Unix,
DOS/Windows), they are most likely lists of strings: extra
command-line arguments to prepend/append to the compiler command
line. On other platforms, consult the implementation class
documentation. In any event, they are intended as an escape hatch
for those occasions when the abstract compiler framework doesn't
cut the mustard.
'depends', if given, is a list of filenames that all targets
depend on. If a source file is older than any file in
depends, then the source file will be recompiled. This
supports dependency tracking, but only at a coarse
granularity.
Raises CompileError on failure.
"""
# A concrete compiler class can either override this method
# entirely or implement _compile().
macros, objects, extra_postargs, pp_opts, build = self._setup_compile(
output_dir, macros, include_dirs, sources, depends, extra_postargs
)
cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
for obj in objects:
try:
src, ext = build[obj]
except KeyError:
continue
> self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/ccompiler.py:600:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <distutils.unixccompiler.UnixCCompiler object at 0x12e80d90>
obj = './verify42.o', src = 'verify42.c', ext = '.c'
cc_args = ['-I/buildbot/slave/pypy-c-jit-linux-x86-32/venv/pypy-venv/include', '-I/buildbot/slave/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c']
extra_postargs = ['-Werror', '-Wall', '-Wextra', '-Wconversion', '-Wno-unused-parameter', '-Wno-unreachable-code']
pp_opts = ['-I/buildbot/slave/pypy-c-jit-linux-x86-32/venv/pypy-venv/include', '-I/buildbot/slave/pypy-c-jit-linux-x86-32/build/include/pypy3.12']
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
compiler_so = compiler_fixup(self.compiler_so, cc_args + extra_postargs)
try:
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
except DistutilsExecError as msg:
> raise CompileError(msg)
E distutils.errors.CompileError: command '/opt/rh/gcc-toolset-14/root/usr/bin/gcc' failed with exit code 1
pypy-venv/lib/pypy3.12/site-packages/setuptools/_distutils/unixccompiler.py:190: CompileError
During handling of the above exception, another exception occurred:
typename = 'int', real = 'unsigned int', expect_mismatch = False
def _check_field_match(typename, real, expect_mismatch):
ffi = FFI()
testing_by_size = (expect_mismatch == 'by_size')
if testing_by_size:
expect_mismatch = ffi.sizeof(typename) != ffi.sizeof(real)
ffi.cdef("struct foo_s { %s x; ...; };" % typename)
try:
> ffi.verify("struct foo_s { %s x; };" % real)
../build/extra_tests/cffi_tests/cffi1/test_verify1.py:515:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <extra_tests.cffi_tests.cffi1.test_verify1.FFI object at 0xf31fbc50>
preamble = 'struct foo_s { unsigned int x; };', args = (), kwds = {}
module_name = 'verify42'
def verify(self, preamble='', *args, **kwds):
# HACK to reuse the tests from ../cffi0/test_verify.py
FFI._verify_counter += 1
module_name = 'verify%d' % FFI._verify_counter
try:
del self._assigned_source
except AttributeError:
pass
self.set_source(module_name, preamble)
> return _verify(self, module_name, preamble, *args,
extra_compile_args=self._extra_compile_args, **kwds)
../build/extra_tests/cffi_tests/cffi1/test_verify1.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ffi = <extra_tests.cffi_tests.cffi1.test_verify1.FFI object at 0xf31fbc50>
module_name = 'verify42', preamble = 'struct foo_s { unsigned int x; };'
args = ()
kwds = {'extra_compile_args': ['-Werror', '-Wall', '-Wextra', '-Wconversion', '-Wno-unused-parameter', '-Wno-unreachable-code'], 'tmpdir': '/tmp/ffi-56'}
recompile = <function recompile at 0x0cabbe48>, udir = PosixPath('/tmp/ffi-56')
def _verify(ffi, module_name, preamble, *args, **kwds):
from cffi.recompiler import recompile
from .udir import udir
assert module_name not in sys.modules, "module name conflict: %r" % (
module_name,)
kwds.setdefault('tmpdir', str(udir))
> outputfilename = recompile(ffi, module_name, preamble, *args, **kwds)
../build/extra_tests/cffi_tests/support.py:82:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ffi = <extra_tests.cffi_tests.cffi1.test_verify1.FFI object at 0xf31fbc50>
module_name = 'verify42', preamble = 'struct foo_s { unsigned int x; };'
tmpdir = '/tmp/ffi-56', call_c_compiler = True
c_file = '/tmp/ffi-56/verify42.c', source_extension = '.c', extradir = None
compiler_verbose = 1, target = '*', debug = None, uses_ffiplatform = True
kwds = {'extra_compile_args': ['-Werror', '-Wall', '-Wextra', '-Wconversion', '-Wno-unused-parameter', '-Wno-unreachable-code']}
embedding = False, parts = ['verify42.c'], ext_c_file = 'verify42.c'
ext = <setuptools.extension.Extension('verify42') at 0xb1a4a30>, updated = True
patchlist = [], cwd = '/buildbot/slave/pypy-c-jit-linux-x86-32/venv'
def recompile(ffi, module_name, preamble, tmpdir='.', call_c_compiler=True,
c_file=None, source_extension='.c', extradir=None,
compiler_verbose=1, target=None, debug=None,
uses_ffiplatform=True, **kwds):
if not isinstance(module_name, str):
module_name = module_name.encode('ascii')
if ffi._windows_unicode:
ffi._apply_windows_unicode(kwds)
if preamble is not None:
if call_c_compiler and _is_file_like(c_file):
raise TypeError("Writing to file-like objects is not supported "
"with call_c_compiler=True")
embedding = (ffi._embedding is not None)
if embedding:
ffi._apply_embedding_fix(kwds)
if c_file is None:
c_file, parts = _modname_to_file(tmpdir, module_name,
source_extension)
if extradir:
parts = [extradir] + parts
ext_c_file = os.path.join(*parts)
else:
ext_c_file = c_file
#
if target is None:
if embedding:
target = '%s.*' % module_name
else:
target = '*'
#
if uses_ffiplatform:
ext = ffiplatform.get_extension(ext_c_file, module_name, **kwds)
else:
ext = None
updated = make_c_source(ffi, module_name, preamble, c_file,
verbose=compiler_verbose)
if call_c_compiler:
patchlist = []
cwd = os.getcwd()
try:
if embedding:
_patch_for_embedding(patchlist)
if target != '*':
_patch_for_target(patchlist, target)
if compiler_verbose:
if tmpdir == '.':
msg = 'the current directory is'
else:
msg = 'setting the current directory to'
print('%s %r' % (msg, os.path.abspath(tmpdir)))
os.chdir(tmpdir)
> outputfilename = ffiplatform.compile('.', ext,
compiler_verbose, debug)
../build/lib_pypy/cffi/recompiler.py:1569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '.', ext = <setuptools.extension.Extension('verify42') at 0xb1a4a30>
compiler_verbose = 1, debug = None
def compile(tmpdir, ext, compiler_verbose=0, debug=None):
"""Compile a C extension module."""
backend = _pypy_compile_backend()
if backend is not None:
oldir = os.getcwd()
os.chdir(tmpdir)
try:
outputfilename = backend.build(ext, tmpdir, compiler_verbose, debug)
outputfilename = os.path.abspath(outputfilename)
finally:
os.chdir(oldir)
return outputfilename
saved_environ = os.environ.copy()
try:
> outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
../build/lib_pypy/cffi/ffiplatform.py:56:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '.', ext = <setuptools.extension.Extension('verify42') at 0xb1a4a30>
compiler_verbose = 1, debug = 0
def _build(tmpdir, ext, compiler_verbose=0, debug=None):
# XXX compact but horrible :-(
from cffi._shimmed_dist_utils import Distribution, CompileError, LinkError, set_threshold, set_verbosity
dist = Distribution({'ext_modules': [ext]})
dist.parse_config_files()
options = dist.get_option_dict('build_ext')
if debug is None:
debug = sys.flags.debug
options['debug'] = ('ffiplatform', debug)
options['force'] = ('ffiplatform', True)
options['build_lib'] = ('ffiplatform', tmpdir)
options['build_temp'] = ('ffiplatform', tmpdir)
#
try:
old_level = set_threshold(0) or 0
try:
set_verbosity(compiler_verbose)
dist.run_command('build_ext')
cmd_obj = dist.get_command_obj('build_ext')
[soname] = cmd_obj.get_outputs()
finally:
set_threshold(old_level)
except (CompileError, LinkError) as e:
> raise VerificationError('%s: %s' % (e.__class__.__name__, e))
E cffi.VerificationError: CompileError: command '/opt/rh/gcc-toolset-14/root/usr/bin/gcc' failed with exit code 1
../build/lib_pypy/cffi/ffiplatform.py:90: VerificationError
During handling of the above exception, another exception occurred:
def test_struct_signedness_ignored():
> _check_field_match("int", "unsigned int", expect_mismatch=False)
../build/extra_tests/cffi_tests/cffi1/test_verify1.py:541:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
typename = 'int', real = 'unsigned int', expect_mismatch = False
def _check_field_match(typename, real, expect_mismatch):
ffi = FFI()
testing_by_size = (expect_mismatch == 'by_size')
if testing_by_size:
expect_mismatch = ffi.sizeof(typename) != ffi.sizeof(real)
ffi.cdef("struct foo_s { %s x; ...; };" % typename)
try:
ffi.verify("struct foo_s { %s x; };" % real)
ffi.new("struct foo_s *", []) # because some mismatches show up lazily
except (VerificationError, ffi.error):
if not expect_mismatch:
if testing_by_size and typename != real:
print("ignoring mismatch between %s* and %s* even though "
"they have the same size" % (typename, real))
return
> raise AssertionError("unexpected mismatch: %s should be accepted "
"as equal to %s" % (typename, real))
E AssertionError: unexpected mismatch: int should be accepted as equal to unsigned int
../build/extra_tests/cffi_tests/cffi1/test_verify1.py:523: AssertionError
builder: pypy-c-jit-linux-x86-32 build #8482+
test: cffi_tests.cffi1.test_verify1:test_struct_signedness_ignored