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

Fix bootstrap install script on windows #1162

Merged
merged 3 commits into from
Feb 3, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Jan 29, 2024

Windows doesn't support symlinks, doesn't use a bin directory and all pythons are called python.exe.

Note that this is still broken, .\bin\python3.10.13 is missing its .exe extension and renaming it to .\bin\python3.10.13.exe makes it complain about not finding python310.dll.

Windows doesn't support symlinks, doesn't use a `bin` directory and all pythons are called `python.exe`.

Note that this is still broken, `.\bin\python3.10.13` is missing its .exe extension and renaming it to `.\bin\python3.10.13.exe` makes it complain about not finding python310.dll.
@konstin konstin requested a review from zanieb January 29, 2024 08:59
@konstin
Copy link
Member Author

konstin commented Jan 29, 2024

I could link the dll to the same directory, but that doesn't work with different patch versions since the dlls have only major and minor version.

@zanieb
Copy link
Member

zanieb commented Jan 29, 2024

How are we supposed to register new Python versions?

@konstin
Copy link
Member Author

konstin commented Jan 29, 2024

You have to register them in the windows registry (PEP 514)

@konstin
Copy link
Member Author

konstin commented Jan 29, 2024

An alternative would be a nested PATH:

  • bin
    • 3.8.18
      • python.exe
    • 3.12.1
      • python.exe

@zanieb
Copy link
Member

zanieb commented Jan 29, 2024

How does discovery work with the nested path?

@konstin
Copy link
Member Author

konstin commented Jan 29, 2024

We would have to implement this ourselves, i don't know a way that works with which.

I think the lack of a PATH that can be used with different versions is the main reason why py, the python launcher for windows, is shipped by default on windows; There's isn't really another good to launch a specific python version (without knowing the full path ahead of time)

@zanieb
Copy link
Member

zanieb commented Jan 29, 2024

We would have to implement this ourselves

I mean I guess I'm fine with having the Interpreter::find_executable utility do a special scan of the PUFFIN_PYTHON_PATH on Windows for now?

@konstin
Copy link
Member Author

konstin commented Feb 3, 2024

@zanieb Can we still merge this? Currently the script doesn't run at all (no symlinking) and this also adds pipx support

@konstin konstin merged commit 0199ad6 into main Feb 3, 2024
5 checks passed
@konstin konstin deleted the konsti/fix-bootstrap-install-script-windows branch February 3, 2024 16:30
Comment on lines +2 to +7
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "zstandard==0.22.0",
# ]
# ///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this comment?
Does pipx support this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems I used old pipx. Now I can ran it.
I understand this is PEP 723.

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.

3 participants