-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 better python discovery #103007
Add better python discovery #103007
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
Somehow Rustbot didn't apply labels @rustbot label +A-bootstrap |
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.
I think we should have this same logic in the x
bash script; the two should always be in sync.
Thank you for reviewing. I do not know how to do this in bash, being exclusively a Windows user. |
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.
Maybe you can do it with compgen
? You can do version detection with BASH_VERSION
to see if this is a bash shell or not. https://stackoverflow.com/questions/511683/bash-get-list-of-commands-starting-with-a-given-string
Hope these changes are correct. |
Add new bootstrap entrypoints to triagebot They haven't been added yet, as seen in rust-lang#103007. r? `@jyn514`
Add new bootstrap entrypoints to triagebot They haven't been added yet, as seen in rust-lang#103007. r? ``@jyn514``
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.
This looks on the right track, thanks :)
Applied suggestions, hope this still works, especially for the bash script. @rustbot ready |
Ok, this looks good to me with albertlarsan68#1 merged :) If you could squash the commits afterwards that would also be nice: https://rustc-dev-guide.rust-lang.org/git.html |
`x.ps1` and `x` will now search for python executables like `python3.9` and `python3.10.exe`
678c2ce
to
c83ddae
Compare
Squashed and rebased. @rustbot ready |
Are those scripts used anywhere in CI? |
Yes, but because your new code comes last and bash is a dynamic language, it didn't fail on the invalid syntax because it found |
@bors r+ rollup |
Rollup of 10 pull requests Successful merges: - rust-lang#103007 (Add better python discovery) - rust-lang#103674 (Update note about unstable split-debuginfo flag.) - rust-lang#103692 (Add `walk_generic_arg`) - rust-lang#103749 (Reduce span of let else irrefutable_let_patterns warning) - rust-lang#103772 (better error for `rustc_strict_coherence` misuse) - rust-lang#103788 (Fix ICE in checking transmutability of NaughtyLenArray) - rust-lang#103793 (rustdoc: add margins to all impl-item toggles, not just methods) - rust-lang#103798 (interpret: move type_name implementation to an interpreter-independent helper file) - rust-lang#103799 (Remove generation of tuple struct fields in the search index) - rust-lang#103805 (Enable RUSTC_BOOTSTRAP for a few steps) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Thanks for sticking along with me |
Thanks for the PR! |
The Microsoft Store version of Python installs itself as
pythonM.m
, withM
being the major version andm
the minor.The
x.ps1
script will now search for python executables whose command matches the regexpython\d
.The
\d
at the end is to protect from using thepythonw
versions, which do not work as standard python.