python testrunner/app_level_tests.py in dir /build_dir/pypy-c-jit-linux-x86-64/build (timeout 4000 secs) watching logfiles {'pytestLog': 'pytest-A.log'} argv: ['python', 'testrunner/app_level_tests.py'] environment: AUDITWHEEL_ARCH=x86_64 AUDITWHEEL_PLAT=manylinux2014_x86_64 AUDITWHEEL_POLICY=manylinux2014 DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-10/root HOME=/home/buildslave HOSTNAME=255659ffae49 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/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/usr/local/lib64 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-64/build PYPY_LOCALBASE=/usr/local PYPY_MAKE_PORTABLE=1 PYPY_USESSION_DIR=/tmp/pytest SHELL=/bin/bash SHLVL=2 SSL_CERT_FILE=/opt/_internal/certs.pem TERM=xterm TMPDIR=/tmp/pytest USER=buildslave USE_CURL=1 _=/python27_virt/bin/buildslave 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 ++ 12:19:26 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 15 items interpreter/astcompiler/test/test_compiler.py ..s............ ===================== 14 passed, 1 skipped in 1.24 seconds ===================== ++ 12:19:31 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.24 seconds ========================= ++ 12:19:33 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 8.36 seconds ===================== ++ 12:19:43 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:19:45 starting objspace/std/test [5 started in total] __ objspace/std/test [5 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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........... 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 . ================== 1000 passed, 524 skipped in 34.86 seconds =================== ++ 12:20:22 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 8.44 seconds ========================== ++ 12:20:33 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 7.76 seconds ===================== ++ 12:20:43 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 3 items module/_abc/test/test_abc.py ... =========================== 3 passed in 0.10 seconds =========================== ++ 12:20:45 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 54 items module/_ast/test/test_ast.py ...................................................... ========================== 54 passed in 1.90 seconds =========================== ++ 12:20:48 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 4.06 seconds ==================== ++ 12:20: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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 89 items module/_codecs/test/test_codecs.py ....................sss.................................................................. ===================== 86 passed, 3 skipped in 3.00 seconds ===================== ++ 12:20:58 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:21:00 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 72 items / 2 skipped module/_continuation/test/test_generator.py .... module/_continuation/test/test_greenlet.py ............................ module/_continuation/test/test_stacklet.py ........................................ ===================== 72 passed, 2 skipped in 2.97 seconds ===================== ++ 12:21:04 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.01 seconds ========================= ++ 12:21:06 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 0.83 seconds =========================== ++ 12:21:08 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 1 items module/_demo/test/test_sieve.py s ========================== 1 skipped in 0.04 seconds =========================== ++ 12:21:10 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.01 seconds ========================= ++ 12:21:12 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:21:13 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 5.57 seconds ===================== ++ 12:21:20 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 1 items module/_jitlog/test/test__jitlog.py . =========================== 1 passed in 0.05 seconds =========================== ++ 12:21:22 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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.05 seconds ===================== ++ 12:21: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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 6 items module/_lsprof/test/test_cprofile.py ...... =========================== 6 passed in 1.19 seconds =========================== ++ 12:21:26 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 8 items module/_md5/test/test_md5.py ........ =========================== 8 passed in 0.24 seconds =========================== ++ 12:21:28 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:21:30 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 3 items module/_multibytecodec/test/test_multibtye_codecs.py ... =========================== 3 passed in 0.14 seconds =========================== ++ 12:21:32 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 0.64 seconds ====================== ++ 12:21:34 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:21:36 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:21:38 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:21:39 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.20 seconds ========================= ++ 12:21:41 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 29 items module/_pypyjson/test/test__pypyjson.py ............................. ========================== 29 passed in 1.09 seconds =========================== ++ 12:21:44 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 12 items module/_random/test/test_random.py ............ ========================== 12 passed in 0.50 seconds =========================== ++ 12:21:45 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 2.37 seconds ===================== ++ 12:21:50 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 2.70 seconds ===================== ++ 12:21:54 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.79 seconds ========================= ++ 12:21:57 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 2.88 seconds ===================== ++ 12:22:01 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 5 items module/_vmprof/test/test__vmprof.py ..... =========================== 5 passed in 0.41 seconds =========================== ++ 12:22:03 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:22:04 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:22:06 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items / 1 skipped ========================== 1 skipped in 0.01 seconds =========================== ++ 12:22:08 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 60 items module/array/test/test_array.py ............................................................ ========================== 60 passed in 1.88 seconds =========================== ++ 12:22:11 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:22:13 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 18 items module/binascii/test/test_binascii.py .................. ========================== 18 passed in 0.62 seconds =========================== ++ 12:22:16 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 1.52 seconds ========================== ++ 12:22:19 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 16 items module/cmath/test/test_cmath.py ................ ========================== 16 passed in 0.48 seconds =========================== ++ 12:22: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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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....... 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 0x7ff1915915d0>, 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 0x7ff197173f50> 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 0x7ff1913e45f0> 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 0x7ff1913e4640> 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 0x7ff1913e4640> 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 0x7ff1913e4af0> 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 0x7ff1913e4870> 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 0x7ff1913e4870> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_basic at 0x7ff19206ead0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff191595610>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19703b850> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 138, in <module> E test_basic() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_basic E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 138, in <module> test_basic() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_basic module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1913e3e50>, 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 0x7ff197173f50> 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 0x7ff19134b410> 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 0x7ff19134b500> 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 0x7ff19134b500> 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 0x7ff19134b460> 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 0x7ff19134b5a0> 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 0x7ff19134b5a0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_iter at 0x7ff19206eb50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff1915aa710>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1915aa810> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> E test_iter() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_iter E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> test_iter() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_iter module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19161b050>, 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 0x7ff197173f50> 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 0x7ff191400dc0> 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 0x7ff191400aa0> 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 0x7ff191400aa0> 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 0x7ff1914000a0> 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 0x7ff191400c30> 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 0x7ff191400c30> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_index at 0x7ff19206ebd0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff1915aae10>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1916eff10> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> E test_index() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_index E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> test_index() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_index module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915919d0>, 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 0x7ff197173f50> 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 0x7ff191732870> 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 0x7ff191732960> 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 0x7ff191732960> 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 0x7ff191732a00> 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 0x7ff191732af0> 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 0x7ff191732af0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_slice_get at 0x7ff19206ec50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff19174cd50>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19174c7d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> E test_slice_get() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_slice_get E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> test_slice_get() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_slice_get module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19161b0d0>, 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 0x7ff197173f50> 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 0x7ff19149c230> 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 0x7ff19149c410> 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 0x7ff19149c410> 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 0x7ff19149c820> 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 0x7ff19149c870> 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 0x7ff19149c870> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_slice_object at 0x7ff19206ecd0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff1916efa10>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1916efad0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> E test_slice_object() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_slice_object E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> test_slice_object() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_slice_object module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915916d0>, 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 0x7ff197173f50> 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 0x7ff19134bb90> 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 0x7ff191732730> 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 0x7ff191732730> 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 0x7ff191732960> 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 0x7ff1917327d0> 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 0x7ff1917327d0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_buffer at 0x7ff19206ed50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff191717d90>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1917178d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 135, in <module> E test_buffer() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_buffer E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 135, in <module> test_buffer() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_buffer module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19161b2d0>, 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 0x7ff197173f50> 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 0x7ff1914e25f0> 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 0x7ff1914e26e0> 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 0x7ff1914e26e0> 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 0x7ff1914e2780> 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 0x7ff1914e2870> 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 0x7ff1914e2870> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_releasebuffer at 0x7ff19206edd0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff1915ecfd0>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1915ecb50> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 127, in <module> E test_releasebuffer() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_releasebuffer E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 127, in <module> test_releasebuffer() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_releasebuffer module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915915d0>, 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 0x7ff197173f50> 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 0x7ff191729280> 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 0x7ff191729c30> 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 0x7ff191729c30> 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 0x7ff191729cd0> 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 0x7ff1917294b0> 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 0x7ff1917294b0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_Py_buffer at 0x7ff19206ee50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff191717910>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191717810> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> E test_Py_buffer() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_Py_buffer E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> test_Py_buffer() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_Py_buffer module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915bd450>, 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 0x7ff197173f50> 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 0x7ff1917317d0> 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 0x7ff1917318c0> 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 0x7ff1917318c0> 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 0x7ff191731960> 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 0x7ff191731a50> 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 0x7ff191731a50> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_0d_view at 0x7ff19206eed0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff191332f10>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191332810> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> E test_0d_view() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_0d_view E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> test_0d_view() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_0d_view module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1914d22d0>, 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 0x7ff197173f50> 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 0x7ff1914866e0> 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 0x7ff191400f50> 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 0x7ff191400f50> 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 0x7ff191505280> 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 0x7ff19136f5f0> 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 0x7ff19136f5f0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_binop_mul_impl at 0x7ff19206ef50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff1915ecd90>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191717650> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 127, in <module> E test_binop_mul_impl() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_binop_mul_impl E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 127, in <module> test_binop_mul_impl() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_binop_mul_impl module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19161b050>, 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 0x7ff197173f50> 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 0x7ff1915f5690> 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 0x7ff1915f5730> 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 0x7ff1915f5730> 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 0x7ff1915f5820> 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 0x7ff1915f5780> 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 0x7ff1915f5780> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_string_buf at 0x7ff19206f0d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff1916fe510>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1916fe1d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 136, in <module> E test_string_buf() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_string_buf E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 136, in <module> test_string_buf() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_string_buf module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915919d0>, 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 0x7ff197173f50> 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 0x7ff191370410> 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 0x7ff191370af0> 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 0x7ff191370af0> 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 0x7ff191370460> 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 0x7ff1913704b0> 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 0x7ff1913704b0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_subclass at 0x7ff19206f150> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff191332290>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1915ee110> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 133, in <module> E test_subclass() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_subclass E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 133, in <module> test_subclass() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_subclass module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1916111d0>, 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 0x7ff197173f50> 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 0x7ff19128c730> 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 0x7ff19128c9b0> 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 0x7ff19128c9b0> 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 0x7ff19128caa0> 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 0x7ff19128cb40> 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 0x7ff19128cb40> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_unicode_readbuffer at 0x7ff19206f1d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff191735390>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191332810> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 127, in <module> E test_unicode_readbuffer() E File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_unicode_readbuffer E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 127, in <module> test_unicode_readbuffer() File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_unicode_readbuffer module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191618bd0>, 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 0x7ff197173f50> 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 0x7ff1912a1500> 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 0x7ff1912a1460> 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 0x7ff1912a1460> 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 0x7ff1912a15a0> 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 0x7ff1912a1640> 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 0x7ff1912a1640> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_readinto at 0x7ff19206f250> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff1914ab090>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1914ab4d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 134, in <module> E test_readinto() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_readinto E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 134, in <module> test_readinto() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_readinto module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191591650>, 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 0x7ff197173f50> 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 0x7ff19128c4b0> 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 0x7ff19128c870> 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 0x7ff19128c870> 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 0x7ff19128ca00> 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 0x7ff19128c230> 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 0x7ff19128c230> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_iowrite at 0x7ff19206f2d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff1914ab5d0>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191332f50> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 129, in <module> E test_iowrite() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_iowrite E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 129, in <module> test_iowrite() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_iowrite module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915bd450>, 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 0x7ff197173f50> 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 0x7ff1912fc5f0> 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 0x7ff1912fc6e0> 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 0x7ff1912fc6e0> 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 0x7ff1912fc780> 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 0x7ff1912fc870> 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 0x7ff1912fc870> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_getitem_via_PySequence_GetItem at 0x7ff19206f350> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff191309d90>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191332810> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 131, in <module> E test_getitem_via_PySequence_GetItem() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_getitem_via_PySequence_GetItem E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 131, in <module> test_getitem_via_PySequence_GetItem() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_getitem_via_PySequence_GetItem module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19161b0d0>, 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 0x7ff197173f50> 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 0x7ff19176df00> 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 0x7ff1912a1cd0> 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 0x7ff1912a1cd0> 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 0x7ff1912a1aa0> 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 0x7ff1912a1320> 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 0x7ff1912a1320> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_subclass_with_attribute at 0x7ff19206f3d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestArrayModule.w_compile_module of <pypy.module.cpyext.test.test_arraymodule.AppT...ule.w_import_extension of <pypy.module.cpyext.test.test_arraymodule.AppTestArrayModule object at 0x7ff191309f10>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1912de190> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> E test_subclass_with_attribute() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_subclass_with_attribute E module = self.import_module(name='array') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from array.c:8: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> test_subclass_with_attribute() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_subclass_with_attribute module = self.import_module(name='array') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191607250>, 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 0x7ff197173f50> 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 0x7ff1912bea00> 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 0x7ff1912be960> 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 0x7ff1912be960> 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 0x7ff1912be6e0> 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 0x7ff1912be9b0> 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 0x7ff1912be9b0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_createmodule at 0x7ff192057450> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestCpythonExtension.w_compile_module of <pypy.module.cpyext.test.test_cpyext.AppT...ion.w_import_extension of <pypy.module.cpyext.test.test_cpyext.AppTestCpythonExtension object at 0x7ff1916372d0>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191637410> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 125, in <module> E test_createmodule() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_createmodule E self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' def test_createmodule(): import sys self.import_module(name='foo') assert 'foo' in sys.modules try: test_createmodule() finally: print("===aefwuiheawiu===") from /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 125, in <module> test_createmodule() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_createmodule self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 "/tmp/p...t/usession-py3.12-574/src.py", line 143, in test_load_dynamic assert foo.__dict__ == foo2.__dict__ AssertionError > func = <function <lambda> at 0x7ff191607cd0>, 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 0x7ff197173f50> 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 0x7ff1912935a0> 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 0x7ff191293730> 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 0x7ff191293730> 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 0x7ff191293b90> 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 0x7ff191293410> 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 0x7ff191293410> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_load_dynamic at 0x7ff1920575d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestCpythonExtension.w_compile_module of <pypy.module.cpyext.test.test_cpyext.AppT...ion.w_import_extension of <pypy.module.cpyext.test.test_cpyext.AppTestCpythonExtension object at 0x7ff1912de550>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1912de250> 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 "/tmp/pytest/usession-py3.12-574/src.py", line 145, in <module> E test_load_dynamic() E File "/tmp/pytest/usession-py3.12-574/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "/tmp/pytest/usession-py3.12-574/src.py", line 145, in <module> test_load_dynamic() File "/tmp/pytest/usession-py3.12-574/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 0x7ff191364150>, 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 0x7ff197173f50> 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 0x7ff191375960> 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 0x7ff1913758c0> 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 0x7ff1913758c0> 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 0x7ff1913757d0> 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 0x7ff191375910> 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 0x7ff191375910> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_forge_frame at 0x7ff191e60250> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestFrameObject.w_compile_module of <pypy.module.cpyext.test.test_frameobject.AppT...ect.w_import_extension of <pypy.module.cpyext.test.test_frameobject.AppTestFrameObject object at 0x7ff191355150>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191355710> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 189, in <module> E test_forge_frame() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_forge_frame E module = self.import_extension('foo', [ E ^^^^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 95, in w_import_extension E return sys_info.import_extension( E ^^^^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 189, in <module>\n test_forge_frame()\n File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_forge_frame\n module = self.import_extension('foo', [\n ^^^^^^^^^^^^^^^^\n File "/tmp/pytest/usession-py3.12-574/src.py", line 95, in w_import_extension\n return sys_info.import_extension(\n ^^^^^^^^^^^^^^^^\n File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile\n _build(\n File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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 0x7ff1916e6250>, 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 0x7ff197173f50> 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 0x7ff1916fda00> 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 0x7ff1916fde10> 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 0x7ff1916fde10> 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 0x7ff1916fdeb0> 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 0x7ff1916fd0f0> 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 0x7ff1916fd0f0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_wrapper at 0x7ff191cc9a50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestMethodObject.w_compile_module of <pypy.module.cpyext.test.test_methodobject.Ap...t.w_import_extension of <pypy.module.cpyext.test.test_methodobject.AppTestMethodObject object at 0x7ff1916d4690>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1916e4b90> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 131, in <module> E test_wrapper() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_wrapper E mod = self.import_module(name="specmethdocstring") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from specmethdocstring.c:1411: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 131, in <module> test_wrapper() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_wrapper mod = self.import_module(name="specmethdocstring") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19137c4d0>, 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 0x7ff197173f50> 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 0x7ff191196500> 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 0x7ff1911965a0> 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 0x7ff1911965a0> 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 0x7ff191196690> 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 0x7ff1911967d0> 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 0x7ff1911967d0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_module_name at 0x7ff191cc9ad0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestMethodObject.w_compile_module of <pypy.module.cpyext.test.test_methodobject.Ap...t.w_import_extension of <pypy.module.cpyext.test.test_methodobject.AppTestMethodObject object at 0x7ff191355710>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191484050> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 125, in <module> E test_module_name() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_module_name E mod = self.import_module(name="test_func") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from test_func.c:1500: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 125, in <module> test_module_name() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_module_name mod = self.import_module(name="test_func") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1916e64d0>, 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 0x7ff197173f50> 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 0x7ff1911a7500> 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 0x7ff1911a76e0> 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 0x7ff1911a76e0> 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 0x7ff1911a77d0> 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 0x7ff1911a7870> 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 0x7ff1911a7870> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_min_max at 0x7ff191cc9b50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestMethodObject.w_compile_module of <pypy.module.cpyext.test.test_methodobject.Ap...t.w_import_extension of <pypy.module.cpyext.test.test_methodobject.AppTestMethodObject object at 0x7ff1916d42d0>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1913559d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 124, in <module> E test_min_max() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_min_max E mod = self.import_module(name="builtin_min_max") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' def test_min_max(): mod = self.import_module(name="builtin_min_max") mod.test_max2() try: test_min_max() finally: print("===aefwuiheawiu===") from /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from builtin_min_max.c:1248: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 124, in <module> test_min_max() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_min_max mod = self.import_module(name="builtin_min_max") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 _______________________ 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 0x7ff191297150>, 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 0x7ff197173f50> 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 0x7ff1914f7190> 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 0x7ff1914f7410> 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 0x7ff1914f7410> 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 0x7ff1914f72d0> 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 0x7ff1914f75f0> 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 0x7ff1914f75f0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_tuple_subclass at 0x7ff191804550> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'compile_module': <bound method AppTestTuple.w_compile_module of <pypy.module.cpyext.test.test_tupleobject.AppTestTup...TestTuple.w_import_extension of <pypy.module.cpyext.test.test_tupleobject.AppTestTuple object at 0x7ff1914c3e50>>, ...} 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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1914c3290> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> E test_tuple_subclass() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_tuple_subclass E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> test_tuple_subclass() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_tuple_subclass module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1914cdd50>, 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 0x7ff197173f50> 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 0x7ff1914d37d0> 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 0x7ff1914d3910> 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 0x7ff1914d3910> 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 0x7ff1914d3230> 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 0x7ff1914d3eb0> 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 0x7ff1914d3eb0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_typeobject at 0x7ff19183f650> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff191713ad0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191713b50> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 134, in <module> E test_typeobject() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_typeobject E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 134, in <module> test_typeobject() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_typeobject module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1912975d0>, 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 0x7ff197173f50> 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 0x7ff1911bd050> 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 0x7ff1911bd280> 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 0x7ff1911bd280> 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 0x7ff1911bd960> 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 0x7ff1911bd500> 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 0x7ff1911bd500> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_typeobject_method_descriptor at 0x7ff19183f6d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff19117afd0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19117a350> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 139, in <module> E test_typeobject_method_descriptor() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_typeobject_method_descriptor E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 139, in <module> test_typeobject_method_descriptor() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_typeobject_method_descriptor module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1914cdd50>, 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 0x7ff197173f50> 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 0x7ff1910ca500> 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 0x7ff1910ca5a0> 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 0x7ff1910ca5a0> 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 0x7ff1910ca690> 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 0x7ff1910ca7d0> 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 0x7ff1910ca7d0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_typeobject_data_member at 0x7ff19183f750> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1914c3150>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1914c36d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 137, in <module> E test_typeobject_data_member() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_typeobject_data_member E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 137, in <module> test_typeobject_data_member() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_typeobject_data_member module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1916e64d0>, 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 0x7ff197173f50> 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 0x7ff191122d20> 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 0x7ff191122f00> 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 0x7ff191122f00> 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 0x7ff191122f50> 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 0x7ff191716dc0> 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 0x7ff191716dc0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_typeobject_object_member at 0x7ff19183f7d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff191158c10>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19122e110> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 141, in <module> E test_typeobject_object_member() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_typeobject_object_member E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 141, in <module> test_typeobject_object_member() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_typeobject_object_member module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1914cdd50>, 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 0x7ff197173f50> 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 0x7ff1911097d0> 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 0x7ff1911098c0> 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 0x7ff1911098c0> 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 0x7ff191109960> 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 0x7ff191109a50> 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 0x7ff191109a50> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_typeobject_string_member at 0x7ff19183f850> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff19110b7d0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19110b790> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 137, in <module> E test_typeobject_string_member() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_typeobject_string_member E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 137, in <module> test_typeobject_string_member() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_typeobject_string_member module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1916e64d0>, 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 0x7ff197173f50> 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 0x7ff191726a00> 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 0x7ff191726b40> 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 0x7ff191726b40> 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 0x7ff191726aa0> 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 0x7ff1911bdcd0> 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 0x7ff1911bdcd0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_typeobject_int_member at 0x7ff19183f8d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff191158a90>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19110bfd0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 142, in <module> E test_typeobject_int_member() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_typeobject_int_member E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 142, in <module> test_typeobject_int_member() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_typeobject_int_member module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19170f5d0>, 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 0x7ff197173f50> 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 0x7ff191089690> 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 0x7ff191089780> 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 0x7ff191089780> 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 0x7ff191089820> 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 0x7ff191089910> 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 0x7ff191089910> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_int_member_index_protocol at 0x7ff19183f950> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff19122e250>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19122e710> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 134, in <module> E test_int_member_index_protocol() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_int_member_index_protocol E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 134, in <module> test_int_member_index_protocol() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_int_member_index_protocol module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19137c450>, 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 0x7ff197173f50> 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 0x7ff191726fa0> 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 0x7ff191726be0> 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 0x7ff191726be0> 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 0x7ff1917260a0> 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 0x7ff191726f50> 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 0x7ff191726f50> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_overflow at 0x7ff19183f9d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff19127ea50>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19127e4d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 135, in <module> E test_overflow() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_overflow E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 135, in <module> test_overflow() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_overflow module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191266f50>, 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 0x7ff197173f50> 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 0x7ff191097780> 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 0x7ff191097960> 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 0x7ff191097960> 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 0x7ff191097a50> 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 0x7ff191097af0> 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 0x7ff191097af0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_staticmethod at 0x7ff19183fa50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff19127e2d0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191158090> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> E test_staticmethod() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_staticmethod E module = self.import_module(name="foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> test_staticmethod() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_staticmethod module = self.import_module(name="foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1914cdd50>, 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 0x7ff197173f50> 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 0x7ff191142410> 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 0x7ff191142500> 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 0x7ff191142500> 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 0x7ff191142460> 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 0x7ff1911425a0> 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 0x7ff1911425a0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_classmethod at 0x7ff19183fad0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910f29d0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910f2bd0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 133, in <module> E test_classmethod() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_classmethod E module = self.import_module(name="foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 133, in <module> test_classmethod() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_classmethod module = self.import_module(name="foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19170f5d0>, 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 0x7ff197173f50> 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 0x7ff1911420f0> 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 0x7ff1915386e0> 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 0x7ff1915386e0> 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 0x7ff191538690> 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 0x7ff1916fd0f0> 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 0x7ff1916fd0f0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_class_getitem at 0x7ff19183fb50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910d6350>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910d6190> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> E test_class_getitem() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_class_getitem E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> test_class_getitem() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_class_getitem module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191329cd0>, 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 0x7ff197173f50> 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 0x7ff19104e5f0> 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 0x7ff19104e6e0> 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 0x7ff19104e6e0> 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 0x7ff19104e780> 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 0x7ff19104e870> 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 0x7ff19104e870> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_methoddescr at 0x7ff19183fbd0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff19122e690>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19122e750> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 137, in <module> E test_methoddescr() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_methoddescr E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 137, in <module> test_methoddescr() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_methoddescr module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19137c450>, 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 0x7ff197173f50> 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 0x7ff19104efa0> 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 0x7ff191705c30> 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 0x7ff191705c30> 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 0x7ff1917057d0> 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 0x7ff191097640> 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 0x7ff191097640> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_cython_fake_classmethod at 0x7ff19183fc50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff19127e490>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19127e350> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 129, in <module> E test_cython_fake_classmethod() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_cython_fake_classmethod E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 129, in <module> test_cython_fake_classmethod() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_cython_fake_classmethod module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191266f50>, 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 0x7ff197173f50> 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 0x7ff191045690> 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 0x7ff191045910> 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 0x7ff191045910> 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 0x7ff191045a00> 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 0x7ff191045aa0> 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 0x7ff191045aa0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_new at 0x7ff19183fcd0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910b9d10>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910b9110> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 141, in <module> E test_new() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_new E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 141, in <module> test_new() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_new module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19171fc50>, 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 0x7ff197173f50> 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 0x7ff191148050> 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 0x7ff191148f50> 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 0x7ff191148f50> 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 0x7ff1911481e0> 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 0x7ff1911480a0> 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 0x7ff1911480a0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_multiple_inheritance1 at 0x7ff19183fdd0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910ed190>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910ed050> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> E test_multiple_inheritance1() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_multiple_inheritance1 E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> test_multiple_inheritance1() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_multiple_inheritance1 module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19170f5d0>, 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 0x7ff197173f50> 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 0x7ff1910cb2d0> 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 0x7ff191707460> 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 0x7ff191707460> 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 0x7ff19123e2d0> 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 0x7ff19123e1e0> 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 0x7ff19123e1e0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_init at 0x7ff19183fe50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff191161a90>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910f2c50> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 139, in <module> E test_init() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_init E module = self.import_module(name="foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 139, in <module> test_init() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_init module = self.import_module(name="foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191329cd0>, 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 0x7ff197173f50> 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 0x7ff19101daa0> 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 0x7ff19101db90> 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 0x7ff19101db90> 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 0x7ff19101dc30> 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 0x7ff19101dd20> 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 0x7ff19101dd20> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_metatype at 0x7ff19183fed0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910d6150>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910d6d10> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> E test_metatype() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_metatype E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> test_metatype() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_metatype module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19170f5d0>, 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 0x7ff197173f50> 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 0x7ff1911c0af0> 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 0x7ff1911c0a00> 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 0x7ff1911c0a00> 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 0x7ff1911c0280> 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 0x7ff191533820> 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 0x7ff191533820> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_metaclass_compatible at 0x7ff19183ff50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff191161890>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1911615d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> E test_metaclass_compatible() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_metaclass_compatible E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 130, in <module> test_metaclass_compatible() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_metaclass_compatible module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19123d5d0>, 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 0x7ff197173f50> 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 0x7ff1910cb8c0> 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 0x7ff1910cb780> 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 0x7ff1910cb780> 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 0x7ff1910cb460> 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 0x7ff1910cb870> 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 0x7ff1910cb870> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_init_error at 0x7ff1918b10d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff19109e6d0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19109e650> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 124, in <module> E test_init_error() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_init_error E module = self.import_module("foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' def test_init_error(): module = self.import_module("foo") raises(ValueError, module.InitErrType) try: test_init_error() finally: print("===aefwuiheawiu===") from /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 124, in <module> test_init_error() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_init_error module = self.import_module("foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191280ad0>, 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 0x7ff197173f50> 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 0x7ff191240d70> 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 0x7ff1912408c0> 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 0x7ff1912408c0> 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 0x7ff191240370> 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 0x7ff191240e60> 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 0x7ff191240e60> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_hash_inheritance at 0x7ff1918b12d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910b9710>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191056ad0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 127, in <module> E test_hash_inheritance() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_hash_inheritance E foo = self.import_module("foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 127, in <module> test_hash_inheritance() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_hash_inheritance foo = self.import_module("foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19116fcd0>, 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 0x7ff197173f50> 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 0x7ff19106a320> 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 0x7ff19106ab40> 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 0x7ff19106ab40> 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 0x7ff19106a280> 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 0x7ff19106a140> 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 0x7ff19106a140> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_descriptor at 0x7ff1918b1350> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910b7150>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910b7290> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 134, in <module> E test_descriptor() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_descriptor E module = self.import_module("foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 134, in <module> test_descriptor() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_descriptor module = self.import_module("foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191280b50>, 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 0x7ff197173f50> 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 0x7ff190fc9820> 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 0x7ff190fc9aa0> 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 0x7ff190fc9aa0> 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 0x7ff190fc9b90> 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 0x7ff190fc9c30> 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 0x7ff190fc9c30> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_tp_dict at 0x7ff1918b13d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910b63d0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910b6d90> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 171, in <module> E test_tp_dict() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_tp_dict E foo = self.import_module("foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 171, in <module> test_tp_dict() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_tp_dict foo = self.import_module("foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1910a1e50>, 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 0x7ff197173f50> 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 0x7ff190fe4820> 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 0x7ff190fe4aa0> 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 0x7ff190fe4aa0> 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 0x7ff190fe4b90> 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 0x7ff190fe4c30> 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 0x7ff190fe4c30> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_custom_allocation at 0x7ff1918b1450> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff1910b73d0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff1910b7f50> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 126, in <module> E test_custom_allocation() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_custom_allocation E foo = self.import_module("foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 126, in <module> test_custom_allocation() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_custom_allocation foo = self.import_module("foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191280b50>, 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 0x7ff197173f50> 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 0x7ff1910c5cd0> 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 0x7ff1910c5f00> 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 0x7ff1910c5f00> 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 0x7ff1910c5320> 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 0x7ff19101d0a0> 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 0x7ff19101d0a0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_type_dict at 0x7ff1918b1550> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_uses_shortcut': <pypy.interpreter.gateway.interp2app object at 0x7ff191713950>, 'compile_module': <bound meth...ypeObject object at 0x7ff191027e50>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191027fd0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 158, in <module> E test_type_dict() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_type_dict E foo = self.import_module("foo") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 158, in <module> test_type_dict() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_type_dict foo = self.import_module("foo") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915327d0>, 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 0x7ff197173f50> 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 0x7ff190ffa870> 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 0x7ff190ffaf50> 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 0x7ff190ffaf50> 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 0x7ff190ffa8c0> 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 0x7ff190ffae60> 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 0x7ff190ffae60> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_app_subclass_of_c_type at 0x7ff19181b3d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff19117c390>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19117c1d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 142, in <module> E test_app_subclass_of_c_type() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_app_subclass_of_c_type E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 142, in <module> test_app_subclass_of_c_type() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_app_subclass_of_c_type module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191280b50>, 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 0x7ff197173f50> 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 0x7ff19117b4b0> 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 0x7ff1910eb320> 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 0x7ff1910eb320> 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 0x7ff1910eb7d0> 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 0x7ff1910c5cd0> 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 0x7ff1910c5cd0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_app_cant_subclass_two_types at 0x7ff19181b450> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff191027b90>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff190ff73d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 138, in <module> E test_app_cant_subclass_two_types() E File "/tmp/pytest/usession-py3.12-574/src.py", line 124, in test_app_cant_subclass_two_types E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 138, in <module> test_app_cant_subclass_two_types() File "/tmp/pytest/usession-py3.12-574/src.py", line 124, in test_app_cant_subclass_two_types module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915327d0>, 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 0x7ff197173f50> 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 0x7ff1911bc5f0> 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 0x7ff1911bceb0> 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 0x7ff1911bceb0> 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 0x7ff1911bcbe0> 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 0x7ff1911bcd20> 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 0x7ff1911bcd20> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_getattr_getattro at 0x7ff19181b850> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff190fdb050>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff190fdb310> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 131, in <module> E test_getattr_getattro() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_getattr_getattro E module = self.import_module(name='foo') E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from foo.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 131, in <module> test_getattr_getattro() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_getattr_getattro module = self.import_module(name='foo') ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff191532ad0>, 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 0x7ff197173f50> 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 0x7ff190fc6820> 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 0x7ff190fc6280> 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 0x7ff190fc6280> 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 0x7ff190fc6140> 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 0x7ff190fc60f0> 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 0x7ff190fc60f0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_dictoffset at 0x7ff19181bcd0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff19100b710>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19100bd50> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 175, in <module> E test_dictoffset() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_dictoffset E module = self.import_extension("foo", [ E ^^^^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 95, in w_import_extension E return sys_info.import_extension( E ^^^^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from source_0.c:6: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 175, in <module> test_dictoffset() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_dictoffset module = self.import_extension("foo", [ ^^^^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 95, in w_import_extension return sys_info.import_extension( ^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 96, in import_extension return self.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1915325d0>, 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 0x7ff197173f50> 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 0x7ff190fc64b0> 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 0x7ff190fc6a00> 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 0x7ff190fc6a00> 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 0x7ff190fc6780> 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 0x7ff190fc6690> 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 0x7ff190fc6690> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_heaptype_dealloc at 0x7ff19181bed0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff191520650>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191520ed0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> E test_heaptype_dealloc() E File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_heaptype_dealloc E module = self.import_module(name='nanobind1', filename="nanobind1") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from nanobind1.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 128, in <module> test_heaptype_dealloc() File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_heaptype_dealloc module = self.import_module(name='nanobind1', filename="nanobind1") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1911b53d0>, 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 0x7ff197173f50> 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 0x7ff190f834b0> 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 0x7ff191312c80> 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 0x7ff191312c80> 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 0x7ff190fc6aa0> 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 0x7ff19119ca00> 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 0x7ff19119ca00> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_heaptype_metaclass at 0x7ff19181bf50> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff19115fed0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19100ba90> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 132, in <module> E test_heaptype_metaclass() E File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_heaptype_metaclass E module = self.import_module(name='nanobind1', filename="nanobind1") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from nanobind1.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 132, in <module> test_heaptype_metaclass() File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_heaptype_metaclass module = self.import_module(name='nanobind1', filename="nanobind1") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1911851d0>, 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 0x7ff197173f50> 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 0x7ff19113c960> 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 0x7ff19113c7d0> 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 0x7ff19113c7d0> 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 0x7ff19113c910> 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 0x7ff19113c9b0> 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 0x7ff19113c9b0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_vectorcall2 at 0x7ff191819050> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff190f861d0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff190f864d0> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 132, in <module> E test_vectorcall2() E File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_vectorcall2 E module = self.import_module(name='nanobind1', filename="nanobind1") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from nanobind1.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 132, in <module> test_vectorcall2() File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_vectorcall2 module = self.import_module(name='nanobind1', filename="nanobind1") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1911b50d0>, 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 0x7ff197173f50> 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 0x7ff1910400f0> 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 0x7ff191040b90> 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 0x7ff191040b90> 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 0x7ff191040190> 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 0x7ff1910402d0> 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 0x7ff1910402d0> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_nanobind2_module_attributes at 0x7ff191819150> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff190f86690>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191520a10> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 133, in <module> E test_nanobind2_module_attributes() E File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_nanobind2_module_attributes E module = self.import_module(name='nanobind2', filename="nanobind2") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from nanobind2.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 133, in <module> test_nanobind2_module_attributes() File "/tmp/pytest/usession-py3.12-574/src.py", line 123, in test_nanobind2_module_attributes module = self.import_module(name='nanobind2', filename="nanobind2") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19113ead0>, 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 0x7ff197173f50> 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 0x7ff190fbaa00> 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 0x7ff190fba690> 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 0x7ff190fba690> 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 0x7ff190fba320> 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 0x7ff191312820> 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 0x7ff191312820> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_nanobind2_vectorcall_method at 0x7ff1918191d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff19100bad0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff19100b390> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 155, in <module> E test_nanobind2_vectorcall_method() E File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_nanobind2_vectorcall_method E module = self.import_module(name='nanobind2', filename="nanobind2") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from nanobind2.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 155, in <module> test_nanobind2_vectorcall_method() File "/tmp/pytest/usession-py3.12-574/src.py", line 122, in test_nanobind2_vectorcall_method module = self.import_module(name='nanobind2', filename="nanobind2") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff1911347d0>, 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 0x7ff197173f50> 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 0x7ff190ed9410> 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 0x7ff190ed95f0> 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 0x7ff190ed95f0> 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 0x7ff190ed96e0> 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 0x7ff190ed9780> 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 0x7ff190ed9780> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_nanobind3 at 0x7ff191819250> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff191156dd0>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff191156750> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 138, in <module> E test_nanobind3() E File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_nanobind3 E module = self.import_module(name='nanobind3', filename="nanobind3") E ^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module E return sys_info.import_module( E ^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from nanobind3.c:2: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 138, in <module> test_nanobind3() File "/tmp/pytest/usession-py3.12-574/src.py", line 121, in test_nanobind3 module = self.import_module(name='nanobind3', filename="nanobind3") ^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 105, in w_import_module return sys_info.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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 0x7ff19102a0d0>, 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 0x7ff197173f50> 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 0x7ff190ed9230> 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 0x7ff190ed94b0> 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 0x7ff190ed94b0> 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 0x7ff191035f50> 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 0x7ff191035c30> 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 0x7ff191035c30> 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-64/build/pypy/goal/pypy3.12-c' target_ = <function test_multiple_inheritance_ctypes_with_weakref_or_dict at 0x7ff1918197d0> usemodules = ['cpyext', '_thread', '_struct', 'array', 'itertools', 'time', ...] definitions = {'_check_type_object': <pypy.interpreter.gateway.interp2app object at 0x7ff19109ead0>, 'compile_module': <bound method...TestSlots object at 0x7ff190eede90>>, 'here': u'/build_dir/pypy-c-jit-linux-x86-64/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'/tmp/pytest/usession-py3.12-574' code = <py._code.code.Code object at 0x7ff190eed950> 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-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 252, in <module> E test_multiple_inheritance_ctypes_with_weakref_or_dict() E File "/tmp/pytest/usession-py3.12-574/src.py", line 125, in test_multiple_inheritance_ctypes_with_weakref_or_dict E module = self.import_extension('foo_heapctype', [], E ^^^^^^^^^^^^^^^^ E File "/tmp/pytest/usession-py3.12-574/src.py", line 95, in w_import_extension E return sys_info.import_extension( E ^^^^^^^^^^^^^^^^ E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile E _build( E File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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 = '/tmp/pytest/usession-py3.12-574' 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 /tmp/pytest/usession-py3.12-574/src.py ===aefwuiheawiu=== ----------------------------- Captured stderr call ----------------------------- In file included from source_0.c:6: /build_dir/pypy-c-jit-linux-x86-64/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-64/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-64/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-64/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-64/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-64/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-64/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 "/tmp/pytest/usession-py3.12-574/src.py", line 252, in <module> test_multiple_inheritance_ctypes_with_weakref_or_dict() File "/tmp/pytest/usession-py3.12-574/src.py", line 125, in test_multiple_inheritance_ctypes_with_weakref_or_dict module = self.import_extension('foo_heapctype', [], ^^^^^^^^^^^^^^^^ File "/tmp/pytest/usession-py3.12-574/src.py", line 95, in w_import_extension return sys_info.import_extension( ^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 96, in import_extension return self.import_module( ^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 82, in import_module mod = self.compile_extension_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/build/pypy/tool/cpyext/extbuild.py", line 199, in c_compile _build( File "/build_dir/pypy-c-jit-linux-x86-64/build/pypy/tool/cpyext/extbuild.py", line 233, in _build res = compiler.compile([cfile.basename], ^^^^^^^ File "/build_dir/pypy-c-jit-linux-x86-64/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-64/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_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 === 59 failed, 369 passed, 15 skipped, 2 xfailed, 1 error in 240.31 seconds ==== ++ 12:26:27 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 1 items module/crypt/test/test_crypt.py s ========================== 1 skipped in 0.04 seconds =========================== ++ 12:26:28 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 3 items module/errno/test/test_errno.py ... =========================== 3 passed in 0.10 seconds =========================== ++ 12:26:30 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 48 items module/exceptions/test/test_exc.py ................................................ ========================== 48 passed in 1.42 seconds =========================== ++ 12:26:33 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 2 items module/faulthandler/test/test_faulthander.py .. =========================== 2 passed in 0.07 seconds =========================== ++ 12:26:35 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 8 items module/fcntl/test/test_fcntl.py ........ =========================== 8 passed in 0.79 seconds =========================== ++ 12:26:38 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 0.54 seconds =============== ++ 12:26:39 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 5.16 seconds ===================== ++ 12:26:46 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 87 items module/itertools/test/test_itertools.py ....................................................................................... ========================== 87 passed in 2.72 seconds =========================== ++ 12:26:51 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.41 seconds ========================= ++ 12:26:52 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 31 items module/math/test/test_math.py ............................... ========================== 31 passed in 0.98 seconds =========================== ++ 12:26:55 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.01 seconds ========================= ++ 12:26:57 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 46 items module/mmap/test/test_mmap.py .............................................. ========================== 46 passed in 1.47 seconds =========================== ++ 12:27:00 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 24 items module/operator/test/test_operator.py ........................ ========================== 24 passed in 0.95 seconds =========================== ++ 12:27:03 starting module/posix/test [60 started in total] __ module/posix/test [60 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 170 items / 2 skipped module/posix/test/test_posix2.py ................................................................................................................s..ss.....................ssss.......s module/posix/test/test_scandir.py .................... =================== 162 passed, 10 skipped in 12.82 seconds ==================== ++ 12:27:17 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 4 items module/pwd/test/test_pwd.py .... =========================== 4 passed in 0.15 seconds =========================== ++ 12:27:19 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 17 items module/pyexpat/test/test_parser.py ................. ========================== 17 passed in 3.83 seconds =========================== ++ 12:27:24 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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.23 seconds ====================== ++ 12:27:26 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 14.25 seconds ===================== ++ 12:27:43 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 25 items module/signal/test/test_signal.py ......................sss ===================== 22 passed, 3 skipped in 9.78 seconds ===================== ++ 12:27:56 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 7 items module/struct/test/test_struct.py ....... =========================== 7 passed in 0.22 seconds =========================== ++ 12:27:57 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 2.63 seconds =========================== ++ 12:28:02 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 3 items module/termios/test/test_termios.py ... =========================== 3 passed in 0.10 seconds =========================== ++ 12:28:03 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 1.76 seconds ==================== ++ 12:28:07 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/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 62.97 seconds ========================== ++ 12:29:12 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.01 seconds ========================= ++ 12:29:14 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:29:16 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 19 items module/unicodedata/test/test_unicodedata.py ................... ========================== 19 passed in 0.78 seconds =========================== ++ 12:29:18 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 0 items ========================= no tests ran in 0.00 seconds ========================= ++ 12:29:20 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-64/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/pypy-c-jit-linux-x86-64/build/pytest.pyc rootdir: /build_dir/pypy-c-jit-linux-x86-64/build, inifile: pytest.ini plugins: hypothesis-4.42.0 collected 46 items module/zlib/test/test_zlib.py ..................................s........... ===================== 45 passed, 1 skipped in 1.49 seconds ===================== program finished with exit code 1 elapsedTime=597.242745