Change:
//! We also don't use `pwsh` on Windows, because it is not installed by default; use std::{ <del> env, io, </del> <ins> env::{self, consts::EXE_EXTENSION}, io, </ins> path::Path, process::{self, Command, ExitStatus}, }; <ins> const PYTHON: &str = "python"; const PYTHON2: &str = "python2"; const PYTHON3: &str = "python3"; fn python() -> &'static str { let val = match env::var_os("PATH") { Some(val) => val, None => return PYTHON, }; let mut python2 = false; let mut python3 = false; for dir in env::split_paths(&val) { // `python` should always take precedence over python2 / python3 if it exists if dir.join(PYTHON).with_extension(EXE_EXTENSION).exists() { return PYTHON; } python2 |= dir.join(PYTHON2).with_extension(EXE_EXTENSION).exists(); python3 |= dir.join(PYTHON3).with_extension(EXE_EXTENSION).exists(); } // try 3 before 2 if python3 { PYTHON3 } else if python2 { PYTHON2 } else { // Python was not found on path, so exit eprintln!("Unable to find python in your PATH. Please check it is installed."); process::exit(1); } } </ins> #[cfg(windows)] fn x_command(dir: &Path) -> Command { let mut cmd = Command::new("powershell.exe");

Discussion:
Since , src/tools/x unconditionally looks for the shell scripts when running. That's good in most cases because it avoids having to run python. However, on old checkouts the shell scripts don't exist and it needs to fall back to using python. cc do you have time to fix this? <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim If it can wait for the weekend to pass, then yes. Anyone, feel free to claim of you can do it in the weekend
i could help! Could you give me some pointers on what needs to be done?
What you should do is re-add the code that was removed in , using it when the shell scripts are not found, but x.py is. You could even add an env var that forces the use of python, but that's a later step.
I see! Okay I'll give this a shot! But I may need more time than just the weekends cause I probably need some time to figure things out. But if it's urgent then feel free to unassign me claim
I don't think this is necessary, there shouldn't be any functionality that's available in python but not shell.
It is future-proofing for when python does get used only when building bootstrap, and the shell scripts won't be able to call python
That can be done with a function argument so it's not exposed to users.
Yes, it can work like this.
Hi ! Currently working on this. Could you list out the steps needed to replicate this issue so I could get a bit more context of the problem? Thank you!
install it from a current version of the repository, then check out any commit from before and run . It will says "x.py not found" even though it exists in the repository.
Err sorry, that was the commit that changes src/tools/x - you want the commit that initially the ./x and x.ps1 scripts.
One reason may be because they work on a pr that started before this commit, and that (miraculously) didn't conflict. Another reason would have been because the work was done on stable/beta, but I think the scripts are now on stable (correct me if I'm wrong)