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 Support #2658

Open
jsirois opened this issue Feb 4, 2025 · 2 comments
Open

Windows Support #2658

jsirois opened this issue Feb 4, 2025 · 2 comments

Comments

@jsirois
Copy link
Member

jsirois commented Feb 4, 2025

This tracks the second major effort at bringing Windows support to Pex - the 1st being in 2022. Notes will go here, issues may be broken out for actual issues.

The big change from the 1st effort will be to do this incrementally with a dedicated red CI shard that has diagnostics to quantify the redness. Hopefully watching the redness go from ~100% to 0% will be the difference that helps get this over the line.

@jsirois
Copy link
Member Author

jsirois commented Feb 4, 2025

Since Python 3.9 is now the current last supported release from CPython (see: https://devguide.python.org/versions/#python-release-cycle), I'll be starting there.

@jsirois
Copy link
Member Author

jsirois commented Feb 4, 2025

Known major issues:

jsirois added a commit to jsirois/pex that referenced this issue Feb 5, 2025
Working:
+ `py -mpex cowsay -ccowsay -- -t Moo!`
+ `py -mpex cowsay -ccowsay --venv -- -t Moo!`
+ `py -mpex cowsay -ccowsay -ocowsay.pex`
+ `py -mpex cowsay -ccowsay --venv -ocowsay.pex`
+ `py -mpex cowsay`
+ `py -mpex.cli cache {prune,purge}`

Next up:
+ Figure out tox on Windows.
+ Set up failing CI.

Work towards pex-tool#2658
jsirois added a commit to jsirois/pex that referenced this issue Feb 5, 2025
Working:
+ `py -mpex cowsay -ccowsay -- -t Moo!`
+ `py -mpex cowsay -ccowsay --venv -- -t Moo!`
+ `py -mpex cowsay -ccowsay -ocowsay.pex`
+ `py -mpex cowsay -ccowsay --venv -ocowsay.pex`
+ `py -mpex cowsay`
+ `py -mpex.cli cache {prune,purge}`

Next up:
+ Figure out tox on Windows.
+ Set up failing CI.

Work towards pex-tool#2658
jsirois added a commit to jsirois/pex that referenced this issue Feb 6, 2025
Although Pex still does not support Windows, this is work towards pex-tool#2658.

In particular, support is added for:
+ Shared and exclusive file locks.
+ Versions os os.link, os.symlink and os.rename that either work with
  Windows or work with most modern Windows setups.
+ Executable file detection that works for Windows.
+ Partial support for Windows venvs by accomodating its Scripts dir and
  console script style (.exe stubs).

Informal testing shows the following work:
+ `py -mpex cowsay`
+ `py -mpex cowsay -ccowsay {,--venv} -- -t Moo!`
+ `py -mpex cowsay -ccowsay {,--venv} -ocowsay.pex`
+ `py -mpex cowsay -ccowsay -ocowsay.pex --scie {eager,lazy}`
+ `py -mpex.cli cache {prune,purge}`

Important non-working things include:
+ The developer system: `tox ...` needs work most fundamentally.
+ Venv scripts / venv scies: Need support for Windows .exe stub scripts.
jsirois added a commit that referenced this issue Feb 6, 2025
Although Pex still does not support Windows, this is work towards #2658.

In particular, support is added for:
+ Shared and exclusive file locks.
+ Versions of `os.link`, `os.symlink` and `os.rename` that either work
  with Windows or work with most modern Windows setups.
+ Executable file detection that works for Windows.
+ Partial support for Windows venvs by accommodating its `Scripts` dir
  and console script style (`.exe` stubs).

Informal testing shows the following work:
+ `py -mpex cowsay`
+ `py -mpex cowsay -ccowsay {,--venv} -- -t Moo!`
+ `py -mpex cowsay -ccowsay {,--venv} -ocowsay.pex`
+ `py -mpex cowsay -ccowsay -ocowsay.pex --scie {eager,lazy}`
+ `py -mpex.cli cache {prune,purge}`

Important non-working things include:
+ The developer system: `tox ...` needs work most fundamentally.
+ Venv scripts / venv scies: Need support for Windows `.exe` stub
  scripts.
jsirois added a commit to jsirois/pex that referenced this issue Feb 6, 2025
Re-jigger tox and git to support Windows development / CI. As part of
this, fix `pex.pyenv` to work with `pyenv-win`.

More work towards pex-tool#2658.
jsirois added a commit that referenced this issue Feb 7, 2025
Re-jigger configuration for tox and git to support Windows dev / CI.
As part of this, fix `pex.pyenv` to work with `pyenv-win`.

More work towards #2658.

CF: tox-dev/tox#3136 (comment)
jsirois added a commit to jsirois/pex that referenced this issue Feb 7, 2025
Use the stubs generated by the uv project for this. The lineage extends
back to distutils through the Posy project. The API is setup and
manually tested to produce working windows scripts and the packaging
system is updated to embed these stubs in the Pex PEX, wheel and scies.
Actually using the API to create scripts when creating venvs on Windows
is still left to do.

Work towards pex-tool#2658.
jsirois added a commit to jsirois/pex that referenced this issue Feb 8, 2025
This is work towards pex-tool#2658 which will need to tackle falling back from
symlinks when there are insufficient permissions to create them.
jsirois added a commit that referenced this issue Feb 8, 2025
This is work towards #2658 which will need to tackle falling back from
symlinks when there are insufficient permissions to create them.
jsirois added a commit that referenced this issue Feb 8, 2025
Use the stubs generated by the uv project for this. The lineage extends
back to distutils through the Posy project. The API is setup and
manually tested to produce working Windows scripts and the packaging
system is updated to embed these stubs in the Pex PEX, wheel and scies.
Actually using the API to create scripts when creating venvs on Windows
is still left to do.

Work towards #2658.
jsirois added a commit to jsirois/pex that referenced this issue Feb 9, 2025
jsirois added a commit that referenced this issue Feb 9, 2025
jsirois added a commit to jsirois/pex that referenced this issue Feb 9, 2025
jsirois added a commit that referenced this issue Feb 9, 2025
This should allow highlighting Windows test status during the bring-up
period.

More work towards #2658.
jsirois added a commit to jsirois/pex that referenced this issue Feb 9, 2025
jsirois added a commit to jsirois/pex that referenced this issue Feb 10, 2025
jsirois added a commit to jsirois/pex that referenced this issue Feb 10, 2025
jsirois added a commit to jsirois/pex that referenced this issue Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant