Add per-interpreter storage for gil_safe_call_once_and_store
#10425
Triggered via pull request
December 24, 2025 02:30
Status
Failure
Total duration
47m 31s
Artifacts
–
ci.yml
on: pull_request
Manylinux on π 3.13t β’ GIL
6m 0s
π 3.10 β’ CUDA 12.2 β’ Ubuntu 22.04
9m 24s
π 3 β’ NVHPC 25.11 β’ C++17 β’ x64
22m 31s
π 3 β’ ICC latest β’ x64
19m 30s
π 3.9 β’ Debian β’ x86 β’ Install
4m 46s
Documentation build test
54s
Matrix: centos
Matrix: clang
Matrix: deadsnakes
Matrix: gcc
Matrix: inplace
Matrix: mingw
Matrix: π
Matrix: π
Matrix: win32-debug
Matrix: win32
Matrix: windows-2022
Matrix: windows_arm_clang_msvc
Matrix: windows_arm_clang_msys2
Matrix: windows_clang
Annotations
12 errors and 2 warnings
|
π (ubuntu-latest, 3.14t, -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON) / π§ͺ
Process completed with exit code 1.
|
|
π (ubuntu-latest, 3.14t, -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON) / π§ͺ:
tests/test_multiple_interpreters/test_multiple_interpreters.py#L363
test_import_in_subinterpreter_before_main
Failed: Subprocess failed with exit code 1.
Code:
```python
def test():
import sys
sys.path.insert(0, '/home/runner/work/pybind11/pybind11/build/tests')
import collections
import mod_per_interpreter_gil_with_singleton as m
objects = m.get_objects_in_singleton()
expected = [
type(None),
tuple,
list,
dict,
collections.OrderedDict,
collections.defaultdict,
collections.deque,
]
assert objects == expected, f"Expected {expected!r}, got {objects!r}."
assert hasattr(m, 'MyClass'), "Module missing MyClass"
assert hasattr(m, 'MyGlobalError'), "Module missing MyGlobalError"
assert hasattr(m, 'MyLocalError'), "Module missing MyLocalError"
assert hasattr(m, 'MyEnum'), "Module missing MyEnum"
import contextlib
import gc
from concurrent import interpreters
interps = interp = None
with contextlib.ExitStack() as stack:
interps = [
stack.enter_context(contextlib.closing(interpreters.create()))
for _ in range(8)
]
for interp in interps:
interp.call(test)
test()
del interps, interp, stack
for _ in range(5):
gc.collect()
```
Output:
Traceback (most recent call last):
File "<string>", line 39, in <module>
test()
~~~~^^
File "<string>", line 7, in test
import mod_per_interpreter_gil_with_singleton as m
ImportError: generic_type: type "MyClass" is already registered!
|
|
π (ubuntu-latest, 3.14t, -DCMAKE_CXX_STANDARD=17 -DPYBIND11_TEST_SMART_HOLDER=ON) / π§ͺ:
tests/test_multiple_interpreters/test_multiple_interpreters.py#L254
test_import_module_with_singleton_per_interpreter
concurrent.interpreters.ExecutionFailed: ImportError: pybind11::native_enum<...>("MyEnum") is already registered as a `pybind11::enum_` or `pybind11::class_`!
Uncaught in the interpreter:
Traceback (most recent call last):
File "<script>", line 26, in <module>
File "<script>", line 7, in test
ImportError: pybind11::native_enum<...>("MyEnum") is already registered as a `pybind11::enum_` or `pybind11::class_`!
|
|
π (macos-latest, 3.14, -DCMAKE_CXX_STANDARD=14) / π§ͺ
Process completed with exit code 1.
|
|
π (windows-latest, 3.14, -DCMAKE_CXX_STANDARD=20) / π§ͺ
Process completed with exit code 1.
|
|
π (ubuntu-latest, 3.14, -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_FLAGS="-DPYBIND11_HAS_SUBINTERPRET... / π§ͺ
Process completed with exit code 1.
|
|
π (ubuntu-latest, 3.14, -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_FLAGS="-DPYBIND11_HAS_SUBINTERPRET... / π§ͺ:
tests/test_multiple_interpreters/test_multiple_interpreters.py#L422
test_import_in_subinterpreter_concurrently
Failed: Subprocess failed with exit code 1.
Code:
```python
def test():
import sys
sys.path.insert(0, '/home/runner/work/pybind11/pybind11/build/tests')
import collections
import mod_per_interpreter_gil_with_singleton as m
objects = m.get_objects_in_singleton()
expected = [
type(None),
tuple,
list,
dict,
collections.OrderedDict,
collections.defaultdict,
collections.deque,
]
assert objects == expected, f"Expected {expected!r}, got {objects!r}."
assert hasattr(m, 'MyClass'), "Module missing MyClass"
assert hasattr(m, 'MyGlobalError'), "Module missing MyGlobalError"
assert hasattr(m, 'MyLocalError'), "Module missing MyLocalError"
assert hasattr(m, 'MyEnum'), "Module missing MyEnum"
import gc
from concurrent.futures import InterpreterPoolExecutor, as_completed
futures = future = None
with InterpreterPoolExecutor(max_workers=16) as executor:
futures = [executor.submit(test) for _ in range(32)]
for future in as_completed(futures):
future.result()
del futures, future, executor
for _ in range(5):
gc.collect()
```
Output:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/futures/interpreter.py", line 84, in run
return self.interp.call(do_call, self.results, *task)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/interpreters/__init__.py", line 238, in call
return self._call(callable, args, kwargs)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/interpreters/__init__.py", line 222, in _call
raise ExecutionFailed(excinfo)
concurrent.interpreters.ExecutionFailed: ImportError: generic_type: type "MyClass" is already registered!
Uncaught in the interpreter:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/futures/interpreter.py", line 11, in do_call
return func(*args, **kwargs)
File "<string>", line 7, in test
ImportError: generic_type: type "MyClass" is already registered!
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 33, in <module>
future.result()
~~~~~~~~~~~~~^^
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/futures/_base.py", line 443, in result
return self.__get_result()
~~~~~~~~~~~~~~~~~^^
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/futures/_base.py", line 395, in __get_result
raise self._exception
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/futures/thread.py", line 86, in run
result = ctx.run(self.task)
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/futures/interpreter.py", line 91, in run
raise exc from wrapper
ImportError: generic_type: type "MyClass" is already registered!
|
|
π (ubuntu-latest, 3.14, -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_FLAGS="-DPYBIND11_HAS_SUBINTERPRET... / π§ͺ:
tests/test_multiple_interpreters/test_multiple_interpreters.py#L342
test_import_in_subinterpreter_before_main
Failed: Subprocess failed with exit code 1.
Code:
```python
def test():
import sys
sys.path.insert(0, '/home/runner/work/pybind11/pybind11/build/tests')
import collections
import mod_per_interpreter_gil_with_singleton as m
objects = m.get_objects_in_singleton()
expected = [
type(None),
tuple,
list,
dict,
collections.OrderedDict,
collections.defaultdict,
collections.deque,
]
assert objects == expected, f"Expected {expected!r}, got {objects!r}."
assert hasattr(m, 'MyClass'), "Module missing MyClass"
assert hasattr(m, 'MyGlobalError'), "Module missing MyGlobalError"
assert hasattr(m, 'MyLocalError'), "Module missing MyLocalError"
assert hasattr(m, 'MyEnum'), "Module missing MyEnum"
import contextlib
import gc
from concurrent import interpreters
interp = None
with contextlib.closing(interpreters.create()) as interp:
interp.call(test)
test()
del interp
for _ in range(5):
gc.collect()
```
Output:
Traceback (most recent call last):
File "<string>", line 34, in <module>
test()
~~~~^^
File "<string>", line 19, in test
assert objects == expected, f"Expected {expected!r}, got {objects!r}."
^^^^^^^^^^^^^^^^^^^
AssertionError: Expected [<class 'NoneType'>, <class 'tuple'>, <class 'list'>, <class 'dict'>, <class 'collections.OrderedDict'>, <class 'collections.defaultdict'>, <class 'collections.deque'>], got [].
|
|
π (ubuntu-latest, 3.14, -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_FLAGS="-DPYBIND11_HAS_SUBINTERPRET... / π§ͺ:
tests/test_multiple_interpreters/test_multiple_interpreters.py#L286
test_import_in_subinterpreter_after_main
Failed: Subprocess failed with exit code 1.
Code:
```python
def test():
import sys
sys.path.insert(0, '/home/runner/work/pybind11/pybind11/build/tests')
import collections
import mod_per_interpreter_gil_with_singleton as m
objects = m.get_objects_in_singleton()
expected = [
type(None),
tuple,
list,
dict,
collections.OrderedDict,
collections.defaultdict,
collections.deque,
]
assert objects == expected, f"Expected {expected!r}, got {objects!r}."
assert hasattr(m, 'MyClass'), "Module missing MyClass"
assert hasattr(m, 'MyGlobalError'), "Module missing MyGlobalError"
assert hasattr(m, 'MyLocalError'), "Module missing MyLocalError"
assert hasattr(m, 'MyEnum'), "Module missing MyEnum"
import contextlib
import gc
from concurrent import interpreters
test()
interp = None
with contextlib.closing(interpreters.create()) as interp:
interp.call(test)
del interp
for _ in range(5):
gc.collect()
```
Output:
Traceback (most recent call last):
File "<string>", line 34, in <module>
interp.call(test)
~~~~~~~~~~~^^^^^^
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/interpreters/__init__.py", line 238, in call
return self._call(callable, args, kwargs)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.14.2/x64/lib/python3.14/concurrent/interpreters/__init__.py", line 222, in _call
raise ExecutionFailed(excinfo)
concurrent.interpreters.ExecutionFailed: ImportError: generic_type: type "MyClass" is already registered!
Uncaught in the interpreter:
Traceback (most recent call last):
File "<string>", line 7, in test
ImportError: generic_type: type "MyClass" is already registered!
|
|
π (ubuntu-latest, 3.14, -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_FLAGS="-DPYBIND11_HAS_SUBINTERPRET... / π§ͺ:
tests/test_multiple_interpreters/test_multiple_interpreters.py#L254
test_import_module_with_singleton_per_interpreter
concurrent.interpreters.ExecutionFailed: ImportError: pybind11::native_enum<...>("MyEnum") is already registered as a `pybind11::enum_` or `pybind11::class_`!
Uncaught in the interpreter:
Traceback (most recent call last):
File "<script>", line 26, in <module>
File "<script>", line 7, in test
ImportError: pybind11::native_enum<...>("MyEnum") is already registered as a `pybind11::enum_` or `pybind11::class_`!
|
|
π (macos-latest, 3.14t, -DCMAKE_CXX_STANDARD=20) / π§ͺ
Process completed with exit code 1.
|
|
π (windows-latest, 3.14t, -DCMAKE_CXX_STANDARD=23) / π§ͺ
Process completed with exit code 1.
|
|
π (ubuntu-latest, graalpy-24.1) / π§ͺ:
/opt/hostedtoolcache/GraalPy/24.1.2/x64/lib/python3.11/distutils/command/build_ext.py#L13
The distutils.sysconfig module is deprecated, use sysconfig instead
|
|
π (ubuntu-latest, graalpy-24.1) / π§ͺ:
/opt/hostedtoolcache/GraalPy/24.1.2/x64/lib/python3.11/site-packages/setuptools/__init__.py#L10
The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
|