Closed
Description
I tried this code:
powershell .\x.ps1 test
I expected to see this happen: Rust would build
Instead, this happened: x.ps1 complained that python is not installed
Meta
rustc --version --verbose
:
rustc 1.75.0-nightly (cae0791da 2023-10-05)
binary: rustc
commit-hash: cae0791da47bb01f16885eb233dcd66b0093a6e1
commit-date: 2023-10-05
host: x86_64-pc-windows-msvc
release: 1.75.0-nightly
LLVM version: 17.0.2
Backtrace
[12:45:06 pm] E:/Code/Xous/rust-condvar-fixes> powershell .\x.ps1 test library/std
E:\Code\Xous\rust-condvar-fixes\x.ps1 : E:\Code\Xous\rust-condvar-fixes\x.ps1: error: did not find python installed
help: consider installing it from https://www.python.org/downloads/
At line:1 char:1
+ .\x.ps1 test library/std
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotInstalled: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,x.ps1
[12:45:15 pm] E:/Code/Xous/rust-condvar-fixes>
Additional Info
This works just fine if I comment out lines 20-24 of x.ps1
:
diff --git a/x.ps1 b/x.ps1
index 55f99901645..eae1a2cb399 100755
--- a/x.ps1
+++ b/x.ps1
@@ -17,11 +17,6 @@ foreach ($arg in $args) {
function Get-Application($app) {
$cmd = Get-Command $app -ErrorAction SilentlyContinue -CommandType Application | Select-Object -First 1
- if ($cmd.source -match '.*AppData\\Local\\Microsoft\\WindowsApps\\.*exe') {
- # Windows for some reason puts a `python3.exe` executable in PATH that just opens the windows store.
- # Ignore it.
- return $false
- }
return $cmd
}
I am using Python as installed from the Microsoft Store, which as far as I know is the recommended way to run Python on Windows:
[12:47:43 pm] E:/Code/Xous/rust-condvar-fixes> get-command "Python*"
CommandType Name Version Source
----------- ---- ------- ------
Application python.exe 0.0.0.0 C:\Users\Sean\AppData\Local\Microsoft\WindowsApps\py…
Application python3.10.exe 0.0.0.0 C:\Users\Sean\AppData\Local\Microsoft\WindowsApps\py…
Application python3.exe 0.0.0.0 C:\Users\Sean\AppData\Local\Microsoft\WindowsApps\py…
Application pythonw.exe 0.0.0.0 C:\Users\Sean\AppData\Local\Microsoft\WindowsApps\py…
Application pythonw3.10.exe 0.0.0.0 C:\Users\Sean\AppData\Local\Microsoft\WindowsApps\py…
Application pythonw3.exe 0.0.0.0 C:\Users\Sean\AppData\Local\Microsoft\WindowsApps\py…
[12:47:52 pm] E:/Code/Xous/rust-condvar-fixes> python3 --version
Python 3.10.11
[12:48:38 pm] E:/Code/Xous/rust-condvar-fixes> python --version
Python 3.10.11
[12:48:41 pm] E:/Code/Xous/rust-condvar-fixes>