python testrunner/app_level_tests.py
in dir /build_dir/pypy-c-jit-linux-x86-32/build (timeout 4000 secs)
watching logfiles {'pytestLog': 'pytest-A.log'}
argv: ['python', 'testrunner/app_level_tests.py']
environment:
AUDITWHEEL_ARCH=i686
AUDITWHEEL_PLAT=manylinux2014_i686
AUDITWHEEL_POLICY=manylinux2014
DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-10/root
HOME=/home/buildslave
HOSTNAME=ffc60fde56a7
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
LD_LIBRARY_PATH=/usr/local/lib:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib/dyninst
LOGNAME=buildslave
PATH=/python27_virt/bin:/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig
PWD=/build_dir/pypy-c-jit-linux-x86-32/build
PYPY_LOCALBASE=/usr/local
PYPY_MAKE_PORTABLE=1
SHELL=/bin/bash
SHLVL=3
SSL_CERT_FILE=/opt/_internal/certs.pem
TERM=xterm
TMPDIR=/build_dir/tmp/pytest
USER=buildslave
_=/usr/bin/linux32
using PTY: False
using config pypy/pytest-A.cfg
using config pypy/pytest-A.py
ignoring non-existant config /home/buildslave/machine-A_cfg.py
-- interpreter/astcompiler/test
-- interpreter/pyparser/test
-- interpreter/test
-- objspace/test
-- objspace/std/test
-- module/__builtin__/test
-- module/__pypy__/test
-- module/_abc/test
-- module/_ast/test
-- module/_cffi_backend/test
-- module/_codecs/test
-- module/_collections/test
-- module/_continuation/test
-- module/_cppyy/test
-- module/_csv/test
-- module/_demo/test
-- module/_hpy_universal/test/_vendored
-- module/_hpy_universal/test/pypy
-- module/_io/test
-- module/_jitlog/test
-- module/_locale/test
-- module/_lsprof/test
-- module/_md5/test
-- module/_minimal_curses/test
-- module/_multibytecodec/test
-- module/_multiprocessing/test
-- module/_opcode/test
-- module/_pickle/test
-- module/_pickle_support/test
-- module/_posixsubprocess/test
-- module/_pypyjson/test
-- module/_random/test
-- module/_rawffi/alt/test
-- module/_rawffi/test
-- module/_socket/test
-- module/_sre/test
-- module/_vmprof/test
-- module/_warnings/test
-- module/_weakref/test
-- module/_winreg/test
-- module/array/test
-- module/atexit/test
-- module/binascii/test
-- module/bz2/test
-- module/cmath/test
-- module/cpyext/test
-- module/crypt/test
-- module/errno/test
-- module/exceptions/test
-- module/faulthandler/test
-- module/fcntl/test
-- module/gc/test
-- module/imp/test
-- module/itertools/test
-- module/marshal/test
-- module/math/test
-- module/micronumpy/test
-- module/mmap/test
-- module/operator/test
-- module/posix/test
-- module/pwd/test
-- module/pyexpat/test
-- module/pypyjit/test
-- module/select/test
-- module/signal/test
-- module/struct/test
-- module/sys/test
-- module/termios/test
-- module/test_lib_pypy
-- module/thread/test
-- module/time/test
-- module/token/test
-- module/unicodedata/test
-- module/zipimport/test
-- module/zlib/test
-- total: 75 to run
++ 05:09:03 starting interpreter/astcompiler/test [1 started in total]
__ interpreter/astcompiler/test [1 done in total, somefailed=False] ___________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 15 items
interpreter/astcompiler/test/test_compiler.py ..s............
===================== 14 passed, 1 skipped in 4.02 seconds =====================
++ 05:09:18 starting interpreter/pyparser/test [2 started in total]
__ interpreter/pyparser/test [2 done in total, somefailed=False] ______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 1.09 seconds =========================
++ 05:09:24 starting interpreter/test [3 started in total]
__ interpreter/test [3 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 228 items
interpreter/test/test_app_main.py sss
interpreter/test/test_appinterp.py .
interpreter/test/test_argument.py ...............
interpreter/test/test_code.py ...........
interpreter/test/test_compiler.py .......................s..................................
interpreter/test/test_exceptcomp.py .........
interpreter/test/test_executioncontext.py ....
interpreter/test/test_extmodules.py s
interpreter/test/test_gateway.py .......
interpreter/test/test_interpreter.py ..............
interpreter/test/test_mixedmodule.py ssss
interpreter/test/test_module.py ...............
interpreter/test/test_pyframe.py .....
interpreter/test/test_special.py ...
interpreter/test/test_syntax.py .....................................
interpreter/test/test_typedef.py ...........
interpreter/test/test_zzpickle_and_slow.py ..............................
==================== 219 passed, 9 skipped in 20.94 seconds ====================
++ 05:09:52 starting objspace/test [4 started in total]
__ objspace/test [4 done in total, somefailed=False] __________________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.01 seconds =========================
++ 05:09:58 starting objspace/std/test [5 started in total]
__ objspace/std/test [5 done in total, somefailed=True] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 1524 items
objspace/std/test/test_bytearrayobject.py .....................................................................................
objspace/std/test/test_bytesobject.py ..............................................................................................
objspace/std/test/test_celldict.py ......sss
objspace/std/test/test_dictmultiobject.py .............................................................................................................................................ssssssss
objspace/std/test/test_dictproxy.py ................
objspace/std/test/test_floatobject.py .................................................
objspace/std/test/test_identitydict.py sssss
objspace/std/test/test_identityset.py sssssss
objspace/std/test/test_index.py ...................................
objspace/std/test/test_intobject.py ..........................................................................................................................
objspace/std/test/test_jsondict.py ..........
objspace/std/test/test_kwargsdict.py sssssss
objspace/std/test/test_listobject.py ...................................................................................
objspace/std/test/test_longobject.py ...................................s........F..
objspace/std/test/test_mapdict.py ..................ssssssssssssssssssssssssssssssssssssssssssssssss
objspace/std/test/test_memoryobject.py ..........................................
objspace/std/test/test_methodcache.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
objspace/std/test/test_newformat.py ...............................................................
objspace/std/test/test_obj.py ......................................
objspace/std/test/test_prebuiltint.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
objspace/std/test/test_proxy.py ssssssssssss
objspace/std/test/test_proxy_function.py ........
objspace/std/test/test_proxy_internals.py s......
objspace/std/test/test_proxy_iter.py .
objspace/std/test/test_proxy_object.py ..........
objspace/std/test/test_proxy_usercreated.py s
objspace/std/test/test_setobject.py ..........................................................................................
objspace/std/test/test_sliceobject.py ........
objspace/std/test/test_smalllongobject.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
objspace/std/test/test_specialisedtupleobject.py ...................
objspace/std/test/test_typeobject.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.....sssssssssssss
objspace/std/test/test_unicodeobject.py ....
objspace/std/test/test_userobject.py .
=================================== FAILURES ===================================
________________ AppTestLong.test_pow_negative_exponent_modulo _________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
Traceback (most recent call last):
File "/build...
assert pow(12312388333333333333333333333333333333333333333333333333333, -sys.maxsize-1, 23) == 12
AssertionError
>
func = <function <lambda> at 0xf439a02c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>,...icall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf79d198c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>,...icall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>,...icall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf438dfa4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ent_modulo'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf437712c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf437712c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ent_modulo'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf436c16c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ent_modulo'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf437724c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf437724c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ent_modulo'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_pow_negative_exponent_modulo'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_pow_negative_exponent_modulo'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_pow_negative_exponent_modulo'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_pow_negative_exponent_modulo at 0xf4b0a0d4>
usemodules = None
definitions = {'_long': <bound method AppTestLong.w__long of <pypy.objspace.std.test.test_longobject.AppTestLong instance at 0xf4377bcc>>}
defs = ['def w__long(self, obj):\n # XXX: currently returns a W_LongObject but might return\n # W_IntObject in the future\n huge = 1 << 65\n return obj + huge - huge', 'type(self)._long = w__long\n']
symbol = '_long'
value = <bound method AppTestLong.w__long of <pypy.objspace.std.test.test_longobject.AppTestLong instance at 0xf4377bcc>>
code = <py._code.code.Code object at 0xf437748c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-676/src.py", line 89, in <module>
E test_pow_negative_exponent_modulo()
E File "/build_dir/tmp/pytest/usession-py3.12-676/src.py", line 69, in test_pow_negative_exponent_modulo
E assert pow(12312388333333333333333333333333333333333333333333333333333, -sys.maxsize-1, 23) == 12
E AssertionError
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w__long(self, obj):
# XXX: currently returns a W_LongObject but might return
# W_IntObject in the future
huge = 1 << 65
return obj + huge - huge
type(self)._long = w__long
def test_pow_negative_exponent_modulo():
import math
import sys
mod = 2 ** 100
res = 519502503658624787456021964081
assert pow(3**100, -1, mod) == res
assert pow(3**100, -2, mod) == (res ** 2) % mod
assert pow(12312388333333333333333333333333333333333333333333333333333, -sys.maxsize-1, 23) == 12
assert pow(13, -55555555555555555555555555555555555555555555555555555555551, 23) == 16
for i in range(1, 7):
i = self._long(i)
for j in range(2, 7):
j = self._long(j)
for sign in [1, -1]:
i = i * sign
if math.gcd(i, j) != 1:
with raises(ValueError):
pow(i, -1, j)
continue
x = pow(i, -1, j)
assert (x * i) % j == 1 % j
for k in range(2, 4):
y = pow(i, -k, j)
assert y == pow(x, k, j)
try:
test_pow_negative_exponent_modulo()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-676/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-676/src.py", line 89, in <module>
test_pow_negative_exponent_modulo()
File "/build_dir/tmp/pytest/usession-py3.12-676/src.py", line 69, in test_pow_negative_exponent_modulo
assert pow(12312388333333333333333333333333333333333333333333333333333, -sys.maxsize-1, 23) == 12
AssertionError
=========================== short test summary info ============================
FAIL objspace/std/test/test_longobject.py::AppTestLong::()::test_pow_negative_exponent_modulo
============== 1 failed, 999 passed, 524 skipped in 89.92 seconds ==============
++ 05:11:40 starting module/__builtin__/test [6 started in total]
__ module/__builtin__/test [6 done in total, somefailed=False] ________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 282 items
module/__builtin__/test/test_abstractinst.py ...........
module/__builtin__/test/test_breakpoint.py ........
module/__builtin__/test/test_builtin.py .......................................................................
module/__builtin__/test/test_construct_singletons.py .
module/__builtin__/test/test_descriptor.py ...................................
module/__builtin__/test/test_dir.py ...........
module/__builtin__/test/test_filter.py ........
module/__builtin__/test/test_filter_pickle.py .....
module/__builtin__/test/test_format.py .
module/__builtin__/test/test_functional.py .......................................................................................
module/__builtin__/test/test_map_pickle.py ...
module/__builtin__/test/test_minmax.py .......................
module/__builtin__/test/test_rawinput.py ..
module/__builtin__/test/test_sum.py .
module/__builtin__/test/test_vars.py ...
module/__builtin__/test/test_zip.py ...........
module/__builtin__/test/test_zip_pickle.py .
========================= 282 passed in 18.42 seconds ==========================
++ 05:12:03 starting module/__pypy__/test [7 started in total]
__ module/__pypy__/test [7 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 75 items
module/__pypy__/test/test_builders.py .....
module/__pypy__/test/test_bytebuffer.py ...
module/__pypy__/test/test_debug.py sssssss
module/__pypy__/test/test_identitydict.py ......
module/__pypy__/test/test_intop.py ...........
module/__pypy__/test/test_locals2fast.py .....
module/__pypy__/test/test_magic.py .......s..
module/__pypy__/test/test_newmemoryview.py ........
module/__pypy__/test/test_os.py .
module/__pypy__/test/test_signal.py .....
module/__pypy__/test/test_special.py sssssssssss..s
==================== 55 passed, 20 skipped in 10.22 seconds ====================
++ 05:12:21 starting module/_abc/test [8 started in total]
__ module/_abc/test [8 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 3 items
module/_abc/test/test_abc.py ...
=========================== 3 passed in 0.31 seconds ===========================
++ 05:12:26 starting module/_ast/test [9 started in total]
__ module/_ast/test [9 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 54 items
module/_ast/test/test_ast.py ......................................................
========================== 54 passed in 4.97 seconds ===========================
++ 05:12:36 starting module/_cffi_backend/test [10 started in total]
__ module/_cffi_backend/test [10 done in total, somefailed=False] _____________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 443 items
module/_cffi_backend/test/test_c.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
module/_cffi_backend/test/test_fastpath.py ..................
module/_cffi_backend/test/test_ffi_obj.py .............................................
module/_cffi_backend/test/test_re_python.py ....................
module/_cffi_backend/test/test_recompiler.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
module/_cffi_backend/test/test_unicode_literals.py .......
=================== 90 passed, 353 skipped in 11.55 seconds ====================
++ 05:12:53 starting module/_codecs/test [11 started in total]
__ module/_codecs/test [11 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 89 items
module/_codecs/test/test_codecs.py ....................sss..................................................................
===================== 86 passed, 3 skipped in 8.01 seconds =====================
++ 05:13:08 starting module/_collections/test [12 started in total]
__ module/_collections/test [12 done in total, somefailed=False] ______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.00 seconds =========================
++ 05:13:14 starting module/_continuation/test [13 started in total]
__ module/_continuation/test [13 done in total, somefailed=False] _____________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 32 items / 3 skipped
module/_continuation/test/test_generator.py ....
module/_continuation/test/test_greenlet.py ............................
===================== 32 passed, 3 skipped in 4.70 seconds =====================
++ 05:13:24 starting module/_cppyy/test [14 started in total]
__ module/_cppyy/test [14 done in total, somefailed=False] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.03 seconds =========================
++ 05:13:29 starting module/_csv/test [15 started in total]
__ module/_csv/test [15 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 27 items
module/_csv/test/test_dialect.py ..............
module/_csv/test/test_reader.py .............
========================== 27 passed in 1.99 seconds ===========================
++ 05:13:36 starting module/_demo/test [16 started in total]
__ module/_demo/test [16 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 1 items
module/_demo/test/test_sieve.py s
========================== 1 skipped in 0.15 seconds ===========================
++ 05:13:42 starting module/_hpy_universal/test/_vendored [17 started in total]
__ module/_hpy_universal/test/_vendored [17 done in total, somefailed=False] __
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.02 seconds =========================
++ 05:13:47 starting module/_hpy_universal/test/pypy [18 started in total]
__ module/_hpy_universal/test/pypy [18 done in total, somefailed=False] _______
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.01 seconds =========================
++ 05:13:53 starting module/_io/test [19 started in total]
__ module/_io/test [19 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 134 items / 1 skipped
module/_io/test/test_bufferedio.py .................................................s.....................................................
module/_io/test/test_fileio.py ...............................
==================== 133 passed, 2 skipped in 15.37 seconds ====================
++ 05:14:13 starting module/_jitlog/test [20 started in total]
__ module/_jitlog/test [20 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 1 items
module/_jitlog/test/test__jitlog.py .
=========================== 1 passed in 0.19 seconds ===========================
++ 05:14:19 starting module/_locale/test [21 started in total]
__ module/_locale/test [21 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 15 items
module/_locale/test/test_locale.py ssssssssssssss.
===================== 1 passed, 14 skipped in 0.20 seconds =====================
++ 05:14:24 starting module/_lsprof/test [22 started in total]
__ module/_lsprof/test [22 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 6 items
module/_lsprof/test/test_cprofile.py ......
=========================== 6 passed in 1.57 seconds ===========================
++ 05:14:31 starting module/_md5/test [23 started in total]
__ module/_md5/test [23 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 8 items
module/_md5/test/test_md5.py ........
=========================== 8 passed in 0.64 seconds ===========================
++ 05:14:37 starting module/_minimal_curses/test [24 started in total]
__ module/_minimal_curses/test [24 done in total, somefailed=False] ___________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.01 seconds =========================
++ 05:14:41 starting module/_multibytecodec/test [25 started in total]
__ module/_multibytecodec/test [25 done in total, somefailed=False] ___________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 3 items
module/_multibytecodec/test/test_multibtye_codecs.py ...
=========================== 3 passed in 0.43 seconds ===========================
++ 05:14:46 starting module/_multiprocessing/test [26 started in total]
__ module/_multiprocessing/test [26 done in total, somefailed=False] __________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 10 items
module/_multiprocessing/test/test_semaphore.py .........
module/_multiprocessing/test/test_win32.py s
===================== 9 passed, 1 skipped in 1.39 seconds ======================
++ 05:14:53 starting module/_opcode/test [27 started in total]
__ module/_opcode/test [27 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.00 seconds =========================
++ 05:14:59 starting module/_pickle/test [28 started in total]
__ module/_pickle/test [28 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.00 seconds =========================
++ 05:15:04 starting module/_pickle_support/test [29 started in total]
__ module/_pickle_support/test [29 done in total, somefailed=False] ___________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.00 seconds =========================
++ 05:15:10 starting module/_posixsubprocess/test [30 started in total]
__ module/_posixsubprocess/test [30 done in total, somefailed=False] __________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.52 seconds =========================
++ 05:15:15 starting module/_pypyjson/test [31 started in total]
__ module/_pypyjson/test [31 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 29 items / 1 skipped
module/_pypyjson/test/test__pypyjson.py .............................
===================== 29 passed, 1 skipped in 3.12 seconds =====================
++ 05:15:24 starting module/_random/test [32 started in total]
__ module/_random/test [32 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 12 items
module/_random/test/test_random.py ............
========================== 12 passed in 1.27 seconds ===========================
++ 05:15:31 starting module/_rawffi/alt/test [33 started in total]
__ module/_rawffi/alt/test [33 done in total, somefailed=False] _______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 61 items
module/_rawffi/alt/test/test_ffitype.py .....
module/_rawffi/alt/test/test_funcptr.py ....ss....................................
module/_rawffi/alt/test/test_struct.py ..............
===================== 59 passed, 2 skipped in 6.20 seconds =====================
++ 05:15:43 starting module/_rawffi/test [34 started in total]
__ module/_rawffi/test [34 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 79 items
module/_rawffi/test/test__rawffi.py .....................................................................
module/_rawffi/test/test_exit.py .
module/_rawffi/test/test_nested.py ......
module/_rawffi/test/test_tracker.py sss
===================== 76 passed, 3 skipped in 7.25 seconds =====================
++ 05:15:55 starting module/_socket/test [35 started in total]
__ module/_socket/test [35 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 2.80 seconds =========================
++ 05:16:04 starting module/_sre/test [36 started in total]
__ module/_sre/test [36 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 94 items
module/_sre/test/test_app_sre.py ..............................ssssssssssssssssssssssssssssssssssss
module/_sre/test/test_sre_buf.py ............................
==================== 58 passed, 36 skipped in 8.21 seconds =====================
++ 05:16:18 starting module/_vmprof/test [37 started in total]
__ module/_vmprof/test [37 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 5 items
module/_vmprof/test/test__vmprof.py .....
=========================== 5 passed in 1.15 seconds ===========================
++ 05:16:25 starting module/_warnings/test [38 started in total]
__ module/_warnings/test [38 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.01 seconds =========================
++ 05:16:31 starting module/_weakref/test [39 started in total]
__ module/_weakref/test [39 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.00 seconds =========================
++ 05:16:36 starting module/_winreg/test [40 started in total]
__ module/_winreg/test [40 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items / 1 skipped
========================== 1 skipped in 0.04 seconds ===========================
++ 05:16:42 starting module/array/test [41 started in total]
__ module/array/test [41 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 60 items
module/array/test/test_array.py ............................................................
========================== 60 passed in 5.03 seconds ===========================
++ 05:16:52 starting module/atexit/test [42 started in total]
__ module/atexit/test [42 done in total, somefailed=False] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.00 seconds =========================
++ 05:16:57 starting module/binascii/test [43 started in total]
__ module/binascii/test [43 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 18 items
module/binascii/test/test_binascii.py ..................
========================== 18 passed in 1.71 seconds ===========================
++ 05:17:04 starting module/bz2/test [44 started in total]
__ module/bz2/test [44 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 45 items
module/bz2/test/test_bz2_compdecomp.py ssssssssssssssss
module/bz2/test/test_bz2_file.py ssssssssssssssssssssssssssss
module/bz2/test/test_large.py s
========================== 45 skipped in 3.93 seconds ==========================
++ 05:17:14 starting module/cmath/test [45 started in total]
__ module/cmath/test [45 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 16 items
module/cmath/test/test_cmath.py ................
========================== 16 passed in 1.18 seconds ===========================
++ 05:17:21 starting module/cpyext/test [46 started in total]
__ module/cpyext/test [46 done in total, somefailed=True] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 444 items / 1 errors / 1 skipped
module/cpyext/test/test_arraymodule.py FFFFFFFFFFxFFFFFFF
module/cpyext/test/test_async_iter.py sss
module/cpyext/test/test_boolobject.py ...
module/cpyext/test/test_borrow.py ...
module/cpyext/test/test_buffer.py ......
module/cpyext/test/test_bytearrayobject.py ......
module/cpyext/test/test_bytesobject.py .........
module/cpyext/test/test_capsule.py ...
module/cpyext/test/test_cell.py .
module/cpyext/test/test_classobject.py ..
module/cpyext/test/test_codecs.py .
module/cpyext/test/test_complexobject.py .....
module/cpyext/test/test_contextvars.py .
module/cpyext/test/test_cpyext.py s.F..F...........s..s....
module/cpyext/test/test_datetime.py .......
module/cpyext/test/test_dictobject.py ...........
module/cpyext/test/test_exception.py ..
module/cpyext/test/test_fileobject.py .
module/cpyext/test/test_floatobject.py ............
module/cpyext/test/test_frameobject.py F....
module/cpyext/test/test_funcobject.py .......
module/cpyext/test/test_genobject.py ..
module/cpyext/test/test_getargs.py ................
module/cpyext/test/test_import.py ..
module/cpyext/test/test_iterator.py ..
module/cpyext/test/test_listobject.py .....
module/cpyext/test/test_longobject.py ...............
module/cpyext/test/test_marshal.py ..
module/cpyext/test/test_memoryobject.py .s.........
module/cpyext/test/test_methodobject.py ...........FFF
module/cpyext/test/test_misc.py .
module/cpyext/test/test_module.py .......................
module/cpyext/test/test_namespaceobject.py .
module/cpyext/test/test_number.py ...
module/cpyext/test/test_object.py ....................
module/cpyext/test/test_pyerrors.py ..............s.........
module/cpyext/test/test_pymem.py .
module/cpyext/test/test_pysignals.py .
module/cpyext/test/test_pystate.py ....x.....F.
module/cpyext/test/test_pystrhex.py .
module/cpyext/test/test_pystrtod.py .
module/cpyext/test/test_sequence.py ....
module/cpyext/test/test_setobject.py .
module/cpyext/test/test_sliceobject.py ......
module/cpyext/test/test_structseq.py .
module/cpyext/test/test_sysmodule.py ...
module/cpyext/test/test_thread.py sssss.
module/cpyext/test/test_tupleobject.py ..F..
module/cpyext/test/test_typeobject.py FFFFFFFFFFFFFF.FFFF.F...FFFF.F....................FF.......F........F...FFF.FFF..........F
module/cpyext/test/test_unicodeobject.py ................................
module/cpyext/test/test_userslots.py ....
module/cpyext/test/test_version.py .s
module/cpyext/test/test_weakref.py ..
==================================== ERRORS ====================================
____________ ERROR collecting pypy/module/cpyext/test/test_eval.py _____________
module/cpyext/test/test_eval.py:9: in <module>
from pypy.module.cpyext.eval import (
E ImportError: cannot import name PyRun_SimpleString
=================================== FAILURES ===================================
________________________ AppTestArrayModule.test_basic _________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf43dc6f4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_basic'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_basic'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_basic'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43cc8ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43cf80c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43cf80c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43ccf7c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43cf7ec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43cf7ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_basic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_basic'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_basic'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_basic at 0xf495202c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf426168c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43cf8cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 138, in <module>
E test_basic()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_basic
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_basic():
module = self.import_module(name='array')
import sys
arr = module.array('i', [1,2,3])
assert arr.typecode == 'i'
assert arr.itemsize == 4
assert arr[2] == 3
assert len(arr.buffer_info()) == 2
exc = raises(TypeError, module.array.append)
errstr = str(exc.value)
if sys.implementation.name == 'pypy':
assert errstr.startswith("descriptor 'append' of 'array' object"), errstr
else:
assert errstr.startswith("unbound method array.append"), errstr
arr.append(4)
assert arr.tolist() == [1, 2, 3, 4]
assert len(arr) == 4
try:
test_basic()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 138, in <module>
test_basic()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_basic
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_________________________ AppTestArrayModule.test_iter _________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf43dc6bc>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_iter'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_iter'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_iter'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edcd4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42f958c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42f958c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edb94>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42f964c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42f964c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iter'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_iter'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_iter'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_iter at 0xf4952064>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf42f99ec>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf42f9d8c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
E test_iter()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_iter
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_iter():
module = self.import_module(name='array')
arr = module.array('i', [1,2,3])
sum = 0
for i in arr:
sum += i
assert sum == 6
try:
test_iter()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
test_iter()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_iter
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________________ AppTestArrayModule.test_index _________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf438e5a4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_index'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_index'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_index'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edaf4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d864c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d864c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43ed374>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d862c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d862c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_index'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_index'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_index'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_index at 0xf495209c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf43d81cc>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43d89cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
E test_index()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_index
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_index():
module = self.import_module(name='array')
arr = module.array('i', [1, 2, 3, 4])
assert arr[3] == 4
raises(IndexError, arr.__getitem__, 10)
del arr[2]
assert arr.tolist() == [1, 2, 4]
arr[2] = 99
assert arr.tolist() == [1, 2, 99]
try:
test_index()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
test_index()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_index
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestArrayModule.test_slice_get _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf43dc6bc>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_slice_get'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_slice_get'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_slice_get'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edd9c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf46e02cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf46e02cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edb94>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf46e02ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf46e02ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_get'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_slice_get'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_slice_get'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_slice_get at 0xf49520d4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf46e074c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf46e076c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
E test_slice_get()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_slice_get
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_slice_get():
module = self.import_module(name='array')
arr = module.array('i', [1, 2, 3, 4])
assert arr[:].tolist() == [1, 2, 3, 4]
assert arr[1:].tolist() == [2, 3, 4]
assert arr[:2].tolist() == [1, 2]
assert arr[1:3].tolist() == [2, 3]
try:
test_slice_get()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
test_slice_get()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_slice_get
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_____________________ AppTestArrayModule.test_slice_object _____________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf438e5a4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_slice_object'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_slice_object'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_slice_object'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edb44>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4613b8c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4613b8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e302c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4613d0c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4613d0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_slice_object'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_slice_object'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_slice_object'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_slice_object at 0xf495210c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf4613c8c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf5adee8c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
E test_slice_object()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_slice_object
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_slice_object():
module = self.import_module(name='array')
arr = module.array('i', [1, 2, 3, 4])
assert arr[slice(1, 3)].tolist() == [2,3]
arr[slice(1, 3)] = module.array('i', [21, 22, 23])
assert arr.tolist() == [1, 21, 22, 23, 4]
del arr[slice(1, 3)]
assert arr.tolist() == [1, 23, 4]
raises(TypeError, 'arr[slice(1, 3)] = "abc"')
try:
test_slice_object()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
test_slice_object()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_slice_object
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________________ AppTestArrayModule.test_buffer ________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf43dc924>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edd9c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...est_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48cf26c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48cf26c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...est_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edc84>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...est_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48cf34c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48cf34c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...est_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_buffer'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_buffer'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_buffer at 0xf4952144>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf42fedec>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf45640ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 135, in <module>
E test_buffer()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_buffer
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_buffer():
import sys
module = self.import_module(name='array')
arr = module.array('i', [1, 2, 3, 4])
buf = memoryview(arr)
buf[1] = 2
if sys.byteorder == 'big':
expected = b'\0\0\0\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04'
else:
expected = b'\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04\0\0\0'
assert bytes(buf) == expected
# make sure memory_attach is called
buf2 = module.passthrough(buf)
assert str(buf2) == str(buf)
try:
test_buffer()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 135, in <module>
test_buffer()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_buffer
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
____________________ AppTestArrayModule.test_releasebuffer _____________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf438e5a4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_releasebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_releasebuffer'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_releasebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_releasebuffer'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_releasebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_releasebuffer'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_releasebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e311c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...easebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf447fa2c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf447fa2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...easebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_releasebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e3194>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...easebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf447f94c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf447f94c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...easebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_releasebuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_releasebuffer'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_releasebuffer'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_releasebuffer at 0xf495217c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf447f20c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf447f3ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 127, in <module>
E test_releasebuffer()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_releasebuffer
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_releasebuffer():
module = self.import_module(name='array')
arr = module.array('i', [1,2,3,4])
initial = module.get_releasebuffer_cnt()
module.create_and_release_buffer(arr)
assert module.get_releasebuffer_cnt() == initial + 1
try:
test_releasebuffer()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 127, in <module>
test_releasebuffer()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_releasebuffer
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestArrayModule.test_Py_buffer _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf43dc924>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_Py_buffer'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_Py_buffer'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_Py_buffer'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edc84>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf46e76cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf46e76cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e3464>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf46e784c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf46e784c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_Py_buffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_Py_buffer'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_Py_buffer'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_Py_buffer at 0xf49521b4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf46e718c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf46e746c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
E test_Py_buffer()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_Py_buffer
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_Py_buffer():
module = self.import_module(name='array')
arr = module.array('i', [1,2,3,4])
initial = module.get_releasebuffer_cnt()
m = memoryview(arr)
assert module.get_releasebuffer_cnt() == initial
del m
self.debug_collect()
assert module.get_releasebuffer_cnt() == initial + 1
try:
test_Py_buffer()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
test_Py_buffer()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_Py_buffer
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________________ AppTestArrayModule.test_0d_view ________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4401e2c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_0d_view'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_0d_view'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_0d_view'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edc5c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43732ec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43732ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e011c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4373c0c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4373c0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_0d_view'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_0d_view'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_0d_view'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_0d_view at 0xf49521ec>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf437336c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43736cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
E test_0d_view()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_0d_view
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_0d_view():
module = self.import_module(name='array')
arr = module.array('B', b'\0\0\0\x01')
buf = memoryview(arr).cast('i', shape=())
assert bytes(buf) == b'\0\0\0\x01'
assert buf.shape == ()
assert buf.strides == ()
try:
test_0d_view()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
test_0d_view()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_0d_view
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
____________________ AppTestArrayModule.test_binop_mul_impl ____________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf43dc6bc>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_binop_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_binop_mul_impl'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_binop_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_binop_mul_impl'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_binop_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_binop_mul_impl'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_binop_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e0c5c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...p_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf433992c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf433992c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...p_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_binop_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e06bc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...p_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4339b2c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4339b2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...p_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_binop_mul_impl'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_binop_mul_impl'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_binop_mul_impl'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_binop_mul_impl at 0xf4952224>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf4339a4c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf4339acc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 127, in <module>
E test_binop_mul_impl()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_binop_mul_impl
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_binop_mul_impl():
# check that rmul is called
module = self.import_module(name='array')
arr = module.array('i', [2])
res = [1, 2, 3] * arr
assert res == [1, 2, 3, 1, 2, 3]
try:
test_binop_mul_impl()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 127, in <module>
test_binop_mul_impl()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_binop_mul_impl
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestArrayModule.test_string_buf ______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf437dd84>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_string_buf'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_string_buf'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_string_buf'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e339c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42440ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42440ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e307c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf424490c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf424490c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_string_buf'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_string_buf'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_string_buf'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_string_buf at 0xf4952294>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf424440c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf42441cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 136, in <module>
E test_string_buf()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_string_buf
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_string_buf():
module = self.import_module(name='array')
import sys
arr = module.array('u', '123')
view = memoryview(arr)
print("view.shape", view.shape)
print("view.strides", view.strides)
isize = view.itemsize
if sys.platform == 'win32':
assert isize == 2
else:
assert isize == 4
assert module.write_buffer_len(arr) == isize * 3
assert len(module.readbuffer_as_string(arr)) == isize * 3
assert len(module.readbuffer_as_string(view)) == isize * 3
try:
test_string_buf()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 136, in <module>
test_string_buf()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_string_buf
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________________ AppTestArrayModule.test_subclass _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4379e9c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4404cac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d84cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d84cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4404e8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d89ec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d89ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_subclass'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_subclass'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_subclass at 0xf49522cc>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf43d832c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43d812c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 133, in <module>
E test_subclass()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_subclass
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_subclass():
import struct
module = self.import_module(name='array')
class Sub(module.array):
pass
arr = Sub('i', [2])
res = [1, 2, 3] * arr
assert res == [1, 2, 3, 1, 2, 3]
val = module.readbuffer_as_string(arr)
assert val == struct.pack('i', 2)
try:
test_subclass()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 133, in <module>
test_subclass()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_subclass
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
__________________ AppTestArrayModule.test_unicode_readbuffer __________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4375aac>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_unicode_readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_unicode_readbuffer'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_unicode_readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_unicode_readbuffer'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_unicode_readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_unicode_readbuffer'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_unicode_readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e339c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43139ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43139ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_unicode_readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edb44>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43134ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43134ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_unicode_readbuffer'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_unicode_readbuffer'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_unicode_readbuffer'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_unicode_readbuffer at 0xf4952304>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf4313c2c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf431328c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 127, in <module>
E test_unicode_readbuffer()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_unicode_readbuffer
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_unicode_readbuffer():
# Not really part of array, refactor
import struct
module = self.import_module(name='array')
val = module.readbuffer_as_string(b'abcd')
assert val == b'abcd'
try:
test_unicode_readbuffer()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 127, in <module>
test_unicode_readbuffer()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_unicode_readbuffer
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________________ AppTestArrayModule.test_readinto _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf437dd84>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_readinto'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_readinto'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_readinto'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4404554>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf430a04c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf430a04c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4404a54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf430aaec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf430aaec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_readinto'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_readinto'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_readinto'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_readinto at 0xf495233c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf430ad0c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf430a90c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 134, in <module>
E test_readinto()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_readinto
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_readinto():
module = self.import_module(name='array')
a = module.array('B')
a.fromstring(b'0123456789')
filename = self.udir + "/_test_file"
f = open(filename, 'w+b')
f.write(b'foobar')
f.seek(0)
n = f.readinto(a)
f.close()
assert n == 6
assert len(a) == 10
assert a.tostring() == b'foobar6789'
try:
test_readinto()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 134, in <module>
test_readinto()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_readinto
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________________ AppTestArrayModule.test_iowrite ________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4375aac>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_iowrite'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_iowrite'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_iowrite'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4404f7c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43cfcec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43cfcec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf44042d4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43cf8ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43cf8ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_iowrite'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_iowrite'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_iowrite'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_iowrite at 0xf4952374>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf43cf0ec>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43cf7ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 129, in <module>
E test_iowrite()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_iowrite
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_iowrite():
module = self.import_module(name='array')
from io import BytesIO
a = module.array('B')
a.fromstring(b'0123456789')
fd = BytesIO()
# only test that it works
fd.write(a)
try:
test_iowrite()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 129, in <module>
test_iowrite()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_iowrite
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
____________ AppTestArrayModule.test_getitem_via_PySequence_GetItem ____________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf437dd84>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'...all__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'...all__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'...all__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43e32fc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ce_GetItem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435ba8c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435ba8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ce_GetItem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4404554>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ce_GetItem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435b78c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435b78c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ce_GetItem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getitem_via_PySequence_GetItem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_getitem_via_PySequence_GetItem'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_getitem_via_PySequence_GetItem'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_getitem_via_PySequence_GetItem at 0xf49523ac>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf435bd8c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf435bdcc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 131, in <module>
E test_getitem_via_PySequence_GetItem()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_getitem_via_PySequence_GetItem
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_getitem_via_PySequence_GetItem():
module = self.import_module(name='array')
a = module.array('i', range(10))
# call via tp_as_mapping.mp_subscript
assert 5 == a[-5]
# PySequence_ITEM used to call space.getitem() which
# prefers tp_as_mapping.mp_subscript over tp_as_sequence.sq_item
# Now fixed so this test raises (array_item does not add len(a),
# array_subscr does)
raises(IndexError, module.getitem, a, -5)
try:
test_getitem_via_PySequence_GetItem()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 131, in <module>
test_getitem_via_PySequence_GetItem()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_getitem_via_PySequence_GetItem
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________ AppTestArrayModule.test_subclass_with_attribute ________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from array.c:8:
/build_dir/pypy-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4375aac>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43edbe4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4248bcc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4248bcc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4360874>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf424894c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf424894c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_subclass_with_attribute'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_subclass_with_attribute'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_subclass_with_attribute at 0xf49523e4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...yModule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0xf42f912c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf424876c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from array.c:8:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
E test_subclass_with_attribute()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_subclass_with_attribute
E module = self.import_module(name='array')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_subclass_with_attribute():
module = self.import_module(name='array')
class Sub(module.array):
def addattrib(self):
print('called addattrib')
self.attrib = True
import gc
module.subclass_with_attribute(Sub, "addattrib", "attrib", gc.collect)
assert Sub.__module__ == __name__
try:
test_subclass_with_attribute()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from array.c:8:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'array.c', '-o', 'array.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
test_subclass_with_attribute()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_subclass_with_attribute
module = self.import_module(name='array')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
__________________ AppTestCpythonExtension.test_createmodule ___________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf43ad454>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_createmodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_createmodule'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_createmodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_createmodule'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_createmodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_createmodule'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_createmodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43af84c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...eatemodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42fe34c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42fe34c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...eatemodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_createmodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf43af784>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...eatemodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42fe78c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42fe78c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...eatemodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_createmodule'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_createmodule'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_createmodule'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_createmodule at 0xf4a4048c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestCpythonExtension.w_compile_module of <pypy.module.cpyext.test.test_cpyext.AppT...tension.w_import_extension of <pypy.module.cpyext.test.test_cpyext.AppTestCpythonExtension object at 0xf42fe32c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf42fe66c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 125, in <module>
E test_createmodule()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_createmodule
E self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_createmodule():
import sys
self.import_module(name='foo')
assert 'foo' in sys.modules
try:
test_createmodule()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 125, in <module>
test_createmodule()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_createmodule
self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
__________________ AppTestCpythonExtension.test_load_dynamic ___________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
Traceback (most recent call last):
File "/build...t/usession-py3.12-723/src.py", line 143, in test_load_dynamic
assert foo.__dict__ == foo2.__dict__
AssertionError
>
func = <function <lambda> at 0xf4375aac>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_load_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_load_dynamic'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_load_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_load_dynamic'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_load_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_load_dynamic'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_load_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4360cd4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ad_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48ebc6c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48ebc6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ad_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_load_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4360a54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ad_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a7f2c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a7f2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ad_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_load_dynamic'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_load_dynamic'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_load_dynamic'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_load_dynamic at 0xf4a40534>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestCpythonExtension.w_compile_module of <pypy.module.cpyext.test.test_cpyext.AppT...tension.w_import_extension of <pypy.module.cpyext.test.test_cpyext.AppTestCpythonExtension object at 0xf4a45d6c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43a72ac>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 145, in <module>
E test_load_dynamic()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 143, in test_load_dynamic
E assert foo.__dict__ == foo2.__dict__
E AssertionError
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_load_dynamic():
import sys
body = """
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"%(modname)s", /* m_name */
NULL, /* m_doc */
-1, /* m_size */
NULL, /* m_methods */
};
"""
foo = self.import_module(name='foo', body=body, use_imp=True)
assert 'foo' in sys.modules
del sys.modules['foo']
# replaces imp.load_dynamic('foo', foo.__file__), removed in 3.12
import importlib.machinery, importlib.util
loader = importlib.machinery.ExtensionFileLoader('foo', foo.__file__)
spec = importlib.util.spec_from_file_location(
'foo', foo.__file__, loader=loader)
foo2 = importlib.util.module_from_spec(spec)
sys.modules['foo'] = foo2
loader.exec_module(foo2)
assert 'foo' in sys.modules
assert foo.__dict__ == foo2.__dict__
try:
test_load_dynamic()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 145, in <module>
test_load_dynamic()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 143, in test_load_dynamic
assert foo.__dict__ == foo2.__dict__
AssertionError
_____________________ AppTestFrameObject.test_forge_frame ______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from /build_dir/pypy-c-jit-linux...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4212d84>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_forge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_forge_frame'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_forge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_forge_frame'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_forge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_forge_frame'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_forge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4220234>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...orge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4483d8c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4483d8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...orge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_forge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4220d24>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...orge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4483c2c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4483c2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...orge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_forge_frame'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_forge_frame'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_forge_frame'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_forge_frame at 0xf48b4ae4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestFrameObject.w_compile_module of <pypy.module.cpyext.test.test_frameobject.AppT...eObject.w_import_extension of <pypy.module.cpyext.test.test_frameobject.AppTestFrameObject object at 0xf42e510c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf48a1a2c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/Python.h:111,
E from source_0.c:3:
E source_0.c: In function ‘foo_raise_exception’:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/pypy_decl.h:1085:29: error: too few arguments to function ‘PyPyUnstable_Code_New’
E 1085 | #define PyUnstable_Code_New PyPyUnstable_Code_New
E | ^~~~~~~~~~~~~~~~~~~~~
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/code.h:39:20: note: in expansion of macro ‘PyUnstable_Code_New’
E 39 | #define PyCode_New PyUnstable_Code_New
E | ^~~~~~~~~~~~~~~~~~~
E source_0.c:18:44: note: in expansion of macro ‘PyCode_New’
E 18 | py_code = (PyCodeObject *)PyCode_New(
E | ^~~~~~~~~~
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/pypy_decl.h:1085:29: note: declared here
E 1085 | #define PyUnstable_Code_New PyPyUnstable_Code_New
E | ^~~~~~~~~~~~~~~~~~~~~
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/pypy_decl.h:1086:24: note: in expansion of macro ‘PyUnstable_Code_New’
E 1086 | PyAPI_FUNC(PyObject *) PyUnstable_Code_New(int arg0, int arg1, int arg2, int arg3, int arg4, PyObject * arg5, PyObject * arg6, PyObject * arg7, PyObject * arg8, PyObject * arg9, PyObject * arg10, PyObject * arg11, PyObject * arg12, PyObject * arg13, int arg14, PyObject * arg15, PyObject * arg16);
E | ^~~~~~~~~~~~~~~~~~~
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'source_0.c', '-o', 'source_0.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 189, in <module>
E test_forge_frame()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_forge_frame
E module = self.import_extension('foo', [
E ^^^^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 95, in w_import_extension
E return sys_info.import_extension(
E ^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 96, in import_extension
E return self.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_forge_frame():
module = self.import_extension('foo', [
("raise_exception", "METH_NOARGS",
"""
PyObject *py_srcfile = PyUnicode_FromString("filename");
PyObject *py_funcname = PyUnicode_FromString("funcname");
PyObject *py_globals = PyDict_New();
PyObject *py_locals = PyDict_New();
PyObject *empty_bytes = PyBytes_FromString("");
PyObject *empty_tuple = PyTuple_New(0);
PyCodeObject *py_code;
PyFrameObject *py_frame = NULL;
py_code = (PyCodeObject *)PyCode_New(
0, /*int argcount,*/
#if PY_MAJOR_VERSION >= 3
0, /*int kwonlyargcount,*/
#endif
0, /*int nlocals,*/
0, /*int stacksize,*/
0, /*int flags,*/
empty_bytes, /*PyObject *code,*/
empty_tuple, /*PyObject *consts,*/
empty_tuple, /*PyObject *names,*/
empty_tuple, /*PyObject *varnames,*/
empty_tuple, /*PyObject *freevars,*/
empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *qualname,*/
py_funcname, /*PyObject *name,*/
42, /*int firstlineno,*/
empty_bytes /*PyObject *lnotab*/
);
if (!py_code) goto bad;
py_frame = PyFrame_New(
PyThreadState_Get(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
py_locals /*PyObject *locals*/
);
if (!py_frame) goto bad;
py_frame->f_lineno = 48; /* Does not work with CPython */
PyErr_SetString(PyExc_ValueError, "error message");
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
Py_XDECREF(empty_bytes);
Py_XDECREF(empty_tuple);
Py_XDECREF(py_globals);
Py_XDECREF(py_locals);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
return NULL;
"""),
], prologue='#include "frameobject.h"')
exc = raises(ValueError, module.raise_exception)
exc.value.args[0] == 'error message'
frame = exc.traceback.tb_frame
if not self.runappdirect:
frame = exc.traceback.tb_frame
assert frame.f_code.co_filename == "filename"
assert frame.f_code.co_name == "funcname"
# Cython does not work on CPython as well...
assert exc.traceback.tb_lineno in (-1, 42, 48) # should be 48
assert frame.f_lineno in (-1, 42, 48)
try:
test_forge_frame()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/Python.h:111,\n from source_0.c:3:\nsource_0.c: In function \u2018foo_raise_exception\u2019:\n/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/pypy_decl.h:1085:29: error: too few arguments to function \u2018PyPyUnstable_Code_New\u2019\n 1085 | #define PyUnstable_Code_New PyPyUnstable_Code_New\n | ^~~~~~~~~~~~~~~~~~~~~\n/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/code.h:39:20: note: in expansion of macro \u2018PyUnstable_Code_New\u2019\n 39 | #define PyCode_New PyUnstable_Code_New\n | ^~~~~~~~~~~~~~~~~~~\nsource_0.c:18:44: note: in expansion of macro \u2018PyCode_New\u2019\n 18 | py_code = (PyCodeObject *)PyCode_New(\n | ^~~~~~~~~~\n/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/pypy_decl.h:1085:29: note: declared here\n 1085 | #define PyUnstable_Code_New PyPyUnstable_Code_New\n | ^~~~~~~~~~~~~~~~~~~~~\n/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/pypy_decl.h:1086:24: note: in expansion of macro \u2018PyUnstable_Code_New\u2019\n 1086 | PyAPI_FUNC(PyObject *) PyUnstable_Code_New(int arg0, int arg1, int arg2, int arg3, int arg4, PyObject * arg5, PyObject * arg6, PyObject * arg7, PyObject * arg8, PyObject * arg9, PyObject * arg10, PyObject * arg11, PyObject * arg12, PyObject * arg13, int arg14, PyObject * arg15, PyObject * arg16);\n | ^~~~~~~~~~~~~~~~~~~\nTraceback (most recent call last):\n File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn\n subprocess.check_call(cmd, env=_inject_macos_ver(env))\n ^^^^^^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call\n raise CalledProcessError(retcode, cmd)\nsubprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'source_0.c', '-o', 'source_0.o']' returned non-zero exit status 1.\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile\n self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)\n ^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn\n spawn(cmd, **kwargs)\n File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn\n raise DistutilsExecError(\ndistutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 189, in <module>\n test_forge_frame()\n File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_forge_frame\n module = self.import_extension('foo', [\n ^^^^^^^^^^^^^^^^\n File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 95, in w_import_extension\n return sys_info.import_extension(\n ^^^^^^^^^^^^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 96, in import_extension\n return self.import_module(\n ^^^^^^^^^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module\n mod = self.compile_extension_module(\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module\n soname = c_compile(source_files, outputfilename=str(dirname / modname),\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile\n _build(\n File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build\n res = compiler.compile([cfile.basename],\n ^^^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile\n self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)\n ^^^^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile\n raise CompileError(msg)\ndistutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1\n
_______________________ AppTestMethodObject.test_wrapper _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from specmethdocstring.c:1411:
/...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf41f2294>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_wrapper'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_wrapper'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_wrapper'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41c66e4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf421196c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf421196c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41c6c0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4211d4c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4211d4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_wrapper'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_wrapper'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_wrapper'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_wrapper at 0xf483510c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestMethodObject.w_compile_module of <pypy.module.cpyext.test.test_methodobject.Ap...bject.w_import_extension of <pypy.module.cpyext.test.test_methodobject.AppTestMethodObject object at 0xf421160c>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf41ed7cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from specmethdocstring.c:1411:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'specmethdocstring.c', '-o', 'specmethdocstring.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 131, in <module>
E test_wrapper()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_wrapper
E mod = self.import_module(name="specmethdocstring")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_wrapper():
# Copy the Cython 3.0.0alpha10 version of specmethodstring tests
mod = self.import_module(name="specmethdocstring")
c = mod.C()
assert c.__iter__.__doc__ == "usable docstring"
assert mod.C.__qualname__ == "C"
assert c.__iter__.__qualname__ == "C.__iter__"
assert type(c.__iter__).__doc__.startswith('instancemethod(function, instance)')
assert mod.C.__next__.__doc__ == "usable docstring"
assert mod.C.__next__.__text_signature__ == '($self, /)'
try:
test_wrapper()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from specmethdocstring.c:1411:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'specmethdocstring.c', '-o', 'specmethdocstring.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 131, in <module>
test_wrapper()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_wrapper
mod = self.import_module(name="specmethdocstring")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_____________________ AppTestMethodObject.test_module_name _____________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from test_func.c:1500:
/build_di...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4212d84>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_module_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_module_name'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_module_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_module_name'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_module_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_module_name'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_module_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4220644>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...odule_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf446376c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf446376c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...odule_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_module_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4220a54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...odule_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4463a0c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4463a0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...odule_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_module_name'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_module_name'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_module_name'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_module_name at 0xf4835144>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestMethodObject.w_compile_module of <pypy.module.cpyext.test.test_methodobject.Ap...bject.w_import_extension of <pypy.module.cpyext.test.test_methodobject.AppTestMethodObject object at 0xf44636cc>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf446364c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from test_func.c:1500:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'test_func.c', '-o', 'test_func.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 125, in <module>
E test_module_name()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_module_name
E mod = self.import_module(name="test_func")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_module_name():
# issue 3993
mod = self.import_module(name="test_func")
assert mod.f.__module__ == "test_func"
try:
test_module_name()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from test_func.c:1500:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'test_func.c', '-o', 'test_func.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 125, in <module>
test_module_name()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_module_name
mod = self.import_module(name="test_func")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________________ AppTestMethodObject.test_min_max _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from builtin_min_max.c:1248:
/bu...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf421241c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_min_max'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_min_max'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_min_max'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41c6c0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf445468c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf445468c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41da11c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4454cec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4454cec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_min_max'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_min_max'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_min_max'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_min_max at 0xf483517c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestMethodObject.w_compile_module of <pypy.module.cpyext.test.test_methodobject.Ap...bject.w_import_extension of <pypy.module.cpyext.test.test_methodobject.AppTestMethodObject object at 0xf4454fec>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf445410c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from builtin_min_max.c:1248:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'builtin_min_max.c', '-o', 'builtin_min_max.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 124, in <module>
E test_min_max()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_min_max
E mod = self.import_module(name="builtin_min_max")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_min_max():
mod = self.import_module(name="builtin_min_max")
mod.test_max2()
try:
test_min_max()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from builtin_min_max.c:1248:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'builtin_min_max.c', '-o', 'builtin_min_max.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 124, in <module>
test_min_max()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_min_max
mod = self.import_module(name="builtin_min_max")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_____________________ AppTestThreads.test_thread_interrupt _____________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
Traceback (most recent call last):
File "/build...urprise(childstarted[0], KeyError)
^^^^^^^^
OverflowError: Python int too large to convert to C long
>
func = <function <lambda> at 0xf4118a74>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_thread_interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_thread_interrupt'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_thread_interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_thread_interrupt'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_thread_interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_thread_interrupt'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_thread_interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf411661c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a42cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a42cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_thread_interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41164b4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a484c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a484c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_thread_interrupt'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_thread_interrupt'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_thread_interrupt'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_thread_interrupt at 0xf46b7f0c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestThreads.w_compile_module of <pypy.module.cpyext.test.test_pystate.AppTestThrea... AppTestThreads.w_import_extension of <pypy.module.cpyext.test.test_pystate.AppTestThreads object at 0xf43a47ac>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43a430c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 204, in <module>
E test_thread_interrupt()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 166, in test_thread_interrupt
E res = module.surprise(childstarted[0], KeyError)
E ^^^^^^^^
E OverflowError: Python int too large to convert to C long
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_thread_interrupt():
if not self.runappdirect:
skip("test fails untranslated for obscure reasons")
import signal # to initialize the signal infrastructure
import _thread as thread, time
module = self.import_extension('disruptor', [
("surprise", "METH_VARARGS",
"""
long tid;
PyObject *exc;
if (!PyArg_ParseTuple(args, "lO", &tid, &exc))
return NULL;
return PyLong_FromLong(PyThreadState_SetAsyncExc(tid, exc));
"""),
("nosurprise", "METH_VARARGS",
"""
long tid;
if (!PyArg_ParseTuple(args, "l", &tid))
return NULL;
return PyLong_FromLong(PyThreadState_SetAsyncExc(tid, NULL));
"""),
])
# raise in another thread
def f():
try:
childstarted.append(thread.get_ident())
while 1:
print("waiting in child")
time.sleep(0.1)
except KeyError:
childstarted.pop()
else:
thread.interrupt_main() # to crash the test
cancelled_exception = False
for i in range(20):
print(i)
# first wait for the child to start
childstarted = []
thread.start_new_thread(f, ())
for i in range(500):
if childstarted:
break
time.sleep(0.1)
# then interrupt it from the main thread
res = module.surprise(childstarted[0], KeyError)
assert res == 1
# try to cancel the interrupt
# this is racing! the child could either have been terminated
# already or not
try:
res = module.nosurprise(childstarted[0])
assert res in (0, 1)
except IndexError:
pass
else:
if res == 1:
cancelled_exception = True
# actually send exception
res = module.surprise(childstarted[0], KeyError)
assert res in (0, 1)
# now wait for the exception to arrive in the child thread
# which empties childstarted again
for i in range(500):
if not childstarted:
break
time.sleep(0.1)
assert res == 1
if self.runappdirect:
# only after translation
assert cancelled_exception
else:
# best we can do is check that the test ran
pass
# raise to main
with raises(ValueError):
res = module.surprise(thread.get_ident(), ValueError)
while 1:
print("sleeping")
time.sleep(0.1)
try:
test_thread_interrupt()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
0
waiting in child
===aefwuiheawiu===
waiting in child
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 204, in <module>
test_thread_interrupt()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 166, in test_thread_interrupt
res = module.surprise(childstarted[0], KeyError)
^^^^^^^^
OverflowError: Python int too large to convert to C long
_______________________ AppTestTuple.test_tuple_subclass _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf413daac>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tuple_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tuple_subclass'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tuple_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tuple_subclass'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tuple_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tuple_subclass'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tuple_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143504>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...e_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf433446c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf433446c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...e_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tuple_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143cd4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...e_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4334b0c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4334b0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...e_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tuple_subclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_tuple_subclass'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_tuple_subclass'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_tuple_subclass at 0xf44a54c4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'compile_module': <bound method AppTestTuple.w_compile_module of <pypy.module.cpyext.test.test_tupleobject.AppTestTup... AppTestTuple.w_import_extension of <pypy.module.cpyext.test.test_tupleobject.AppTestTuple object at 0xf4334fec>>, ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43343cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
E test_tuple_subclass()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_tuple_subclass
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_tuple_subclass():
module = self.import_module(name='foo')
a = module.TupleLike(range(100, 400, 100))
assert module.is_TupleLike(a) == 1
assert isinstance(a, tuple)
assert issubclass(type(a), tuple)
assert list(a) == list(range(100, 400, 100))
assert list(a) == list(range(100, 400, 100))
assert list(a) == list(range(100, 400, 100))
try:
test_tuple_subclass()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
test_tuple_subclass()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_tuple_subclass
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestTypeObject.test_typeobject _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf411872c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41166bc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf438cdec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf438cdec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf411698c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf438cf0c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf438cf0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_typeobject'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_typeobject'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_typeobject at 0xf429772c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf42440ac>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf44bac4c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 134, in <module>
E test_typeobject()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_typeobject
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_typeobject():
import sys
module = self.import_module(name='foo')
assert 'foo' in sys.modules
assert "copy" in dir(module.fooType)
obj = module.new()
#print(obj.foo)
assert obj.foo == 42
#print("Obj has type", type(obj))
assert type(obj) is module.fooType
#print("type of obj has type", type(type(obj)))
#print("type of type of obj has type", type(type(type(obj))))
assert module.fooType.__doc__ == "foo is for testing."
try:
test_typeobject()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 134, in <module>
test_typeobject()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_typeobject
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_____________ AppTestTypeObject.test_typeobject_method_descriptor ______________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf413daac>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_method_descriptor'>,...icall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_method_descriptor'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_method_descriptor'>,...icall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_method_descriptor'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_method_descriptor'>,...icall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_method_descriptor'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_method_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf414357c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf420458c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf420458c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_method_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143cd4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf420408c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf420408c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_method_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_typeobject_method_descriptor'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_typeobject_method_descriptor'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_typeobject_method_descriptor at 0xf4297764>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf420424c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf42049ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 139, in <module>
E test_typeobject_method_descriptor()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_typeobject_method_descriptor
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_typeobject_method_descriptor():
module = self.import_module(name='foo')
obj = module.new()
obj2 = obj.copy()
assert module.new().name == "Foo Example"
c = module.fooType.copy
assert not "im_func" in dir(module.fooType.copy)
assert module.fooType.copy.__objclass__ is module.fooType
assert "copy" in repr(module.fooType.copy)
assert repr(module.fooType) == "<class 'foo.foo'>"
assert repr(obj2) == "<Foo>"
assert repr(module.fooType.__call__) == "<slot wrapper '__call__' of 'foo.foo' objects>"
assert obj2(foo=1, bar=2) == dict(foo=1, bar=2)
assert module.fooType.__repr__.__text_signature__ == '($self, /)'
print(obj.foo)
assert obj.foo == 42
assert obj.int_member == obj.foo
try:
test_typeobject_method_descriptor()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 139, in <module>
test_typeobject_method_descriptor()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_typeobject_method_descriptor
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________ AppTestTypeObject.test_typeobject_data_member _________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf44825a4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_data_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_data_member'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_data_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_data_member'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_data_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_data_member'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_data_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143234>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ata_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d86cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d86cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ata_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_data_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143f04>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ata_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d8acc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43d8acc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ata_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_data_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_typeobject_data_member'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_typeobject_data_member'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_typeobject_data_member at 0xf429779c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf43d8fac>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43d8dcc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 137, in <module>
E test_typeobject_data_member()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_typeobject_data_member
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_typeobject_data_member():
module = self.import_module(name='foo')
obj = module.new()
obj.int_member = 23
assert obj.int_member == 23
obj.int_member = 42
raises(TypeError, "obj.int_member = 'not a number'")
raises(TypeError, "del obj.int_member")
raises(AttributeError, "obj.int_member_readonly = 42")
exc = raises(AttributeError, "del obj.int_member_readonly")
assert "readonly" in str(exc.value)
raises(SystemError, "obj.broken_member")
raises(SystemError, "obj.broken_member = 42")
assert module.fooType.broken_member.__doc__ is None
assert module.fooType.object_member.__doc__ == "A Python object."
assert str(type(module.fooType.int_member)) == "<class 'member_descriptor'>"
try:
test_typeobject_data_member()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 137, in <module>
test_typeobject_data_member()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_typeobject_data_member
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________ AppTestTypeObject.test_typeobject_object_member ________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf417ecdc>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_object_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_object_member'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_object_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_object_member'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_object_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_object_member'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_object_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf414370c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ect_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419e88c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419e88c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ect_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_object_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf414361c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ect_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419e1ec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419e1ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ect_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_object_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_typeobject_object_member'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_typeobject_object_member'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_typeobject_object_member at 0xf42977d4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf419e14c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf419eecc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 141, in <module>
E test_typeobject_object_member()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_typeobject_object_member
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_typeobject_object_member():
module = self.import_module(name='foo')
obj = module.new()
assert obj.object_member is None
obj.object_member = "hello"
assert obj.object_member == "hello"
del obj.object_member
# Make sure a second call does not fail
del obj.object_member
assert obj.object_member is None
raises(AttributeError, "obj.object_member_ex")
obj.object_member_ex = None
assert obj.object_member_ex is None
obj.object_member_ex = 42
assert obj.object_member_ex == 42
del obj.object_member_ex
raises(AttributeError, "del obj.object_member_ex")
obj.set_foo = 32
assert obj.foo == 32
try:
test_typeobject_object_member()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 141, in <module>
test_typeobject_object_member()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_typeobject_object_member
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________ AppTestTypeObject.test_typeobject_string_member ________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf44825a4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_string_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_string_member'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_string_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_string_member'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_string_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_string_member'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_string_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143234>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ing_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4203d4c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4203d4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ing_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_string_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143284>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ing_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4203f8c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4203f8c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ing_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_string_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_typeobject_string_member'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_typeobject_string_member'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_typeobject_string_member at 0xf429780c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf4203c6c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf419df0c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 137, in <module>
E test_typeobject_string_member()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_typeobject_string_member
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_typeobject_string_member():
module = self.import_module(name='foo')
obj = module.new()
assert obj.string_member == "Hello from PyPy"
raises(TypeError, "obj.string_member = 42")
raises(TypeError, "del obj.string_member")
obj.unset_string_member()
assert obj.string_member is None
assert obj.string_member_inplace == "spam"
raises(TypeError, "obj.string_member_inplace = 42")
raises(TypeError, "del obj.string_member_inplace")
assert obj.char_member == "s"
obj.char_member = "a"
assert obj.char_member == "a"
raises(TypeError, "obj.char_member = 'spam'")
raises(TypeError, "obj.char_member = 42")
try:
test_typeobject_string_member()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 137, in <module>
test_typeobject_string_member()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_typeobject_string_member
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_________________ AppTestTypeObject.test_typeobject_int_member _________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf417efb4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_int_member'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_int_member'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_typeobject_int_member'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf414361c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf427582c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf427582c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41431e4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf423f20c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf423f20c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_typeobject_int_member'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_typeobject_int_member'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_typeobject_int_member'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_typeobject_int_member at 0xf4297844>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf427544c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf438c94c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 142, in <module>
E test_typeobject_int_member()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_typeobject_int_member
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_typeobject_int_member():
import sys, struct
module = self.import_module(name='foo')
obj = module.new()
max_uint = struct.unpack_from("@L", b"\xFF" * 8)[0]
bignum = max_uint//2 - 42
obj.short_member = -12345; assert obj.short_member == -12345
obj.long_member = -bignum; assert obj.long_member == -bignum
obj.ushort_member = 45678; assert obj.ushort_member == 45678
obj.uint_member = 3000000000; assert obj.uint_member == 3000000000
obj.ulong_member = 2*bignum; assert obj.ulong_member == 2*bignum
obj.byte_member = -99; assert obj.byte_member == -99
obj.ubyte_member = 199; assert obj.ubyte_member == 199
obj.bool_member = True; assert obj.bool_member is True
obj.float_member = 9.25; assert obj.float_member == 9.25
obj.double_member = 9.25; assert obj.double_member == 9.25
obj.longlong_member = -2**59; assert obj.longlong_member == -2**59
obj.ulonglong_member = 2**63; assert obj.ulonglong_member == 2**63
obj.ssizet_member = sys.maxsize;assert obj.ssizet_member == sys.maxsize
#
obj.ulong_member = -3; assert obj.ulong_member == max_uint + 1 - 3, obj.ulong_member
try:
test_typeobject_int_member()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 142, in <module>
test_typeobject_int_member()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_typeobject_int_member
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________ AppTestTypeObject.test_int_member_index_protocol _______________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf413daac>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_int_member_index_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_int_member_index_protocol'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_int_member_index_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_int_member_index_protocol'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_int_member_index_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_int_member_index_protocol'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_int_member_index_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4140374>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...x_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf439890c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf439890c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...x_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_int_member_index_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf414384c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...x_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf439854c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf439854c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...x_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_int_member_index_protocol'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_int_member_index_protocol'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_int_member_index_protocol'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_int_member_index_protocol at 0xf429787c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf4398e4c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf4398fec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 134, in <module>
E test_int_member_index_protocol()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_int_member_index_protocol
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_int_member_index_protocol():
# T_ULONG should accept objects implementing __index__, like T_UINT does
module = self.import_module(name='foo')
obj = module.new()
class Index:
def __init__(self, val): self.val = val
def __index__(self): return self.val
obj.uint_member = Index(42)
assert obj.uint_member == 42
obj.ulong_member = Index(99)
assert obj.ulong_member == 99
# T_PYSSIZET must NOT accept __index__ objects - plain int only
raises(TypeError, setattr, obj, 'ssizet_member', Index(1))
try:
test_int_member_index_protocol()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 134, in <module>
test_int_member_index_protocol()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_int_member_index_protocol
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________________ AppTestTypeObject.test_overflow ________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4179374>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_overflow'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_overflow'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_overflow'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4116914>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf431ceac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf431ceac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4140cac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf431ca2c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf431ca2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_overflow'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_overflow'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_overflow'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_overflow at 0xf42978b4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf431c52c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf431c88c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 135, in <module>
E test_overflow()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_overflow
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_overflow():
import struct, warnings
module = self.import_module(name='foo')
obj = module.new()
nbits_short = len(struct.pack("H", 0)) * 8 - 1
shrt_min = -2 ** nbits_short
with raises(OverflowError) as e:
obj.ushort_member = -2**63 - 1
assert "int too large to convert to C" in str(e.value)
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always", RuntimeWarning)
obj.ushort_member = shrt_min - 100
assert len(w) == 1
assert "runcation of value" in str(w[0]), str(w[0])
try:
test_overflow()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 135, in <module>
test_overflow()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_overflow
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_____________________ AppTestTypeObject.test_staticmethod ______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4179bfc>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_staticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_staticmethod'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_staticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_staticmethod'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_staticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_staticmethod'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_staticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf414384c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...aticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41eab4c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41eab4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...aticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_staticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4140914>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...aticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41ea60c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41ea60c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...aticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_staticmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_staticmethod'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_staticmethod'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_staticmethod at 0xf42978ec>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf41eabcc>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf41ea3ac>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
E test_staticmethod()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_staticmethod
E module = self.import_module(name="foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_staticmethod():
module = self.import_module(name="foo")
obj = module.fooType.create()
assert obj.foo == 42
obj2 = obj.create()
assert obj2.foo == 42
assert obj2.create.__qualname__ == "foo.create"
try:
test_staticmethod()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
test_staticmethod()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_staticmethod
module = self.import_module(name="foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestTypeObject.test_classmethod ______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4179c6c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_classmethod'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_classmethod'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_classmethod'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41167d4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...lassmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41f7acc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41f7acc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...lassmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4140cac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...lassmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41f72ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41f72ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...lassmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_classmethod'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_classmethod'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_classmethod at 0xf4297924>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf41f742c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf41f74ac>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 133, in <module>
E test_classmethod()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_classmethod
E module = self.import_module(name="foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_classmethod():
module = self.import_module(name="foo")
classmeth = module.fooType.classmeth
assert classmeth.__qualname__ == "foo.classmeth"
obj = classmeth()
assert obj is module.fooType
class _C:
def _m(self): pass
MethodType = type(_C()._m)
assert not isinstance(classmeth, MethodType)
assert classmeth.__doc__ is None
assert classmeth.__text_signature__ is None
try:
test_classmethod()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 133, in <module>
test_classmethod()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_classmethod
module = self.import_module(name="foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_____________________ AppTestTypeObject.test_class_getitem _____________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf40dcd84>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_class_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_class_getitem'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_class_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_class_getitem'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_class_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_class_getitem'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_class_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4171f04>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ss_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435b8cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435b8cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ss_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_class_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4140374>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ss_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435b6cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435b6cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ss_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_class_getitem'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_class_getitem'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_class_getitem'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_class_getitem at 0xf429795c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf435be2c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf435bbcc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
E test_class_getitem()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_class_getitem
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_class_getitem():
module = self.import_module(name='foo')
f = module.fooType.__class_getitem__
print(dir(f))
assert f.__qualname__ == "foo.__class_getitem__"
out = f(42)
assert str(out) == 'foo.foo[42]'
assert f.__doc__ == "See PEP 585"
assert f.__text_signature__ == '($type, x, /)'
try:
test_class_getitem()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
test_class_getitem()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_class_getitem
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestTypeObject.test_methoddescr ______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf40c425c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_methoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_methoddescr'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_methoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_methoddescr'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_methoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_methoddescr'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_methoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143b6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ethoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf44549cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf44549cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ethoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_methoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4171f54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ethoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf445432c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf445432c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ethoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_methoddescr'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_methoddescr'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_methoddescr'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_methoddescr at 0xf4297994>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf445438c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf445468c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 137, in <module>
E test_methoddescr()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_methoddescr
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_methoddescr():
module = self.import_module(name='foo')
descr = module.fooType.copy
print(descr.__qualname__)
assert descr.__qualname__ == "foo.copy"
assert type(descr).__name__ == 'method_descriptor'
assert str(descr) in ("<method 'copy' of 'foo.foo' objects>",
"<method 'copy' of 'foo' objects>")
assert repr(descr) in ("<method 'copy' of 'foo.foo' objects>",
"<method 'copy' of 'foo' objects>")
raises(TypeError, descr, None)
assert descr.__doc__ == "Copy the foo."
assert descr.__text_signature__ == '($self, /)'
import inspect
assert not inspect.isbuiltin(descr)
assert inspect.ismethoddescriptor(descr)
try:
test_methoddescr()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 137, in <module>
test_methoddescr()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_methoddescr
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________ AppTestTypeObject.test_cython_fake_classmethod ________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf40dcd84>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_cython_fake_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_cython_fake_classmethod'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_cython_fake_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_cython_fake_classmethod'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_cython_fake_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_cython_fake_classmethod'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_cython_fake_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4143eb4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...lassmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419362c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419362c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...lassmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_cython_fake_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4171b94>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...lassmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41934cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41934cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...lassmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_cython_fake_classmethod'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_cython_fake_classmethod'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_cython_fake_classmethod'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_cython_fake_classmethod at 0xf42979cc>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf4193f4c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf419360c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 129, in <module>
E test_cython_fake_classmethod()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_cython_fake_classmethod
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_cython_fake_classmethod():
module = self.import_module(name='foo')
# Check that objects are printable
print(module.fooType.fake_classmeth) # bound method on the class
print(module.fooType.__dict__['fake_classmeth']) # raw descriptor
assert module.fooType.fake_classmeth() is module.fooType
try:
test_cython_fake_classmethod()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 129, in <module>
test_cython_fake_classmethod()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_cython_fake_classmethod
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
__________________________ AppTestTypeObject.test_new __________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf40c425c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4171c0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i... 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435e06c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435e06c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i... 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf417161c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i... 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435e8ec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf435e8ec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i... 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_new'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_new'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_new'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_new at 0xf4297a04>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf435e18c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf435e5ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 141, in <module>
E test_new()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_new
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_new():
# XXX cpython segfaults but if run singly (with -k test_new) this passes
module = self.import_module(name='foo')
obj = module.new()
# call __new__
newobj = module.UnicodeSubtype(u"xyz")
assert newobj == u"xyz"
assert isinstance(newobj, module.UnicodeSubtype)
assert isinstance(module.fooType(), module.fooType)
class bar(module.fooType):
pass
assert isinstance(bar(), bar)
fuu = module.UnicodeSubtype
class fuu2(fuu):
def baz(self):
return self
assert fuu2(u"abc").baz().escape()
raises(TypeError, module.fooType.object_member.__get__, 1)
try:
test_new()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 141, in <module>
test_new()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_new
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_________________ AppTestTypeObject.test_multiple_inheritance1 _________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4052ae4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_multiple_inheritance1'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_multiple_inheritance1'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_multiple_inheritance1'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf40ab194>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...heritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41aad6c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41aad6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...heritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf40abd4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...heritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41aa04c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41aa04c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...heritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance1'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_multiple_inheritance1'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_multiple_inheritance1'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_multiple_inheritance1 at 0xf4297a74>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf41aa5ec>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf41aacac>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
E test_multiple_inheritance1()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_multiple_inheritance1
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_multiple_inheritance1():
module = self.import_module(name='foo')
obj = module.UnicodeSubtype(u'xyz')
obj2 = module.UnicodeSubtype2()
obj3 = module.UnicodeSubtype3()
assert obj3.get_val() == 42
assert len(type(obj3).mro()) == 5
try:
test_multiple_inheritance1()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
test_multiple_inheritance1()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_multiple_inheritance1
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_________________________ AppTestTypeObject.test_init __________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf40c425c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4171c0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a47cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a47cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf40ab5a4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a466c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a466c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_init'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_init'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_init at 0xf4297aac>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf43a4bec>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf43a450c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 139, in <module>
E test_init()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_init
E module = self.import_module(name="foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_init():
module = self.import_module(name="foo")
newobj = module.UnicodeSubtype()
assert newobj.get_val() == 42
# this subtype should inherit tp_init
newobj = module.UnicodeSubtype2()
assert newobj.get_val() == 42
# this subclass redefines __init__
class UnicodeSubclass2(module.UnicodeSubtype):
def __init__(self):
self.foobar = 32
super(UnicodeSubclass2, self).__init__()
newobj = UnicodeSubclass2()
assert newobj.get_val() == 42
assert newobj.foobar == 32
try:
test_init()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 139, in <module>
test_init()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_init
module = self.import_module(name="foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________________ AppTestTypeObject.test_metatype ________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf40bc7d4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_metatype'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_metatype'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_metatype'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf40ab914>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf44520cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf44520cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf40abdc4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf445274c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf445274c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...t_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metatype'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_metatype'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_metatype'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_metatype at 0xf4297ae4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf445216c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf445256c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
E test_metatype()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_metatype
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_metatype():
module = self.import_module(name='foo')
assert module.MetaType.__mro__ == (module.MetaType, type, object)
x = module.MetaType('name', (), {})
assert isinstance(x, type)
assert isinstance(x, module.MetaType)
x()
try:
test_metatype()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
test_metatype()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_metatype
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_________________ AppTestTypeObject.test_metaclass_compatible __________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf40c425c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metaclass_compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_metaclass_compatible'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metaclass_compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_metaclass_compatible'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metaclass_compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_metaclass_compatible'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metaclass_compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf40abbbc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf437382c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf437382c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metaclass_compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf40aba54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf437346c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf437346c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_metaclass_compatible'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_metaclass_compatible'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_metaclass_compatible'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_metaclass_compatible at 0xf4297b1c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf43732ec>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf437374c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
E test_metaclass_compatible()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_metaclass_compatible
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_metaclass_compatible():
# metaclasses should not conflict here
module = self.import_module(name='foo')
assert module.MetaType.__mro__ == (module.MetaType, type, object)
assert type(module.fooType).__mro__ == (type, object)
y = module.MetaType('other', (module.MetaType,), {})
assert isinstance(y, module.MetaType)
x = y('something', (type(y),), {})
del x, y
try:
test_metaclass_compatible()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 130, in <module>
test_metaclass_compatible()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_metaclass_compatible
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestTypeObject.test_init_error _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4048a3c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init_error'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init_error'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init_error'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf4101d74>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf416f8ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf416f8ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf410184c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf416fe0c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf416fe0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_init_error'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_init_error'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_init_error'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_init_error at 0xf4297b8c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf416fb2c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf416f9ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 124, in <module>
E test_init_error()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_init_error
E module = self.import_module("foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_init_error():
module = self.import_module("foo")
raises(ValueError, module.InitErrType)
try:
test_init_error()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 124, in <module>
test_init_error()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_init_error
module = self.import_module("foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
___________________ AppTestTypeObject.test_hash_inheritance ____________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4107e9c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_hash_inheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hash_inheritance'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_hash_inheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hash_inheritance'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_hash_inheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hash_inheritance'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_hash_inheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf401ca7c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...nheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf413e90c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf413e90c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...nheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_hash_inheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf401c4b4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...nheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf413eacc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf413eacc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...nheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_hash_inheritance'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_hash_inheritance'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_hash_inheritance'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_hash_inheritance at 0xf4297c6c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf413ef8c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf413e38c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 127, in <module>
E test_hash_inheritance()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_hash_inheritance
E foo = self.import_module("foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_hash_inheritance():
foo = self.import_module("foo")
assert hash(foo.UnicodeSubtype(u'xyz')) == hash(u'xyz')
assert foo.UnicodeSubtype.__hash__ is str.__hash__
assert hash(foo.UnicodeSubtype3(u'xyz')) == hash(u'xyz')
assert foo.UnicodeSubtype3.__hash__ is str.__hash__
try:
test_hash_inheritance()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 127, in <module>
test_hash_inheritance()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_hash_inheritance
foo = self.import_module("foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestTypeObject.test_descriptor _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf402833c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_descriptor'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_descriptor'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_descriptor'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf41014b4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40d6eac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40d6eac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf410189c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40d636c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40d636c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_descriptor'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_descriptor'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_descriptor'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_descriptor at 0xf4297ca4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf40d676c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf40d6d6c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 134, in <module>
E test_descriptor()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_descriptor
E module = self.import_module("foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_descriptor():
module = self.import_module("foo")
prop = module.Property()
class C(object):
x = prop
obj = C()
assert obj.x == (prop, obj, C)
assert C.x == (prop, None, C)
obj.x = 2
assert obj.y == (prop, 2)
del obj.x
assert obj.z == prop
try:
test_descriptor()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 134, in <module>
test_descriptor()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_descriptor
module = self.import_module("foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________________ AppTestTypeObject.test_tp_dict ________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4107fb4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tp_dict'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tp_dict'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_tp_dict'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf401c52c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41753cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41753cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf401c7ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf417520c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf417520c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...st_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_tp_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_tp_dict'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_tp_dict'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_tp_dict at 0xf4297cdc>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf4175dac>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf41752ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 171, in <module>
E test_tp_dict()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_tp_dict
E foo = self.import_module("foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_tp_dict():
foo = self.import_module("foo")
module = self.import_extension('test', [
("read_tp_dict", "METH_O",
'''
PyObject *method;
if (!args->ob_type->tp_dict)
{
PyErr_SetNone(PyExc_ValueError);
return NULL;
}
method = PyDict_GetItemString(
args->ob_type->tp_dict, "copy");
Py_INCREF(method);
return method;
'''),
("get_type_dict", "METH_O",
'''
PyObject* value = args->ob_type->tp_dict;
if (value == NULL) value = Py_None;
Py_INCREF(value);
return value;
'''),
])
obj = foo.new()
assert module.read_tp_dict(obj) == foo.fooType.copy
d = module.get_type_dict(obj)
assert type(d) is dict
d["_some_attribute"] = 1
assert type(obj)._some_attribute == 1
del d["_some_attribute"]
class A(object):
pass
obj = A()
d = module.get_type_dict(obj)
assert type(d) is dict
d["_some_attribute"] = 1
assert type(obj)._some_attribute == 1
del d["_some_attribute"]
d = module.get_type_dict(1)
assert type(d) is dict
try:
d["_some_attribute"] = 1
except TypeError: # on PyPy, int.__dict__ is really immutable
pass
else:
assert int._some_attribute == 1
del d["_some_attribute"]
try:
test_tp_dict()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 171, in <module>
test_tp_dict()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_tp_dict
foo = self.import_module("foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
___________________ AppTestTypeObject.test_custom_allocation ___________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf402833c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_custom_allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_custom_allocation'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_custom_allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_custom_allocation'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_custom_allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_custom_allocation'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_custom_allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf401c694>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40fd8ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40fd8ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_custom_allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf401c5cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40fdfcc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40fdfcc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_custom_allocation'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_custom_allocation'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_custom_allocation'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_custom_allocation at 0xf4297d14>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf40fd24c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf40fd4cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 126, in <module>
E test_custom_allocation()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_custom_allocation
E foo = self.import_module("foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_custom_allocation():
foo = self.import_module("foo")
obj = foo.newCustom()
assert type(obj) is foo.Custom
assert type(foo.Custom) is foo.MetaType
try:
test_custom_allocation()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 126, in <module>
test_custom_allocation()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_custom_allocation
foo = self.import_module("foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_______________________ AppTestTypeObject.test_type_dict _______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4015064>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_dict'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_dict'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_dict'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf401c98c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf423112c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf423112c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf401c52c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf423154c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf423154c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_type_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_type_dict'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_type_dict'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_type_dict at 0xf4297d84>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0xf4244b2c>, 'compile_module': <bound method A...estTypeObject object at 0xf423144c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf423110c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 158, in <module>
E test_type_dict()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_type_dict
E foo = self.import_module("foo")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_type_dict():
foo = self.import_module("foo")
module = self.import_extension('test', [
("hack_tp_dict", "METH_VARARGS",
'''
PyTypeObject *type;
PyObject *a1 = PyLong_FromLong(1);
PyObject *a2 = PyLong_FromLong(2);
PyObject *obj, *value, *key;
if (!PyArg_ParseTuple(args, "OO", &obj, &key))
return NULL;
type = obj->ob_type;
if (PyDict_SetItem(type->tp_dict, key,
a1) < 0)
return NULL;
Py_DECREF(a1);
PyType_Modified(type);
value = PyObject_GetAttr((PyObject *)type, key);
Py_DECREF(value);
if (PyDict_SetItem(type->tp_dict, key,
a2) < 0)
return NULL;
Py_DECREF(a2);
PyType_Modified(type);
value = PyObject_GetAttr((PyObject *)type, key);
return value;
'''
)
])
obj = foo.new()
assert module.hack_tp_dict(obj, "a") == 2
class Sub(foo.fooType):
pass
obj = Sub()
assert module.hack_tp_dict(obj, "b") == 2
try:
test_type_dict()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 158, in <module>
test_type_dict()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_type_dict
foo = self.import_module("foo")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
___________________ AppTestSlots.test_app_subclass_of_c_type ___________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fe20d4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_subclass_of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_app_subclass_of_c_type'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_subclass_of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_app_subclass_of_c_type'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_subclass_of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_app_subclass_of_c_type'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_subclass_of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3ff293c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4483f6c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4483f6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_subclass_of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3ff25cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf448352c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf448352c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_subclass_of_c_type'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_app_subclass_of_c_type'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_app_subclass_of_c_type'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_app_subclass_of_c_type at 0xf44bd3e4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf446366c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf44833ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 142, in <module>
E test_app_subclass_of_c_type()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_app_subclass_of_c_type
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_app_subclass_of_c_type():
import sys
module = self.import_module(name='foo')
size = module.size_of_instances(module.fooType)
class f1(object):
pass
class f2(module.fooType):
pass
class bar(f1, f2):
pass
class foo(f2, f1):
pass
x = foo()
assert bar.__base__ is f2
# On cpython, the size changes.
if '__pypy__' in sys.builtin_module_names:
assert module.size_of_instances(bar) == size
else:
assert module.size_of_instances(bar) >= size
assert module.size_of_instances(foo) == module.size_of_instances(bar)
try:
test_app_subclass_of_c_type()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 142, in <module>
test_app_subclass_of_c_type()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_app_subclass_of_c_type
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________ AppTestSlots.test_app_cant_subclass_two_types _________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf4015064>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_cant_subclass_two_types'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_app_cant_subclass_two_types'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_cant_subclass_two_types'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_app_cant_subclass_two_types'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_cant_subclass_two_types'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_app_cant_subclass_two_types'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_cant_subclass_two_types'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3ff2f54>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._two_types'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf417ff4c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf417ff4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._two_types'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_cant_subclass_two_types'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3ff266c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._two_types'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf417ff0c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf417ff0c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._two_types'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_app_cant_subclass_two_types'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_app_cant_subclass_two_types'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_app_cant_subclass_two_types'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_app_cant_subclass_two_types at 0xf44bd41c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf417fe4c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf417faac>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 138, in <module>
E test_app_cant_subclass_two_types()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 124, in test_app_cant_subclass_two_types
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_app_cant_subclass_two_types():
import sys
if sys.version_info < (2, 7, 9):
skip("crashes on CPython (2.7.5 crashes, 2.7.9 is ok)")
module = self.import_module(name='foo')
try:
class bar(module.fooType, module.UnicodeSubtype):
pass
except TypeError as e:
import sys
if '__pypy__' in sys.builtin_module_names:
assert 'instance layout conflicts in multiple inheritance' in str(e)
else:
assert 'instance lay-out conflict' in str(e)
else:
raise AssertionError("did not get TypeError!")
try:
test_app_cant_subclass_two_types()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 138, in <module>
test_app_cant_subclass_two_types()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 124, in test_app_cant_subclass_two_types
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestSlots.test_getattr_getattro ______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from foo.c:2:
/build_dir/pypy-c-...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf401510c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getattr_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getattr_getattro'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getattr_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getattr_getattro'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getattr_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_getattr_getattro'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getattr_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3ff675c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...r_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf436f0cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf436f0cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...r_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getattr_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3ff60cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...r_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf436fd4c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf436fd4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...r_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_getattr_getattro'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_getattr_getattro'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_getattr_getattro'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_getattr_getattro at 0xf44bd5dc>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf436f7ec>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf436f6cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from foo.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 131, in <module>
E test_getattr_getattro()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_getattr_getattro
E module = self.import_module(name='foo')
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_getattr_getattro():
module = self.import_module(name='foo')
assert module.gettype2.dcba == b'getattro:dcba'
assert (type(module.gettype2).__getattribute__(module.gettype2, 'dcBA')
== b'getattro:dcBA')
assert module.gettype1.abcd == b'getattr:abcd'
# GetType1 objects have a __getattribute__ method, but this
# doesn't call tp_getattr at all, also on CPython
raises(AttributeError, type(module.gettype1).__getattribute__,
module.gettype1, 'dcBA')
try:
test_getattr_getattro()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from foo.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'foo.c', '-o', 'foo.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 131, in <module>
test_getattr_getattro()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_getattr_getattro
module = self.import_module(name='foo')
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_________________________ AppTestSlots.test_dictoffset _________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from source_0.c:6:
/build_dir/py...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fd348c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dictoffset'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dictoffset'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dictoffset'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf2d4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419db4c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419db4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf84c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419d14c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf419d14c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_dictoffset'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_dictoffset'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_dictoffset'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_dictoffset at 0xf44bd7d4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf419d78c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf419de4c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from source_0.c:6:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'source_0.c', '-o', 'source_0.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 175, in <module>
E test_dictoffset()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_dictoffset
E module = self.import_extension("foo", [
E ^^^^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 95, in w_import_extension
E return sys_info.import_extension(
E ^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 96, in import_extension
E return self.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_dictoffset():
module = self.import_extension("foo", [
("negative_dictoffset", "METH_NOARGS",
"""
return PyType_FromSpec(&HeapCTypeWithNegativeDict_spec);
"""),
], prologue="""
#include <structmember.h>
typedef struct {
PyObject_HEAD
PyObject *dict;
} HeapCTypeWithDictObject;
static void
heapctypewithdict_dealloc(HeapCTypeWithDictObject* self)
{
PyTypeObject *tp = Py_TYPE(self);
Py_XDECREF(self->dict);
PyObject_Free(self);
Py_DECREF(tp);
}
static PyGetSetDef heapctypewithdict_getsetlist[] = {
{"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict},
{NULL} /* Sentinel */
};
static struct PyMemberDef heapctypewithnegativedict_members[] = {
{"dictobj", T_OBJECT, offsetof(HeapCTypeWithDictObject, dict)},
{"__dictoffset__", T_PYSSIZET, -(Py_ssize_t)sizeof(void*), READONLY},
{NULL} /* Sentinel */
};
static PyType_Slot HeapCTypeWithNegativeDict_slots[] = {
{Py_tp_members, heapctypewithnegativedict_members},
{Py_tp_getset, heapctypewithdict_getsetlist},
{Py_tp_dealloc, heapctypewithdict_dealloc},
{0, 0},
};
static PyType_Spec HeapCTypeWithNegativeDict_spec = {
"_testcapi.HeapCTypeWithNegativeDict",
sizeof(HeapCTypeWithDictObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
HeapCTypeWithNegativeDict_slots
};
""")
inst = module.negative_dictoffset()()
inst.foo = 42
assert inst.dictobj == inst.__dict__
assert inst.dictobj == {"foo": 42}
try:
test_dictoffset()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from source_0.c:6:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'source_0.c', '-o', 'source_0.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 175, in <module>
test_dictoffset()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_dictoffset
module = self.import_extension("foo", [
^^^^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 95, in w_import_extension
return sys_info.import_extension(
^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 96, in import_extension
return self.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______________________ AppTestSlots.test_heaptype_dealloc ______________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from nanobind1.c:2:
/build_dir/p...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fd3374>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_heaptype_dealloc'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_heaptype_dealloc'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_heaptype_dealloc'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf6e4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...pe_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41232ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41232ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...pe_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbfd4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...pe_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf412308c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf412308c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...pe_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_dealloc'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_heaptype_dealloc'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_heaptype_dealloc'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_heaptype_dealloc at 0xf44bd8b4>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf41235cc>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf4123e2c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from nanobind1.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind1.c', '-o', 'nanobind1.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
E test_heaptype_dealloc()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_heaptype_dealloc
E module = self.import_module(name='nanobind1', filename="nanobind1")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_heaptype_dealloc():
# Taken from https://github.com/wjakob/pypy_issues at commit 03890103
import gc
module = self.import_module(name='nanobind1', filename="nanobind1")
for i in range(100):
module.heap_type()
gc.collect()
try:
test_heaptype_dealloc()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from nanobind1.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind1.c', '-o', 'nanobind1.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 128, in <module>
test_heaptype_dealloc()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_heaptype_dealloc
module = self.import_module(name='nanobind1', filename="nanobind1")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_____________________ AppTestSlots.test_heaptype_metaclass _____________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from nanobind1.c:2:
/build_dir/p...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fa8f7c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_heaptype_metaclass'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_heaptype_metaclass'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_heaptype_metaclass'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf144>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41f530c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41f530c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf2d4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41f564c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41f564c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_heaptype_metaclass'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_heaptype_metaclass'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_heaptype_metaclass'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_heaptype_metaclass at 0xf44bd8ec>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf41f59cc>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf41f5b2c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from nanobind1.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind1.c', '-o', 'nanobind1.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 132, in <module>
E test_heaptype_metaclass()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_heaptype_metaclass
E module = self.import_module(name='nanobind1', filename="nanobind1")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_heaptype_metaclass():
# Taken from https://github.com/wjakob/pypy_issues at commit 03890103
# Fixed so both cases pass in 769acaa69cfe, issue 4013_
module = self.import_module(name='nanobind1', filename="nanobind1")
# 2 vs 3 shenanigans to declare
# class X(object, metaclass=module.metaclass): pass
X = module.metaclass_good('X', (object,), {})
x = X()
X = module.metaclass_bad('X', (object,), {})
x = X()
try:
test_heaptype_metaclass()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from nanobind1.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind1.c', '-o', 'nanobind1.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 132, in <module>
test_heaptype_metaclass()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_heaptype_metaclass
module = self.import_module(name='nanobind1', filename="nanobind1")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________________ AppTestSlots.test_vectorcall2 _________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from nanobind1.c:2:
/build_dir/p...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fd348c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_vectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_vectorcall2'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_vectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_vectorcall2'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_vectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_vectorcall2'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_vectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf824>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf447be6c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf447be6c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_vectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf784>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf447b92c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf447b92c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_vectorcall2'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_vectorcall2'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_vectorcall2'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_vectorcall2 at 0xf44bd924>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf419d52c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf447b0ec>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from nanobind1.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind1.c', '-o', 'nanobind1.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 132, in <module>
E test_vectorcall2()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_vectorcall2
E module = self.import_module(name='nanobind1', filename="nanobind1")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_vectorcall2():
# Taken from https://github.com/wjakob/pypy_issues at commit 03890103
# py3.9+ only
module = self.import_module(name='nanobind1', filename="nanobind1")
c = module.callable()
assert c() == 1234
def f(value):
assert value == 1234
module.call(f)
try:
test_vectorcall2()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from nanobind1.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind1.c', '-o', 'nanobind1.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 132, in <module>
test_vectorcall2()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_vectorcall2
module = self.import_module(name='nanobind1', filename="nanobind1")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________ AppTestSlots.test_nanobind2_module_attributes _________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from nanobind2.c:2:
/build_dir/p...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fd21b4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_module_attributes'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind2_module_attributes'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_module_attributes'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind2_module_attributes'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_module_attributes'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind2_module_attributes'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_module_attributes'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf20c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...attributes'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41ea7cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41ea7cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...attributes'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_module_attributes'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fbf93c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...attributes'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41eacec>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41eacec>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...attributes'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_module_attributes'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_nanobind2_module_attributes'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_nanobind2_module_attributes'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_nanobind2_module_attributes at 0xf44bd994>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf41eab0c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf41ea4cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from nanobind2.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind2.c', '-o', 'nanobind2.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 133, in <module>
E test_nanobind2_module_attributes()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_nanobind2_module_attributes
E module = self.import_module(name='nanobind2', filename="nanobind2")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_nanobind2_module_attributes():
# Taken from https://github.com/wjakob/pypy_issues at commit 89a8585
import sys
module = self.import_module(name='nanobind2', filename="nanobind2")
f = module.func()
if sys.version_info >= (3, 9) or sys.implementation.name == 'pypy':
assert f.__module__ == "my_module"
else:
assert f.__module__ == "nanobind2"
assert f.__name__ == "my_name"
assert f.__qualname__ == "my_qualname"
try:
test_nanobind2_module_attributes()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from nanobind2.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind2.c', '-o', 'nanobind2.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 133, in <module>
test_nanobind2_module_attributes()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 123, in test_nanobind2_module_attributes
module = self.import_module(name='nanobind2', filename="nanobind2")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
________________ AppTestSlots.test_nanobind2_vectorcall_method _________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from nanobind2.c:2:
/build_dir/p...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fd348c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>, ...ticall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fafe14>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...all_method'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a48ac>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a48ac>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...all_method'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fafb94>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...all_method'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a4a2c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf43a4a2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...all_method'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind2_vectorcall_method'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_nanobind2_vectorcall_method'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_nanobind2_vectorcall_method'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_nanobind2_vectorcall_method at 0xf44bd9cc>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf43a444c>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf414c1cc>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from nanobind2.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind2.c', '-o', 'nanobind2.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 155, in <module>
E test_nanobind2_vectorcall_method()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_nanobind2_vectorcall_method
E module = self.import_module(name='nanobind2', filename="nanobind2")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_nanobind2_vectorcall_method():
# Taken from https://github.com/wjakob/pypy_issues at commit 89a8585
module = self.import_module(name='nanobind2', filename="nanobind2")
class A:
def __init__(self):
self.value = 0
def my_method(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
return "success"
a = A()
assert module.method_call(a) == "success"
assert a.args == (1234,) and a.kwargs == {}
assert module.method_call_kw(a) == "success"
assert a.args == (1234,) and a.kwargs == {"foo" : "bar"}
def unbound_method(*args, **kwargs):
args_value.update(args)
kwargs_value.update(kwargs)
return "unbound"
a.my_method = unbound_method
kwargs_value = {}
args_value = set()
assert module.method_call(a) == "unbound"
assert args_value == set([1234]) and kwargs_value == {}
assert module.method_call_kw(a) == "unbound"
assert args_value == set([1234]) and kwargs_value == {"foo" : "bar"}
try:
test_nanobind2_vectorcall_method()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from nanobind2.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind2.c', '-o', 'nanobind2.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 155, in <module>
test_nanobind2_vectorcall_method()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 122, in test_nanobind2_vectorcall_method
module = self.import_module(name='nanobind2', filename="nanobind2")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
_________________________ AppTestSlots.test_nanobind3 __________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from nanobind3.c:2:
/build_dir/p...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fd21b4>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind3'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind3'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_nanobind3'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3faf66c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf415626c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf415626c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fafeb4>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4156a2c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4156a2c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i..._nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_nanobind3'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_nanobind3'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_nanobind3'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_nanobind3 at 0xf44bda04>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf41568ac>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf415644c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from nanobind3.c:2:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind3.c', '-o', 'nanobind3.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 138, in <module>
E test_nanobind3()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_nanobind3
E module = self.import_module(name='nanobind3', filename="nanobind3")
E ^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
E return sys_info.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_nanobind3():
module = self.import_module(name='nanobind3', filename="nanobind3")
old_list = module.global_list[:]
o = module.my_object()
c = module.my_callable()
with raises(ValueError):
c(o)
old_list = module.global_list[:]
del o
self.debug_collect() # will call gc.collect unless run untranslated
# Make sure o.tp_dealloc was called
new_list = module.global_list[:]
assert len(new_list) == len(old_list) + 1, "%s %s" %(old_list, new_list)
try:
test_nanobind3()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from nanobind3.c:2:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'nanobind3.c', '-o', 'nanobind3.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 138, in <module>
test_nanobind3()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 121, in test_nanobind3
module = self.import_module(name='nanobind3', filename="nanobind3")
^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 105, in w_import_module
return sys_info.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
______ AppTestSlots.test_multiple_inheritance_ctypes_with_weakref_or_dict ______
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
In file included from source_0.c:6:
/build_dir/py...)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
>
func = <function <lambda> at 0xf3fb0e2c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance_ctypes_wit...l 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_multiple_inheritance_ctypes_with_weakref_or_dict'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a7398c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance_ctypes_wit...l 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_multiple_inheritance_ctypes_with_weakref_or_dict'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance_ctypes_wit...l 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_multiple_inheritance_ctypes_with_weakref_or_dict'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance_ctypes_with_weakref_or_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fa94dc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ef_or_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40f152c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40f152c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ef_or_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance_ctypes_with_weakref_or_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf3fa9c84>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ef_or_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40f11cc>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40f11cc>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ef_or_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_multiple_inheritance_ctypes_with_weakref_or_dict'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_multiple_inheritance_ctypes_with_weakref_or_dict'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_multiple_inheritance_ctypes_with_weakref_or_dict'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_multiple_inheritance_ctypes_with_weakref_or_dict at 0xf44bdc6c>
usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...]
definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0xf40d956c>, 'compile_module': <bound method App....AppTestSlots object at 0xf40f11ec>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test', ...}
defs = ['def w_compile_module(self, name,\n source_files=None, source_strings=None):\n from extbuild import get_sys...e=prologue,\n include_dirs=include_dirs, more_init=more_init,\n PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)', ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-723'
code = <py._code.code.Code object at 0xf40f136c>
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E In file included from source_0.c:6:
E /build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
E 57 | #include "pypy_structmember_decl.h"
E | ^~~~~~~~~~~~~~~~~~~~~~~~~~
E compilation terminated.
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
E subprocess.check_call(cmd, env=_inject_macos_ver(env))
E ^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
E raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'source_0.c', '-o', 'source_0.o']' returned non-zero exit status 1.
E
E The above exception was the direct cause of the following exception:
E
E Traceback (most recent call last):
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
E self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
E ^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
E spawn(cmd, **kwargs)
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
E raise DistutilsExecError(
E distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
E
E During handling of the above exception, another exception occurred:
E
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 252, in <module>
E test_multiple_inheritance_ctypes_with_weakref_or_dict()
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 125, in test_multiple_inheritance_ctypes_with_weakref_or_dict
E module = self.import_extension('foo_heapctype', [],
E ^^^^^^^^^^^^^^^^
E File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 95, in w_import_extension
E return sys_info.import_extension(
E ^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 96, in import_extension
E return self.import_module(
E ^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
E mod = self.compile_extension_module(
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
E soname = c_compile(source_files, outputfilename=str(dirname / modname),
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
E _build(
E File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
E res = compiler.compile([cfile.basename],
E ^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
E self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
E ^^^^^^^^
E File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
E raise CompileError(msg)
E distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', 'binascii', 'mmap', '_signal', '_cffi_backend']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def w_compile_module(self, name,
source_files=None, source_strings=None):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.compile_extension_module(name,
source_files=source_files, source_strings=source_strings)
type(self).compile_module = w_compile_module
def w_debug_collect(self):
import gc
gc.collect()
gc.collect()
gc.collect()
type(self).debug_collect = w_debug_collect
self.here = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/module/cpyext/test'
def w_import_extension(self, modname, functions, prologue="",
include_dirs=None, more_init="", PY_SSIZE_T_CLEAN=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_extension(
modname, functions, prologue=prologue,
include_dirs=include_dirs, more_init=more_init,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_extension = w_import_extension
def w_import_module(self, name, init=None, body='', filename=None,
include_dirs=None, PY_SSIZE_T_CLEAN=False, use_imp=False):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.import_module(
name, init=init, body=body, filename=filename,
include_dirs=include_dirs,
PY_SSIZE_T_CLEAN=PY_SSIZE_T_CLEAN)
type(self).import_module = w_import_module
def w_load_module(self, mod, name):
from extbuild import get_sys_info_app
sys_info = get_sys_info_app(self.udir)
return sys_info.load_module(mod, name)
type(self).load_module = w_load_module
self.runappdirect = True
self.udir = '/build_dir/tmp/pytest/usession-py3.12-723'
def test_multiple_inheritance_ctypes_with_weakref_or_dict():
# taken from test_capi test_multiple_inheritance_ctypes_with_weakref_or_dict:
# types created via PyType_FromSpec that carry tp_dictoffset or
# tp_weaklistoffset should be combinable in multiple inheritance
# without raising "instance layout conflicts".
module = self.import_extension('foo_heapctype', [],
prologue="""
#include <structmember.h>
typedef struct {
PyObject_HEAD
PyObject *dict;
} HeapCTypeWithDictObject;
static void
heapctypewithdict_dealloc(HeapCTypeWithDictObject* self)
{
PyTypeObject *tp = Py_TYPE(self);
Py_XDECREF(self->dict);
PyObject_Free(self);
Py_DECREF(tp);
}
static PyGetSetDef heapctypewithdict_getsetlist[] = {
{"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict},
{NULL}
};
static struct PyMemberDef heapctypewithdict_members[] = {
{"dictobj", T_OBJECT, offsetof(HeapCTypeWithDictObject, dict)},
{"__dictoffset__", T_PYSSIZET,
offsetof(HeapCTypeWithDictObject, dict), READONLY},
{NULL}
};
static PyType_Slot HeapCTypeWithDict_slots[] = {
{Py_tp_members, heapctypewithdict_members},
{Py_tp_getset, heapctypewithdict_getsetlist},
{Py_tp_dealloc, heapctypewithdict_dealloc},
{0, 0},
};
static PyType_Spec HeapCTypeWithDict_spec = {
"foo_heapctype.HeapCTypeWithDict",
sizeof(HeapCTypeWithDictObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
HeapCTypeWithDict_slots
};
static PyType_Spec HeapCTypeWithDict2_spec = {
"foo_heapctype.HeapCTypeWithDict2",
sizeof(HeapCTypeWithDictObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
HeapCTypeWithDict_slots
};
typedef struct {
PyObject_HEAD
PyObject *weakreflist;
} HeapCTypeWithWeakrefObject;
static struct PyMemberDef heapctypewithweakref_members[] = {
{"weakreflist", T_OBJECT,
offsetof(HeapCTypeWithWeakrefObject, weakreflist)},
{"__weaklistoffset__", T_PYSSIZET,
offsetof(HeapCTypeWithWeakrefObject, weakreflist), READONLY},
{NULL}
};
static void
heapctypewithweakref_dealloc(HeapCTypeWithWeakrefObject* self)
{
PyTypeObject *tp = Py_TYPE(self);
if (self->weakreflist != NULL)
PyObject_ClearWeakRefs((PyObject *) self);
Py_XDECREF(self->weakreflist);
PyObject_Free(self);
Py_DECREF(tp);
}
static PyType_Slot HeapCTypeWithWeakref_slots[] = {
{Py_tp_members, heapctypewithweakref_members},
{Py_tp_dealloc, heapctypewithweakref_dealloc},
{0, 0},
};
static PyType_Spec HeapCTypeWithWeakref_spec = {
"foo_heapctype.HeapCTypeWithWeakref",
sizeof(HeapCTypeWithWeakrefObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
HeapCTypeWithWeakref_slots
};
static PyType_Spec HeapCTypeWithWeakref2_spec = {
"foo_heapctype.HeapCTypeWithWeakref2",
sizeof(HeapCTypeWithWeakrefObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
HeapCTypeWithWeakref_slots
};
""",
more_init="""
PyObject *t;
#define ADD_TYPE(spec, name) \\
t = PyType_FromSpec(spec); \\
if (t == NULL) INITERROR; \\
PyModule_AddObject(mod, name, t);
ADD_TYPE(&HeapCTypeWithDict_spec, "HeapCTypeWithDict");
ADD_TYPE(&HeapCTypeWithDict2_spec, "HeapCTypeWithDict2");
ADD_TYPE(&HeapCTypeWithWeakref_spec, "HeapCTypeWithWeakref");
ADD_TYPE(&HeapCTypeWithWeakref2_spec, "HeapCTypeWithWeakref2");
#undef ADD_TYPE
""")
class Both1(module.HeapCTypeWithWeakref, module.HeapCTypeWithDict):
pass
class Both2(module.HeapCTypeWithDict, module.HeapCTypeWithWeakref):
pass
for cls in (module.HeapCTypeWithDict, module.HeapCTypeWithDict2,
module.HeapCTypeWithWeakref, module.HeapCTypeWithWeakref2):
for cls2 in (module.HeapCTypeWithDict, module.HeapCTypeWithDict2,
module.HeapCTypeWithWeakref, module.HeapCTypeWithWeakref2):
if cls is not cls2:
class S(cls, cls2):
pass
class B1(Both1, cls):
pass
class B2(Both2, cls):
pass
try:
test_multiple_inheritance_ctypes_with_weakref_or_dict()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-723/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
In file included from source_0.c:6:
/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12/structmember.h:57:10: fatal error: pypy_structmember_decl.h: No such file or directory
57 | #include "pypy_structmember_decl.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 83, in spawn
subprocess.check_call(cmd, env=_inject_macos_ver(env))
^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/rh/devtoolset-10/root/usr/bin/gcc', '-pthread', '-DNDEBUG', '-O2', '-fPIC', '-O0', '-g', '-Werror=implicit-function-declaration', '-fPIC', '-I/build_dir/pypy-c-jit-linux-x86-32/build/include/pypy3.12', '-c', 'source_0.c', '-o', 'source_0.o']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 221, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 1152, in spawn
spawn(cmd, **kwargs)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/spawn.py", line 89, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 252, in <module>
test_multiple_inheritance_ctypes_with_weakref_or_dict()
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 125, in test_multiple_inheritance_ctypes_with_weakref_or_dict
module = self.import_extension('foo_heapctype', [],
^^^^^^^^^^^^^^^^
File "/build_dir/tmp/pytest/usession-py3.12-723/src.py", line 95, in w_import_extension
return sys_info.import_extension(
^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 96, in import_extension
return self.import_module(
^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module
mod = self.compile_extension_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 50, in compile_extension_module
soname = c_compile(source_files, outputfilename=str(dirname / modname),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile
_build(
File "/build_dir/pypy-c-jit-linux-x86-32/build/pypy/tool/cpyext/extbuild.py", line 233, in _build
res = compiler.compile([cfile.basename],
^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/base.py", line 649, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib/pypy3.12/site-packages/setuptools/_distutils/compilers/C/unix.py", line 223, in _compile
raise CompileError(msg)
distutils.compilers.C.errors.CompileError: command '/opt/rh/devtoolset-10/root/usr/bin/gcc' failed with exit code 1
=========================== short test summary info ============================
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_basic
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_iter
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_index
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_slice_get
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_slice_object
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_buffer
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_releasebuffer
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_Py_buffer
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_0d_view
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_binop_mul_impl
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_string_buf
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_subclass
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_unicode_readbuffer
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_readinto
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_iowrite
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_getitem_via_PySequence_GetItem
FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_subclass_with_attribute
FAIL module/cpyext/test/test_cpyext.py::AppTestCpythonExtension::()::test_createmodule
FAIL module/cpyext/test/test_cpyext.py::AppTestCpythonExtension::()::test_load_dynamic
FAIL module/cpyext/test/test_frameobject.py::AppTestFrameObject::()::test_forge_frame
FAIL module/cpyext/test/test_methodobject.py::AppTestMethodObject::()::test_wrapper
FAIL module/cpyext/test/test_methodobject.py::AppTestMethodObject::()::test_module_name
FAIL module/cpyext/test/test_methodobject.py::AppTestMethodObject::()::test_min_max
FAIL module/cpyext/test/test_pystate.py::AppTestThreads::()::test_thread_interrupt
FAIL module/cpyext/test/test_tupleobject.py::AppTestTuple::()::test_tuple_subclass
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_typeobject
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_typeobject_method_descriptor
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_typeobject_data_member
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_typeobject_object_member
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_typeobject_string_member
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_typeobject_int_member
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_int_member_index_protocol
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_overflow
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_staticmethod
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_classmethod
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_class_getitem
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_methoddescr
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_cython_fake_classmethod
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_new
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_multiple_inheritance1
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_init
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_metatype
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_metaclass_compatible
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_init_error
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_hash_inheritance
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_descriptor
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_tp_dict
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_custom_allocation
FAIL module/cpyext/test/test_typeobject.py::AppTestTypeObject::()::test_type_dict
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_app_subclass_of_c_type
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_app_cant_subclass_two_types
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_getattr_getattro
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_dictoffset
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_heaptype_dealloc
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_heaptype_metaclass
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_vectorcall2
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_nanobind2_module_attributes
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_nanobind2_vectorcall_method
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_nanobind3
FAIL module/cpyext/test/test_typeobject.py::AppTestSlots::()::test_multiple_inheritance_ctypes_with_weakref_or_dict
=== 60 failed, 368 passed, 15 skipped, 2 xfailed, 1 error in 654.92 seconds ====
++ 05:28:25 starting module/crypt/test [47 started in total]
__ module/crypt/test [47 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 1 items
module/crypt/test/test_crypt.py s
========================== 1 skipped in 0.14 seconds ===========================
++ 05:28:30 starting module/errno/test [48 started in total]
__ module/errno/test [48 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 3 items
module/errno/test/test_errno.py ...
=========================== 3 passed in 0.29 seconds ===========================
++ 05:28:35 starting module/exceptions/test [49 started in total]
__ module/exceptions/test [49 done in total, somefailed=False] ________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 48 items
module/exceptions/test/test_exc.py ................................................
========================== 48 passed in 2.87 seconds ===========================
++ 05:28:43 starting module/faulthandler/test [50 started in total]
__ module/faulthandler/test [50 done in total, somefailed=False] ______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 2 items
module/faulthandler/test/test_faulthander.py ..
=========================== 2 passed in 0.20 seconds ===========================
++ 05:28:49 starting module/fcntl/test [51 started in total]
__ module/fcntl/test [51 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 8 items
module/fcntl/test/test_fcntl.py ........
=========================== 8 passed in 1.28 seconds ===========================
++ 05:28:56 starting module/gc/test [52 started in total]
__ module/gc/test [52 done in total, somefailed=False] ________________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 24 items
module/gc/test/test_gc.py sssssx..
module/gc/test/test_hook.py ssssssss
module/gc/test/test_referents.py ........
=============== 10 passed, 13 skipped, 1 xfailed in 1.65 seconds ===============
++ 05:29:02 starting module/imp/test [53 started in total]
__ module/imp/test [53 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 99 items
module/imp/test/test_app.py ................
module/imp/test/test_import.py ..........................s....................................................ssss
===================== 94 passed, 5 skipped in 9.91 seconds =====================
++ 05:29:17 starting module/itertools/test [54 started in total]
__ module/itertools/test [54 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 87 items
module/itertools/test/test_itertools.py .......................................................................................
========================== 87 passed in 6.92 seconds ===========================
++ 05:29:29 starting module/marshal/test [55 started in total]
__ module/marshal/test [55 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 1.52 seconds =========================
++ 05:29:36 starting module/math/test [56 started in total]
__ module/math/test [56 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 31 items
module/math/test/test_math.py ...............................
========================== 31 passed in 2.10 seconds ===========================
++ 05:29:43 starting module/micronumpy/test [57 started in total]
__ module/micronumpy/test [57 done in total, somefailed=False] ________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.02 seconds =========================
++ 05:29:47 starting module/mmap/test [58 started in total]
__ module/mmap/test [58 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 46 items
module/mmap/test/test_mmap.py ..............................................
========================== 46 passed in 3.05 seconds ===========================
++ 05:29:56 starting module/operator/test [59 started in total]
__ module/operator/test [59 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 24 items
module/operator/test/test_operator.py ........................
========================== 24 passed in 2.75 seconds ===========================
++ 05:30:04 starting module/posix/test [60 started in total]
__ module/posix/test [60 done in total, somefailed=True] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 170 items / 2 skipped
module/posix/test/test_posix2.py ...............................................................................................................Fs..ss.....................ssss.......s
module/posix/test/test_scandir.py ....................
=================================== FAILURES ===================================
_______________________ AppTestPosix.test_urandom_large ________________________
self = <CallInfo when='call' exception: Subprocess failed with exit code 1:
Traceback (most recent call last):
File "/build...session-py3.12-759/src.py", line 144, in test_urandom_large
s = os.urandom(length)
^^^^^^^
MemoryError
>
func = <function <lambda> at 0xf583779c>, when = 'call'
def __init__(self, func, when):
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
self.when = when
self.start = time()
try:
> self.result = func()
../_pytest/runner.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> return CallInfo(lambda: ihook(item=item, **kwds), when=when)
../_pytest/runner.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_urandom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_urandom_large'>}
def __call__(self, **kwargs):
assert not self.is_historic()
> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
../_pytest/vendored_packages/pluggy.py:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0xf7a1f98c>
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_urandom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_urandom_large'>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
../_pytest/vendored_packages/pluggy.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>, methods = []
kwargs = {'__multicall__': <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_urandom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_urandom_large'>}
self._inner_hookexec = lambda hook, methods, kwargs: \
> _MultiCall(methods, kwargs, hook.spec_opts).execute()
../_pytest/vendored_packages/pluggy.py:333:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_urandom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf5898d9c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ndom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf576e90c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf576e90c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ndom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_urandom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
> return _wrapped_call(hook_impl.function(*args), self.execute)
../_pytest/vendored_packages/pluggy.py:595:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
wrap_controller = <generator object pytest_runtest_call at 0xf583ce64>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ndom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def _wrapped_call(wrap_controller, func):
""" Wrap calling to a function with a generator which needs to yield
exactly once. The yield point will trigger calling the wrapped function
and return its _CallOutcome to the yield point. The generator then needs
to finish (raise StopIteration) in order for the wrapped call to complete.
"""
try:
next(wrap_controller) # first yield
except StopIteration:
_raise_wrapfail(wrap_controller, "did not yield")
call_outcome = _CallOutcome(func)
try:
wrap_controller.send(call_outcome)
_raise_wrapfail(wrap_controller, "has second yield")
except StopIteration:
pass
> return call_outcome.get_result()
../_pytest/vendored_packages/pluggy.py:253:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf576eb4c>
def get_result(self):
if self.excinfo is None:
return self.result
else:
ex = self.excinfo
if _py3:
raise ex[1].with_traceback(ex[2])
> _reraise(*ex) # noqa
../_pytest/vendored_packages/pluggy.py:279:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf576eb4c>
func = <bound method _MultiCall.execute of <_MultiCall 0 results, 0 meths, kwargs={'i...ndom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>>
def __init__(self, func):
try:
> self.result = func()
../_pytest/vendored_packages/pluggy.py:264:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_MultiCall 0 results, 0 meths, kwargs={'item': <AppTestMethod 'test_urandom_large'>, '__multicall__': <_MultiCall 0 results, 0 meths, kwargs={...}>}>
def execute(self):
all_kwargs = self.kwargs
self.results = results = []
firstresult = self.specopts.get("firstresult")
while self.hook_impls:
hook_impl = self.hook_impls.pop()
args = [all_kwargs[argname] for argname in hook_impl.argnames]
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
> res = hook_impl.function(*args)
../_pytest/vendored_packages/pluggy.py:596:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <AppTestMethod 'test_urandom_large'>
def pytest_runtest_call(item):
try:
> item.runtest()
../_pytest/runner.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AppTestMethod 'test_urandom_large'>
def runtest(self):
target = self.obj
src = extract_docstring_if_empty_function(target.im_func)
space = target.im_self.space
if self.config.option.runappdirect:
appexec_definitions = self.parent.obj.__dict__
spaceconfig = getattr(self.parent.obj, 'spaceconfig', None)
usemodules = spaceconfig.get('usemodules') if spaceconfig else None
return run_with_python(self.config.option.python, src, usemodules,
> **appexec_definitions)
tool/pytest/apptest.py:327:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
python_ = '/build_dir/pypy-c-jit-linux-x86-32/build/pypy/goal/pypy3.12-c'
target_ = <function test_urandom_large at 0xf599a95c>
usemodules = ['binascii', 'posix', '_signal', '_struct', 'time', '_socket', ...]
definitions = {'Path': (<py._code.source.Source object at 0xf58432cc>, []), 'SIGABRT': 6, 'bytes_dir': '/build_dir/tmp/pytest/usession-py3.12-759/fi\xc5\x9fier.txt', 'confstr_name': u'CS_XBS5_LP64_OFF64_CFLAGS', ...}
defs = ['def anonymous():\n class Path:\n def __init__(self, _path):\n self._pat...12-759/fi\\xc5\\x9fier.txt'\n", "self.confstr_name = 'CS_XBS5_LP64_OFF64_CFLAGS'\n", "self.confstr_result = ''\n", ...]
symbol = 'udir', value = u'/build_dir/tmp/pytest/usession-py3.12-759'
code = <py._code.source.Source object at 0xf58432ac>, args = '', arg_repr = []
def run_with_python(python_, target_, usemodules, **definitions):
if python_ is None:
py.test.skip("Cannot find the default python3 interpreter to run with -A")
defs = []
for symbol, value in sorted(definitions.items()):
if isinstance(value, tuple) and isinstance(value[0], py.code.Source):
code, args = value
defs.append(str(code))
arg_repr = []
for arg in args:
if isinstance(arg, types.FunctionType):
arg_repr.append(arg.__name__)
elif isinstance(arg, types.MethodType):
arg_repr.append(arg.__name__)
else:
arg_repr.append(py3k_repr(arg))
args = ', '.join(arg_repr)
defs.append("self.%s = anonymous(%s)\n" % (symbol, args))
elif isinstance(value, types.MethodType):
# "def w_method(self)"
code = py.code.Code(value)
defs.append(str(code.source()))
defs.append("type(self).%s = %s\n" % (symbol, value.__name__))
elif isinstance(value, types.ModuleType):
name = value.__name__
defs.append("import %s; self.%s = %s\n" % (name, symbol, name))
elif isinstance(value, (str, unicode, int, long, float, list, tuple,
dict)) or value is None:
defs.append("self.%s = %s\n" % (symbol, py3k_repr(value)))
check_usemodules = ''
if usemodules:
usemodules = [_rename_module(name) for name in usemodules]
check_usemodules = """\
missing = set(%r).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing""" % usemodules
source = list(py.code.Source(target_))
while source[0].startswith(('@py.test.mark.', '@pytest.mark.')):
source.pop(0)
source = source[1:]
pyfile = udir.join('src.py')
if isinstance(target_, str):
# Special case of a docstring; the function name is the first word.
target_name = target_.split('(', 1)[0]
else:
target_name = target_.__name__
with pyfile.open('w') as f:
f.write(helpers % (pypyroot, check_usemodules))
f.write('\n'.join(defs))
f.write('def %s():\n' % target_name)
f.write('\n'.join(source))
f.write("\ntry:\n %s()\n" % target_name)
f.write('finally:\n print("===aefwuiheawiu===")')
helper_dir = os.path.join(pypydir, 'tool', 'cpyext')
env = os.environ.copy()
env['PYTHONPATH'] = helper_dir
res, stdout, stderr = run_subprocess(
python_, [str(pyfile)], env=env)
print pyfile.read()
print "from", str(pyfile)
print >> sys.stdout, stdout
print >> sys.stderr, stderr
if res == 81:
py.test.skip('%r was not compiled w/ required usemodules: %r' %
(python_, usemodules))
elif res != 0:
raise AssertionError(
> "Subprocess failed with exit code %s:\n%s" % (res, stderr))
E AssertionError: Subprocess failed with exit code 1:
E Traceback (most recent call last):
E File "/build_dir/tmp/pytest/usession-py3.12-759/src.py", line 147, in <module>
E test_urandom_large()
E File "/build_dir/tmp/pytest/usession-py3.12-759/src.py", line 144, in test_urandom_large
E s = os.urandom(length)
E ^^^^^^^
E MemoryError
tool/pytest/apptest.py:239: AssertionError
----------------------------- Captured stdout call -----------------------------
# -*- encoding: utf-8 -*-
if 1:
import sys
sys.path.append('/build_dir/pypy-c-jit-linux-x86-32/build')
missing = set(['binascii', 'posix', '_signal', '_struct', 'time', '_socket', '_posixsubprocess', 'select']).difference(sys.builtin_module_names)
if missing:
if not hasattr(sys, 'pypy_version_info'):
# They may be extension modules on CPython
name = None
for name in missing.copy():
if name in ['cpyext', '_cffi_backend', '_rawffi']:
missing.remove(name)
continue
try:
__import__(name)
except ImportError:
pass
else:
missing.remove(name)
del name
if missing:
sys.exit(81)
del missing
def skip(message):
print(message)
raise SystemExit(0)
__builtins__.skip = skip
__builtins__.py3k_skip = skip
class ExceptionWrapper:
pass
def raises(exc, *args, **kwargs):
if not args:
return RaisesContext(exc)
func = args[0]
args = args[1:]
import os
try:
if isinstance(func, str):
if func.startswith((' ', os.linesep, '\n')):
# it's probably an indented block, so we prefix if True:
# to avoid SyntaxError
func = "if True:\n" + func
frame = sys._getframe(1)
exec(func, frame.f_globals, frame.f_locals)
else:
func(*args, **kwargs)
except exc as e:
res = ExceptionWrapper()
res.value = e
res.traceback = e.__traceback__
return res
else:
raise AssertionError("DID NOT RAISE")
class RaisesContext(object):
def __init__(self, expected_exception):
self.expected_exception = expected_exception
self.excinfo = None
def __enter__(self):
return self
def __exit__(self, *tp):
__tracebackhide__ = True
if tp[0] is None:
raise AssertionError("DID NOT RAISE")
self.value = tp[1]
return issubclass(tp[0], self.expected_exception)
__builtins__.raises = raises
class Test:
pass
self = Test()
def anonymous():
class Path:
def __init__(self, _path):
self._path =_path
def __fspath__(self):
return self._path
return Path
self.Path = anonymous()
self.SIGABRT = 6
self.bytes_dir = b'/build_dir/tmp/pytest/usession-py3.12-759/fi\xc5\x9fier.txt'
self.confstr_name = 'CS_XBS5_LP64_OFF64_CFLAGS'
self.confstr_result = ''
self.confstr_value = 1108
self.dir_unicode = '/build_dir/tmp/pytest/usession-py3.12-759/dir_extra'
self.env_path = '/python27_virt/bin:/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
self.esurrogate_dir = b'/build_dir/tmp/pytest/usession-py3.12-759/foo\x80'
self.expected_major_12345 = 48
self.expected_minor_12345 = 57
self.geteuid = 1001
self.getgid = 1001
self.getgroups = [1001]
self.getpgid = 381510
self.getsid0 = 10
self.getuid = 1001
self.path = '/build_dir/tmp/pytest/usession-py3.12-759/posixtestfile.txt'
self.path2 = '/build_dir/tmp/pytest/usession-py3.12-759/test_posix2-'
self.path3 = '/build_dir/tmp/pytest/usession-py3.12-759/unlinktestfile.txt'
self.pdir = '/build_dir/tmp/pytest/usession-py3.12-759/posixtestdir'
self.platform = 'linux2'
def anonymous(): import posix as m ; return m
self.posix = anonymous()
self.python = '/python27_virt/bin/python'
self.runappdirect = True
self.sep = '/'
self.sysconf_name = 'SC_REALTIME_SIGNALS'
self.sysconf_result = 200809
self.sysconf_value = 9
self.udir = '/build_dir/tmp/pytest/usession-py3.12-759'
def test_urandom_large():
os = self.posix
length = 2147479553
s = os.urandom(length)
assert len(s) == length
try:
test_urandom_large()
finally:
print("===aefwuiheawiu===")
from /build_dir/tmp/pytest/usession-py3.12-759/src.py
===aefwuiheawiu===
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
File "/build_dir/tmp/pytest/usession-py3.12-759/src.py", line 147, in <module>
test_urandom_large()
File "/build_dir/tmp/pytest/usession-py3.12-759/src.py", line 144, in test_urandom_large
s = os.urandom(length)
^^^^^^^
MemoryError
=========================== short test summary info ============================
FAIL module/posix/test/test_posix2.py::AppTestPosix::()::test_urandom_large
============== 1 failed, 161 passed, 10 skipped in 25.34 seconds ===============
++ 05:30:37 starting module/pwd/test [61 started in total]
__ module/pwd/test [61 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 4 items
module/pwd/test/test_pwd.py ....
=========================== 4 passed in 0.44 seconds ===========================
++ 05:30:42 starting module/pyexpat/test [62 started in total]
__ module/pyexpat/test [62 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 17 items
module/pyexpat/test/test_parser.py .................
========================== 17 passed in 8.26 seconds ===========================
++ 05:30:57 starting module/pypyjit/test [63 started in total]
__ module/pypyjit/test [63 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 15 items
module/pypyjit/test/test_jit_hook.py sssssssss
module/pypyjit/test/test_jit_not_in_trace.py ..
module/pypyjit/test/test_jit_setup.py ....
===================== 6 passed, 9 skipped in 0.69 seconds ======================
++ 05:31:02 starting module/select/test [64 started in total]
__ module/select/test [64 done in total, somefailed=False] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 45 items
module/select/test/test_epoll.py ..........
module/select/test/test_kqueue.py ssssss
module/select/test/test_select.py ............................
module/select/test/test_select_signal.py .
==================== 39 passed, 6 skipped in 16.25 seconds =====================
++ 05:31:26 starting module/signal/test [65 started in total]
__ module/signal/test [65 done in total, somefailed=False] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 25 items
module/signal/test/test_signal.py ......................sss
==================== 22 passed, 3 skipped in 10.46 seconds =====================
++ 05:31:41 starting module/struct/test [66 started in total]
__ module/struct/test [66 done in total, somefailed=False] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 7 items
module/struct/test/test_struct.py .......
=========================== 7 passed in 0.43 seconds ===========================
++ 05:31:45 starting module/sys/test [67 started in total]
__ module/sys/test [67 done in total, somefailed=False] _______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 73 items
module/sys/test/test_sysmodule.py ...................................................................
module/sys/test/test_version.py ......
========================== 73 passed in 4.93 seconds ===========================
++ 05:31:53 starting module/termios/test [68 started in total]
__ module/termios/test [68 done in total, somefailed=False] ___________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 3 items
module/termios/test/test_termios.py ...
=========================== 3 passed in 0.27 seconds ===========================
++ 05:31:58 starting module/test_lib_pypy [69 started in total]
__ module/test_lib_pypy [69 done in total, somefailed=False] __________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 206 items / 7 skipped
module/test_lib_pypy/test_code_module.py ...
module/test_lib_pypy/test_collections.py .....................
module/test_lib_pypy/test_marshal_extra.py .......................................................................................................................................................
module/test_lib_pypy/test_md5_extra.py ssssss
module/test_lib_pypy/test_pickle_extra.py s
module/test_lib_pypy/test_sha_extra.py .....
module/test_lib_pypy/test_site_extra.py .
module/test_lib_pypy/test_structseq.py ...........
module/test_lib_pypy/test_tputil.py .......
==================== 199 passed, 14 skipped in 3.28 seconds ====================
++ 05:32:05 starting module/thread/test [70 started in total]
__ module/thread/test [70 done in total, somefailed=False] ____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 49 items
module/thread/test/test_fork.py ....
module/thread/test/test_import_lock.py ....
module/thread/test/test_local.py ......
module/thread/test/test_lock.py ....................
module/thread/test/test_thread.py ...............
========================== 49 passed in 64.33 seconds ==========================
++ 05:33:18 starting module/time/test [71 started in total]
__ module/time/test [71 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.03 seconds =========================
++ 05:33:21 starting module/token/test [72 started in total]
__ module/token/test [72 done in total, somefailed=False] _____________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.00 seconds =========================
++ 05:33:25 starting module/unicodedata/test [73 started in total]
__ module/unicodedata/test [73 done in total, somefailed=False] _______________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 19 items
module/unicodedata/test/test_unicodedata.py ...................
========================== 19 passed in 1.58 seconds ===========================
++ 05:33:31 starting module/zipimport/test [74 started in total]
__ module/zipimport/test [74 done in total, somefailed=False] _________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 0 items
========================= no tests ran in 0.00 seconds =========================
++ 05:33:34 starting module/zlib/test [75 started in total]
__ module/zlib/test [75 done in total, somefailed=False] ______________________
============================= test session starts ==============================
platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1
hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/pypy-c-jit-linux-x86-32/build/pypy/.hypothesis/examples')
pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-32/build/pytest.pyc
rootdir: /build_dir/pypy-c-jit-linux-x86-32/build, inifile: pytest.ini
plugins: hypothesis-4.42.0
collected 46 items
module/zlib/test/test_zlib.py ..................................s...........
===================== 45 passed, 1 skipped in 2.54 seconds =====================
program finished with exit code 1
elapsedTime=1478.597226