Repository navigation
TSK: Make NumPy buildable on the nogil branch #26161
Copy link
Copy link
Closed
Labels
17 - Task39 - free-threadingPRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)
Milestone
Description
Currently the build fails with internal errors in cython (compiled using the latest cython master branch):
Details
FAILED: numpy/random/_sfc64.cpython-313t-darwin.so.p/numpy/random/_sfc64.pyx.c
cython -M --fast-fail -3 /Users/goldbaum/Documents/numpy/numpy/random/_sfc64.pyx -o numpy/random/_sfc64.cpython-313t-darwin.so.p/numpy/random/_sfc64.pyx.c
Traceback (most recent call last):
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/bin/cython", line 8, in <module>
sys.exit(setuptools_main())
~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 740, in setuptools_main
return main(command_line = 1)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 768, in main
result = compile(sources, options)
~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 659, in compile
return compile_multiple(source, options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 633, in compile_multiple
result = run_pipeline(source, options,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
full_module_name=options.module_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
context=context)
^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 525, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 404, in run_pipeline
data = run(phase, data)
~~~^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 386, in run
return phase(data)
~~~~~^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 50, in generate_pyx_code_stage
module_node.process_implementation(options, result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 221, in process_implementation
self.generate_c_code(env, options, result)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 514, in generate_c_code
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2321, in generate_function_definitions
align_error_path_gil_to_success_path()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2305, in align_error_path_gil_to_success_path
assure_gil('error', code=code)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
TypeError: FuncDefNode.generate_function_definitions.<locals>.assure_gil() keywords must be strings
[284/309] Compiling Cython source /Users/goldbaum/Documents/numpy/numpy/random/_mt19937.pyx
FAILED: numpy/random/_mt19937.cpython-313t-darwin.so.p/numpy/random/_mt19937.pyx.c
cython -M --fast-fail -3 /Users/goldbaum/Documents/numpy/numpy/random/_mt19937.pyx -o numpy/random/_mt19937.cpython-313t-darwin.so.p/numpy/random/_mt19937.pyx.c
Traceback (most recent call last):
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/bin/cython", line 8, in <module>
sys.exit(setuptools_main())
~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 740, in setuptools_main
return main(command_line = 1)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 768, in main
result = compile(sources, options)
~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 659, in compile
return compile_multiple(source, options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 633, in compile_multiple
result = run_pipeline(source, options,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
full_module_name=options.module_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
context=context)
^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 525, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 404, in run_pipeline
data = run(phase, data)
~~~^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 386, in run
return phase(data)
~~~~~^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 50, in generate_pyx_code_stage
module_node.process_implementation(options, result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 221, in process_implementation
self.generate_c_code(env, options, result)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 514, in generate_c_code
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2321, in generate_function_definitions
align_error_path_gil_to_success_path()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2305, in align_error_path_gil_to_success_path
assure_gil('error', code=code)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
TypeError: FuncDefNode.generate_function_definitions.<locals>.assure_gil() got an unexpected keyword argument 'code'
[285/309] Compiling Cython source /Users/goldbaum/Documents/numpy/numpy/random/_philox.pyx
FAILED: numpy/random/_philox.cpython-313t-darwin.so.p/numpy/random/_philox.pyx.c
cython -M --fast-fail -3 /Users/goldbaum/Documents/numpy/numpy/random/_philox.pyx -o numpy/random/_philox.cpython-313t-darwin.so.p/numpy/random/_philox.pyx.c
Traceback (most recent call last):
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/bin/cython", line 8, in <module>
sys.exit(setuptools_main())
~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 740, in setuptools_main
return main(command_line = 1)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 768, in main
result = compile(sources, options)
~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 659, in compile
return compile_multiple(source, options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 633, in compile_multiple
result = run_pipeline(source, options,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
full_module_name=options.module_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
context=context)
^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 525, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 404, in run_pipeline
data = run(phase, data)
~~~^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 386, in run
return phase(data)
~~~~~^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 50, in generate_pyx_code_stage
module_node.process_implementation(options, result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 221, in process_implementation
self.generate_c_code(env, options, result)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 514, in generate_c_code
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2321, in generate_function_definitions
align_error_path_gil_to_success_path()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2305, in align_error_path_gil_to_success_path
assure_gil('error', code=code)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
TypeError: FuncDefNode.generate_function_definitions.<locals>.assure_gil() keywords must be strings
[286/309] Compiling Cython source /Users/goldbaum/Documents/numpy/numpy/random/bit_generator.pyx
FAILED: numpy/random/bit_generator.cpython-313t-darwin.so.p/numpy/random/bit_generator.pyx.c
cython -M --fast-fail -3 /Users/goldbaum/Documents/numpy/numpy/random/bit_generator.pyx -o numpy/random/bit_generator.cpython-313t-darwin.so.p/numpy/random/bit_generator.pyx.c
Traceback (most recent call last):
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/bin/cython", line 8, in <module>
sys.exit(setuptools_main())
~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 740, in setuptools_main
return main(command_line = 1)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 768, in main
result = compile(sources, options)
~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 659, in compile
return compile_multiple(source, options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 633, in compile_multiple
result = run_pipeline(source, options,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
full_module_name=options.module_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
context=context)
^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 525, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 404, in run_pipeline
data = run(phase, data)
~~~^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 386, in run
return phase(data)
~~~~~^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 50, in generate_pyx_code_stage
module_node.process_implementation(options, result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 221, in process_implementation
self.generate_c_code(env, options, result)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 514, in generate_c_code
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2321, in generate_function_definitions
align_error_path_gil_to_success_path()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2305, in align_error_path_gil_to_success_path
assure_gil('error', code=code)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
TypeError: FuncDefNode.generate_function_definitions.<locals>.assure_gil() got an unexpected keyword argument 'code'
[287/309] Compiling Cython source /Users/goldbaum/Documents/numpy/numpy/random/_pcg64.pyx
FAILED: numpy/random/_pcg64.cpython-313t-darwin.so.p/numpy/random/_pcg64.pyx.c
cython -M --fast-fail -3 /Users/goldbaum/Documents/numpy/numpy/random/_pcg64.pyx -o numpy/random/_pcg64.cpython-313t-darwin.so.p/numpy/random/_pcg64.pyx.c
Traceback (most recent call last):
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/bin/cython", line 8, in <module>
sys.exit(setuptools_main())
~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 740, in setuptools_main
return main(command_line = 1)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 768, in main
result = compile(sources, options)
~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 659, in compile
return compile_multiple(source, options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 633, in compile_multiple
result = run_pipeline(source, options,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
full_module_name=options.module_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
context=context)
^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 525, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 404, in run_pipeline
data = run(phase, data)
~~~^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 386, in run
return phase(data)
~~~~~^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 50, in generate_pyx_code_stage
module_node.process_implementation(options, result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 221, in process_implementation
self.generate_c_code(env, options, result)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 514, in generate_c_code
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2321, in generate_function_definitions
align_error_path_gil_to_success_path()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2305, in align_error_path_gil_to_success_path
assure_gil('error', code=code)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
TypeError: FuncDefNode.generate_function_definitions.<locals>.assure_gil() keywords must be strings
[288/309] Compiling Cython source numpy/random/_bounded_integers.pyx
FAILED: numpy/random/_bounded_integers.cpython-313t-darwin.so.p/numpy/random/_bounded_integers.pyx.c
cython -M --fast-fail -3 numpy/random/_bounded_integers.pyx -o numpy/random/_bounded_integers.cpython-313t-darwin.so.p/numpy/random/_bounded_integers.pyx.c
[289/309] Compiling Cython source numpy/random/mtrand.pyx
FAILED: numpy/random/mtrand.cpython-313t-darwin.so.p/numpy/random/mtrand.pyx.c
cython -M --fast-fail -3 numpy/random/mtrand.pyx -o numpy/random/mtrand.cpython-313t-darwin.so.p/numpy/random/mtrand.pyx.c
Traceback (most recent call last):
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/bin/cython", line 8, in <module>
sys.exit(setuptools_main())
~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 740, in setuptools_main
return main(command_line = 1)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 768, in main
result = compile(sources, options)
~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 659, in compile
return compile_multiple(source, options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 633, in compile_multiple
result = run_pipeline(source, options,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
full_module_name=options.module_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
context=context)
^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 525, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 404, in run_pipeline
data = run(phase, data)
~~~^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 386, in run
return phase(data)
~~~~~^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 50, in generate_pyx_code_stage
module_node.process_implementation(options, result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 221, in process_implementation
self.generate_c_code(env, options, result)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 514, in generate_c_code
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 342, in generate_function_definitions
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2321, in generate_function_definitions
align_error_path_gil_to_success_path()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2305, in align_error_path_gil_to_success_path
assure_gil('error', code=code)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
TypeError: FuncDefNode.generate_function_definitions.<locals>.assure_gil() keywords must be strings
[290/309] Compiling Cython source /Users/goldbaum/Documents/numpy/numpy/random/_common.pyx
FAILED: numpy/random/_common.cpython-313t-darwin.so.p/numpy/random/_common.pyx.c
cython -M --fast-fail -3 /Users/goldbaum/Documents/numpy/numpy/random/_common.pyx -o numpy/random/_common.cpython-313t-darwin.so.p/numpy/random/_common.pyx.c
Traceback (most recent call last):
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/bin/cython", line 8, in <module>
sys.exit(setuptools_main())
~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 740, in setuptools_main
return main(command_line = 1)
~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 768, in main
result = compile(sources, options)
~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 659, in compile
return compile_multiple(source, options)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 633, in compile_multiple
result = run_pipeline(source, options,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
full_module_name=options.module_name,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
context=context)
^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Main.py", line 525, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 404, in run_pipeline
data = run(phase, data)
~~~^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 386, in run
return phase(data)
~~~~~^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Pipeline.py", line 50, in generate_pyx_code_stage
module_node.process_implementation(options, result)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 221, in process_implementation
self.generate_c_code(env, options, result)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/ModuleNode.py", line 514, in generate_c_code
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 342, in generate_function_definitions
self.body.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 397, in generate_function_definitions
stat.generate_function_definitions(env, code)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2321, in generate_function_definitions
align_error_path_gil_to_success_path()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/goldbaum/.pyenv/versions/3.13-dev-nogil/lib/python3.13/site-packages/Cython/Compiler/Nodes.py", line 2305, in align_error_path_gil_to_success_path
assure_gil('error', code=code)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
TypeError: FuncDefNode.generate_function_definitions.<locals>.assure_gil() got an unexpected keyword argument 'code'
[291/309] Compiling Cython source numpy/random/_generator.pyx
FAILED: numpy/random/_generator.cpython-313t-darwin.so.p/numpy/random/_generator.pyx.c
cython -M --fast-fail -3 numpy/random/_generator.pyx -o numpy/random/_generator.cpython-313t-darwin.so.p/numpy/random/_generator.pyx.c
ninja: build stopped: subcommand failed.
We can probably hack around this by disabling np.random for nogil python.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
17 - Task39 - free-threadingPRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)
Activity
[-]Make NumPy buildable on the nogil branch[/-][+]TSK: Make NumPy buildable on the nogil branch[/+]ngoldbaum commentedon Apr 1, 2024
@lysnikolaou has some WIP changes that lets me build
np.randomon this branch. It looks like there are some test failures that are specific to a--disable-gilpython build:Reloading will probably be fixed upstream but the others look like issues in numpy that bear a closer look.
Additionally, all the cython and most of the f2py tests are failing due to a meson issue on 3.13 that meson is waiting on an upstream fix for.
I'd like to get these tests fixed and add add 3.13 CI. I see a build matrix including a normal 3.13 build, and two 3.13 test runs with
--disable-gil, one withPYTHON_GIL=1, and eventually another withPYTHON_GIL=0.We might need to xfail or skip the cython or f2py tests for now.
rgommers commentedon Apr 3, 2024
This is the
importlib.resourcesAPI removal that is about to be reverted I assume? If so, that should be done soon, this was posted about 24 hours ago: https://discuss.python.org/t/deprecating-importlib-resources-legacy-api/11386/41. The PR linked there (python/cpython#116609) is approved, so this should happen soon. I wouldn't bother with xfailing yet, unless it becomes too annoying to wait for that PR.ngoldbaum commentedon Apr 8, 2024
python/cpython#116609 is merged, which fixed all the tests that depend on meson. I also just merged #26207 which fixes one of the tests and marked the limited API test as an xfail in #26229.
I'm going to close this for and open followup issues about test failures with the GIL disabled (awesome we've gotten that far already!). I'm also going to set up bleeding edge CPython CI that can be converted into CPython prerelease tests once the first beta is cut.
rgommers commentedon Apr 9, 2024
Awesome, nice work!
On a fork for now rather than on this repo? This is probably going to be failing regularly for the next weeks, with changes in CPython and Cython.
seberg commentedon Apr 9, 2024
Wasn't there a way to say "failure is OK" so that it shows up as orange and not as a failure? that would seem fine also.
rgommers commentedon Apr 9, 2024
If there is, I'm not familiar with it. My understanding is that there's a feature to say which checks are required for merging, which we don't use. If you do use it, failing non-required jobs still look red but won't block merging. For us, I think any failing job will simply be red.
lysnikolaou commentedon Apr 9, 2024
There's no official feature for this, but there's a workaround explained on the feature request ticket.
rgommers commentedon Apr 9, 2024
Oh wait, I read the proposal as "a new CI job for the no-GIL build", but on re-reading I think you meant one for the default CPython build. That seems fine by now; with beta 1 arriving in a couple of weeks I hope there won't be more than 1 or 2 more regressions that affect numpy anymore.
seberg commentedon Apr 9, 2024
Yeah, I guess
allow-failurestill looks too much like a failure, seems I probably had thought of a Travis CI feature. I would be OK with trying if it fails too often, but maybe a branch is best then.ngoldbaum commentedon Apr 9, 2024
That's right, just vanilla 3.13 CI. Nogil CI will have to wait until more stuff is stabilized.