cffi_tests.cffi1.test_verify1:test_include
self = <distutils.unixccompiler.UnixCCompiler object at 0x0a45afb0>
obj = './verify245.o', src = 'verify245.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 0x0a45afb0>
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('verify245') at 0x136b6030>
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 0x13674b30>
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 0x13674b30>
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 0x0a45afd0>
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 0x0a45afd0>
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 0x0a45afd0>
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 0x0a45afd0>
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 0x0a45afd0>
ext = <setuptools.extension.Extension('verify245') at 0x136b6030>
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 0x0a45afd0>
ext = <setuptools.extension.Extension('verify245') at 0x136b6030>
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 0x0a45afb0>
sources = ['verify245.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 0x0a45afb0>
obj = './verify245.o', src = 'verify245.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:
def test_include():
ffi1 = FFI()
ffi1.cdef("typedef struct { int x; ...; } foo_t;")
> ffi1.verify("typedef struct { int y, x; } foo_t;")
../build/extra_tests/cffi_tests/cffi1/test_verify1.py:1701:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../build/extra_tests/cffi_tests/cffi1/test_verify1.py:36: in verify
return _verify(self, module_name, preamble, *args,
../build/extra_tests/cffi_tests/support.py:82: in _verify
outputfilename = recompile(ffi, module_name, preamble, *args, **kwds)
../build/lib_pypy/cffi/recompiler.py:1569: in recompile
outputfilename = ffiplatform.compile('.', ext,
../build/lib_pypy/cffi/ffiplatform.py:56: in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tmpdir = '.', ext = <setuptools.extension.Extension('verify245') at 0x136b6030>
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
builder: pypy-c-jit-linux-x86-32 build #8482+
test: cffi_tests.cffi1.test_verify1:test_include