-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use #!/usr/bin/env python3
instead of a bash script in the x.py shebang
#98716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting is not the right tradeoff, I think. This breaks things for (most) Linux and macOS users going forwards, since those platforms are deleting python
. The only motivation I can identify from your comment in #98474 (comment) is that the error message from Window's py
is not good while the error message on Linux/macOS are somewhat better, so we would prefer for the error messages to appear on Linux/macOS rather than Windows, not taking into account the size of each cohort.
We are already exploring other options in #98650, for example documenting that py
users will want to stick a py.ini in a particular directory which will make py x.py
and .\x.py
work with the python.org setup.
I don't think documentation is a good replacement for better error messages. If we can check in a file that does this automatically for all contributors, that seems good. Another reason for the revert is that your PR breaks existing workflows, while the state of affairs only breaks people starting out for the first time.
That sounds great. That's quite soon, I think it makes sense to revert until October and reevaluate then. |
I don't think this captures the dynamic situation around Everyone upgrading macOS or Linux today is getting broken. My PR makes them not get broken. I think leaving things in the previous state until October would not be net better. |
If people upgrade their distro, that's a choice they've opted into. If we change x.py, that's a change they just have to live with because they can't modify x.py without git constantly reporting modified files. I am not sure why there is an urgency to have this done now, instead of a few months from now. |
As someone who doesn't know Python well, and just spent the better part of an hour trying to debug why the my builds on windows once again had stopped working, running into this issue was particularly frustrating. Casting a value-judgement of different types of breaks is hard though, since no platform should feel second-class. But it appears we're faced with somewhat of a zero-sum game, and something's got to give. In general I think the right decision in the short term is to do whatever breaks the fewest number of people's workflows 1. But in the medium/long-term #94829 seems like the right way to categorically eliminate this problem all together. Footnotes
|
This is absolutely not the case. As discussed in #98650 and I mentioned above, It appears it'll be a matter of sticking an py.ini somewhere and then both |
I tend to agree that py vs. py -3 is hopefully not a huge negative for folks, and that the situation now is a net positive over the previous state (on macos and Linux things now work out of the box). For windows, I'd personally rather see us add a x.ps1 or similar as the interim or permanent solution which presumably works for ~everyone; it's pretty non-obvious that the previous state was actually better on Windows in my eyes. If it helps, we can post a blog or some other vehicle for getting information to users - pinning an issue to rust-lang/rust, for example, seems eminently reasonable. |
This bit I don't understand, #98474 (comment) doesn't show anything moving from no to yes on Windows, and The rest seems reasonable though - I'm going to see today if I can add some hack that makes the error from |
That's not quite a correct summary of the Windows behavior. I'm not sure what went wrong with @dtolnay's tests (one thing which catches me all the time: installing software does not update See also further information I've collected in #98650. Before (
|
From my side of the OS experience, it seems more reasonable to have It's also important to note that on Windows,
#98650 is a good candidate if we want to do this, and currently has the workaround ( Footnotes
|
I am leaning towards closing this in favor of #98747. |
I tend to agree. We should at least try this and see how well it works. Basically, revert the polyglott PR but also change the shebang to |
Co-authored-by: Ralf Jung <[email protected]>
I am happy to use python3 here instead. |
python3
not python
"#!/usr/bin/env python3
instead of a bash script in the x.py shebang
I've opened #99992, which is this PR plus shell scripts for people who don't have |
Going to go ahead and close in favor of #99992 which I think will likely land soon (just needs some CI checks added). |
This is a more ambitious version of rust-lang#98716. It still changes the shebang back to python3, for compatibility with non-Unix systems, but also adds alternative entrypoints for systems without `python3` installed. These scripts will be necessary for the rust entrypoint (rust-lang#94829), so I see little downside in adding them early.
…crum Add `x.sh` and `x.ps1` shell scripts This is a more ambitious version of rust-lang#98716. It still changes the x.py shebang back to python3, for compatibility with non-Unix systems, but also adds alternative entrypoints for systems without `python3` installed. These scripts will be necessary for the rust entrypoint (rust-lang#94829), so I see little downside in adding them early. I'll update the dev-guide to suggest using these instead of x.py once this is merged. Fixes rust-lang#98650 r? `@Mark-Simulacrum` cc `@dtolnay` `@CAD97` `@yoshuawuyts`
Reverts #98474. This uses Unix-isms that don't work on Windows, and break at least one python entrypoint (
py x.py
). Instead this uses#!/usr/bin/env python3
, which at least breaks fewer systems thanpython
alone.r? @Mark-Simulacrum cc @dtolnay @CAD97 @yoshuawuyts