-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling on macos-14
(arm64) cp39 result in Unable to determine extension suffix. Try manually setting PY_BUILD_EXT_SUFFIX.
#24
Comments
It seems that CMake thinks it's cross-compiling. From the logs, py-build-cmake did not enable cross-compilation, so I'm guessing that Conan enabled it. It would be useful to see the contents of Given that CMake is in cross-compilation mode, the error you got makes sense: when cross-compiling, by definition, CMake cannot query the system it's running on to get information about the target system, so the user should specify the details such as the Python extension suffix explicitly. This is by design. However, since you did not intend to cross-compile, the main question is why CMake is in cross-compiling mode, and I think you'll find the answer in your Conan toolchain file. |
Edit: The reason why it works for Python 3.8, is that cibuildwheel uses an x86_64 version of Python 3.8, even on Apple silicon. See pypa/cibuildwheel#1169. For Python 3.9 and up, cibuildwheel uses a native arm64 version of Python, so py-build-cmake does not (and should not) enable cross-compilation in this case. You can see in the output of the Actions run whether py-build-cmake enabled cross-compilation or not: https://github.com/laggykiller/apngasm-python/actions/runs/8062229801
|
Thank you for your insight, I see why it is failing now: This arm64 macOS runner skips cp38 (Using x86_64 python) and compile >cp39 (Using arm64 python): https://github.com/laggykiller/apngasm-python/actions/runs/8074468917/job/22059804243 . Compilation was successful. The build script I am using for the project skips running conan if conan_output is already present. Therefore if I run cp38 first, the conan_output would contain settings for crosscompiling, contaminating subsequent arm64 python builds. I tried to force regenerate conan profile and run conan install for each build, and compilation was successful: https://github.com/laggykiller/apngasm-python/actions/runs/8074648904/job/22060296197 |
When compiling a nanobind project with py-build-cmake, I encountered
Unable to determine extension suffix. Try manually setting PY_BUILD_EXT_SUFFIX.
. Note that my project is usingQueryPythonForNanobind.cmake
as provided in the (nanobind example of this project)[https://github.com/tttapa/py-build-cmake/blob/rework-0.2.0/examples/nanobind-project/cmake/QueryPythonForNanobind.cmake].macos-14
, which is arm64 macOS github runner. This problem does not occur onmacos-11
andmacos-12
, which are x86_64 macOS github runner.Project where I discover this problem: https://github.com/laggykiller/apngasm-python/tree/stubgen-official
GitHub action log: https://github.com/laggykiller/apngasm-python/actions/runs/8062229801/job/22021550265#step:4:2210
The text was updated successfully, but these errors were encountered: