Commit Graph

12 Commits

Author SHA1 Message Date
jyn 2cf54e9f99 use `&` instead of start-process in x.ps1
start-process has weird parsing rules and buggy behavior. we've already had to work around them several times, and the workarounds were not complete.
i wonder who could have added it HMMMMMM
```
PS C:\Users\jyn\src\rust> git log --reverse -S Start-Process x.ps1
commit 775c3c0493
Author: Jynn Nelson <github@jyn.dev>
Date:   Sun Jul 31 14:02:31 2022 -0500

    Add `x.sh` and `x.ps1` shell scripts
```

the latest broken thing is trailing backslashes:
```
$ x.ps1 t .\tests\ui\error-emitter\
```
would be transformed into
```
['t', '.\\tests\\ui\\error-emitter"']
```

rather than trying to hack around that too, abandon start-process altogether and just use `&`.
2023-12-09 09:46:16 -05:00
Sean Cross 1f9f041c35 x.ps1: remove the check for Python from Windows Store
When installing Python from the Windows Store, a copy of `python.exe` is
installed inder the Microsoft directory in the user's local AppData
directory. Currently, `x.ps1` checks for this file, because by default
running `python.exe` opens a link to the Microsoft Store rather than
running Python.

Once the user installs Python, however, this contains a valid
interpreter. Unfortuantely, `x.ps1` can't tell the difference between a
legitimate Python install and the stub.

Remove the check, as it makes it impossible to use the official version
from Microsoft once it has been installed.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-10-23 13:25:48 +08:00
jyn 664ffa419e Don't print "x.ps1"
This is left over from adding `Get-Command -syntax`; it's not helpful.
2023-06-24 14:44:53 -05:00
jyn fa7e965bf0 Give a better error on Windows if python isn't installed
Before:

```
PS C:\Users\vboxuser\rust> ./x
x.ps1

PS C:\Users\vboxuser\rust>
```

After:
```
PS C:\Users\vboxuser\rust> ./x
x.ps1

C:\Users\vboxuser\rust\x.ps1 : C:\Users\vboxuser\rust\x.ps1: error: did not find python installed
help: consider installing it from https://www.python.org/downloads/windows/
At line:1 char:1
+ ./x
+ ~~~
    + CategoryInfo          : NotInstalled: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,x.ps1
```

The existing message from the shell script is already decent and I decided not to change it:
```
$ ./x
Python was not found but can be installed from the Microsoft Store: ms-windows-store://pdp/?productid=9NJ46SX7X90P
```
2023-06-24 14:44:53 -05:00
Matthias Krüger 60db448790
Rollup merge of #111151 - ozkanonur:syntax-check-on-bootstrap-scripts, r=Mark-Simulacrum
check bootstrap scripts syntax

Fails bootstrapping if `x`/`x.ps1` scripts are not valid. Currently, it keeps executing lines until the invalid one.
2023-05-06 23:32:01 +02:00
ozkanonur eea6202c24 check bootstrap scripts syntax
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-03 20:32:39 +03:00
Chris Denton 9ea7142a01
Return error code from x.ps1 2023-05-03 18:21:36 +01:00
Chris Denton 96501bdbe4
Powershell: Create a `Start-Process` wrapper 2022-12-28 19:41:42 +00:00
Chris Denton 874cefad9b
Powershell: Use `WaitForExit` instead of `-Wait` 2022-12-28 15:41:46 +00:00
Albert Larsan c83ddaef94
Add better python discovery
`x.ps1` and `x` will now search for python executables like `python3.9`
and `python3.10.exe`
2022-10-31 08:33:24 +01:00
Josh Stone de8dedb0a5 Use an extensionless `x` script for non-Windows 2022-08-12 15:39:26 -07:00
Joshua Nelson 775c3c0493 Add `x.sh` and `x.ps1` shell scripts
This is a more ambitious version of https://github.com/rust-lang/rust/pull/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 (#94829), so I see
little downside in adding them early.
2022-08-08 14:48:11 -05:00