Skip to content
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

Windows python 3.8 wheel contains python 3.10 .pyd #1174

Closed
jfowkes opened this issue Jul 12, 2022 · 4 comments
Closed

Windows python 3.8 wheel contains python 3.10 .pyd #1174

jfowkes opened this issue Jul 12, 2022 · 4 comments

Comments

@jfowkes
Copy link

jfowkes commented Jul 12, 2022

Description

Hi,

I'm building a Windows Python 3.8 wheel using cibuildwheel (see CI config link).

But the resulting Python 3.8 wheel contains a Python 3.10 .pyd:

$ unzip gofit-0.2-cp38-cp38-win_amd64.whl 
Archive:  gofit-0.2-cp38-cp38-win_amd64.whl
  inflating: gofit.cp310-win_amd64.pyd  
  inflating: gofit-0.2.data/platlib/.load-order-gofit-0.2  
  inflating: gofit-0.2.data/platlib/msvcp140.dll  
  inflating: gofit-0.2.dist-info/DELVEWHEEL  
  inflating: gofit-0.2.dist-info/LICENSE  
  inflating: gofit-0.2.dist-info/METADATA  
  inflating: gofit-0.2.dist-info/RECORD  
  inflating: gofit-0.2.dist-info/top_level.txt  
  inflating: gofit-0.2.dist-info/WHEEL

See the wheel on PyPI: https://pypi.org/project/gofit/#files

Predictably the package then fails to import with a ModuleNotFoundError (see build log link).

I assume this must be an issue in cibuildhweel somewhere?

Build log

https://github.com/ralna/GOFit/runs/7302891517

CI config

https://github.com/ralna/GOFit/blob/master/.github/workflows/build_wheels.yml

@Czaki
Copy link
Contributor

Czaki commented Jul 12, 2022

At first, did you check the last cibuilwheel release (2.8.0)?

You use custom code for cmake builds. Could you verify by some artifact which python executable is passed to cmake?

@jfowkes
Copy link
Author

jfowkes commented Jul 13, 2022

Just tested with the latest cibuildhweel 2.8.0 and I get the same issue:
https://github.com/ralna/GOFit/runs/7317739182

I'm using the pybind11 cmake script from https://github.com/pybind/cmake_example . Do you think this might be a pybind11 issue? @henryiii might be able to help.

I also get a similar issue on MacOS but Linux is fine for some reason:

$ unzip gofit-0.2-cp38-cp38-macosx_10_9_x86_64.whl 
Archive:  gofit-0.2-cp38-cp38-macosx_10_9_x86_64.whl
  inflating: gofit.cpython-39-darwin.so 

Will see if I can verify which python executable is passed to cmake.

@henryiii
Copy link
Contributor

henryiii commented Jul 13, 2022

Two problems: You are setting the old FindPythonLibs/FindPythonInterp variables (PYTHON_*) instead of the modern FindPython variables (Python_*), but you are using FindPython. And setup-python (starting with v4.1.0) has started setting the environment variables for FindPython, so it's getting the one we are setting. I think if we were to switch to update-environment: false (as in #1114), this would help a little. But you should be setting the FindPython variables via the command line variables in setup.py.

@jfowkes
Copy link
Author

jfowkes commented Jul 13, 2022

Ahh I see thank you so much! I missed the difference between PYTHON_* and Python_* in the pybind11 cmake example (even though it is documented in the example comments).

@jfowkes jfowkes closed this as completed Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants