Open
Description
tl;dr: Last release 20221220
fails to compile a simple cython project:
setup.py
:
from setuptools import setup
from Cython.Build import cythonize
ext_modules = cythonize("my.pyx")
setup(
ext_modules=ext_modules,
)
(my.pyx
can be an empty file)
With 20221220/cpython-3.10.9+20221220-x86_64-unknown-linux-gnu-pgo+lto-full.tar.zst
:
/tmp/godot-python-test-90vls0a3/addons/pythonscript/linux-x86_64/bin/python3 setup.py build_ext --build-lib /tmp/godot-python-test-90vls0a3
Compiling my.pyx because it changed.
[1/1] Cythonizing my.pyx
running build_ext
building 'my' extension
creating build
creating build/temp.linux-x86_64-cpython-310
clang -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -I/tools/deps/libedit/include -fPIC -I/install/include/python3.10 -c my.c -o build/temp.linux-x86_64-cpython-310/my.o
my.c:19:10: fatal error: 'Python.h' file not found
#include "Python.h"
^~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
vs with 20221106/cpython-3.10.8+20221106-x86_64-unknown-linux-gnu-pgo+lto-full.tar.zst
/tmp/godot-python-test-n_svlsv_/addons/pythonscript/linux-x86_64/bin/python3 setup.py build_ext --build-lib /tmp/godot-python-test-n_svlsv_
Compiling my.pyx because it changed.
[1/1] Cythonizing my.pyx
running build_ext
building 'my' extension
creating build
creating build/temp.linux-x86_64-3.10
clang -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -I/tools/deps/libedit/include -fPIC -I/tmp/godot-python-test-n_svlsv_/addons/pythonscript/linux-x86_64/include/python3.10 -c my.c -o build/temp.linux-x86_64-3.10/my.o
clang -pthread -shared -L/tools/deps/lib -Wl,--exclude-libs,ALL -L/tools/deps/libedit/lib build/temp.linux-x86_64-3.10/my.o -L/install/lib -o /tmp/godot-python-test-n_svlsv_/my.cpython-310-x86_64-linux-gnu.so
rename my.cpython-310-x86_64-linux-gnu.so -> my.so
The issue seems to be the includes flags end up with an empty prefix path (hence e.g. -I/install/include/python3.10
instead of -I/my/path/to/python-build-standalone/install/include/python3.10
)
I'm not sure what the reason given python3-config output the correct include flags:
$ /tmp/godot-python-test-90vls0a3/addons/pythonscript/linux-x86_64/bin/python3-config
-I/home/emmanuel/projects/godot-python/build/common_tests_install_distrib/addons/pythonscript/linux-x86_64/include/python3.10 -I/home/emmanuel/projects/godot-python/build/common_tests_install_distrib/addons/pythonscript/linux-x86_64/include/python3.10