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

Add python3.exe symlink on windows builds. #917

Merged
merged 6 commits into from Nov 14, 2021
Merged

Add python3.exe symlink on windows builds. #917

merged 6 commits into from Nov 14, 2021

Conversation

sbrodehl
Copy link
Contributor

@sbrodehl sbrodehl commented Nov 12, 2021

This PR adds a python3.exe link pointing to python.exe on windows, closes #915.

@henryiii
Copy link
Contributor

henryiii commented Nov 12, 2021

Hmm, our Nuget Python should(?) be first in the path, and it looks like it does include python3. Is the bug you are seeing true on all Python versions? Also, maybe you could print out the path?

@sbrodehl
Copy link
Contributor Author

sbrodehl commented Nov 13, 2021

I can reproduce the error very well with different cpython versions on different windows images on Github Actions.
See https://github.com/lukeparser/lukeparser/runs/4198732270.


Here are some infos for cp10-* on windows-2016:

PATH

  • C:\cibw\python\python.3.10.0\tools
  • ...
  • C:\hostedtoolcache\windows\Python\3.10.0\x64\Scripts
  • ...

where python

  • C:\cibw\python\python.3.10.0\tools\python.exe
  • C:\hostedtoolcache\windows\Python\3.10.0\x64\python.exe
  • C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe
  • C:\ProgramData\Chocolatey\bin\python.exe

where python3

  • C:\hostedtoolcache\windows\Python\3.10.0\x64\python3.exe
  • C:\hostedtoolcache\windows\Python\3.7.9\x64\python3.exe

which python

  • /c/cibw/python/python.3.10.0/tools/python

which python3

  • /c/hostedtoolcache/windows/Python/3.10.0/x64/python3

As far I can tell, C:\cibw\python\python.3.10.0\tools\python3.exe is missing and a symlink should be possible.


As far as Azure builds go (here cp36 x86 on windows-2016):

2021-11-13T13:57:57.1464359Z ##[group]Installing Python cp36...
2021-11-13T13:57:57.1465470Z + C:\cibw\nuget.exe install pythonx86 -Version 3.6.8 -FallbackSource https://api.nuget.org/v3/index.json -OutputDirectory C:\cibw\python
2021-11-13T13:57:57.1469502Z Package "pythonx86.3.6.8" is already installed.
Debug output:
2021-11-13T13:57:57.1470172Z C:\cibw\python\pythonx86.3.6.8\tools\python3.exe already exists:
2021-11-13T13:57:57.1470983Z ['python.exe', 'python3.dll', 'python3.exe', 'python36.dll', 'pythonw.exe', 'vcruntime140.dll']

The pythonx86.3.6.8 package is already installed, I currently don't know where the package is installed from and how python3.exe is created, maybe the Use Python Version task also uses nuget and creates a symlink?
Also I don't understand what the windows builds windows_36 and windows_38 are testing, different host python versions? Different cpython build versions?


Edit: What is also interesting: The Test cibuildwheel on windows-latest here https://github.com/pypa/cibuildwheel/runs/4198728005?check_suite_focus=true is completed successfully.
It seems like the symlink-creation problem only occurs on Azure?

@henryiii
Copy link
Contributor

henryiii commented Nov 13, 2021

Oops, sorry, one of us has to push a button to get the GHA builds to go! Sorry! I know GitHub Actions makes a python3 symlink (I requested it, actually), but why is that one overriding the local symlink? The path should be setup correctly so that we override any external environment. Oh, wait a minute, I might know what's happening. If Azure is using nuget to set up Python instead of the Action, I bet they added the python3 symlink manually there too when I asked for it in Actions. Therefore NuGet doesn't come with it by default (though IMO it should), so that's why we need to add it. Okay, conditional adding is fine with me, as long as we know why it's needed!

@sbrodehl
Copy link
Contributor Author

Great to see this resolved!

On a side note: GHA builds will be triggered without your consent by pre-commit-ci commits, don't know if this is a bug, or a feature. (See 02c8633 above)

cibuildwheel/windows.py Outdated Show resolved Hide resolved
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
@henryiii henryiii merged commit 53251c7 into pypa:main Nov 14, 2021
@sbrodehl sbrodehl deleted the sbrodehl-python3.exe branch November 14, 2021 16:36
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

Successfully merging this pull request may close these issues.

Windows: python and python3 don't point to the same installation
3 participants