Skip to content
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

Move some docs from the README to the dev-guide #113008

Merged
merged 4 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,13 @@ format:
```

This is how the documentation and examples assume you are running `x.py`.
Some alternative ways are:

```sh
# On a Unix shell if you don't have the necessary `python3` command
./x <subcommand> [flags]

# On the Windows Command Prompt (if .py files are configured to run Python)
x.py <subcommand> [flags]

# You can also run Python yourself, e.g.:
python x.py <subcommand> [flags]
```
See the [rustc dev guide][rustcguidebuild] if this does not work on your platform.

More information about `x.py` can be found by running it with the `--help` flag
or reading the [rustc dev guide][rustcguidebuild].

[gettingstarted]: https://rustc-dev-guide.rust-lang.org/getting-started.html
[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html
[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#what-is-xpy

### Dependencies

Expand Down
8 changes: 4 additions & 4 deletions src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ pub fn check(
for &(name, _) in gate_untested.iter() {
println!("Expected a gate test for the feature '{name}'.");
println!(
"Hint: create a failing test file named 'feature-gate-{}.rs'\
\n in the 'ui' test suite, with its failures due to\
\n missing usage of `#![feature({})]`.",
name, name
"Hint: create a failing test file named 'tests/ui/feature-gates/feature-gate-{}.rs',\
\n with its failures due to missing usage of `#![feature({})]`.",
name.replace("_", "-"),
name
);
println!(
"Hint: If you already have such a test and don't want to rename it,\
Expand Down
14 changes: 11 additions & 3 deletions x.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$ErrorActionPreference = "Stop"

# syntax check
Get-Command -syntax ${PSCommandPath}
Get-Command -syntax ${PSCommandPath} >$null

$xpy = Join-Path $PSScriptRoot x.py
# Start-Process for some reason splits arguments on spaces. (Isn't powershell supposed to be simpler than bash?)
Expand All @@ -16,7 +16,13 @@ foreach ($arg in $args) {
}

function Get-Application($app) {
return Get-Command $app -ErrorAction SilentlyContinue -CommandType Application
$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
}

function Invoke-Application($application, $arguments) {
Expand Down Expand Up @@ -51,5 +57,7 @@ if (($null -ne $found) -and ($found.Length -ge 1)) {
Invoke-Application $python $xpy_args
}

Write-Error "${PSCommandPath}: error: did not find python installed"
$msg = "${PSCommandPath}: error: did not find python installed`n"
$msg += "help: consider installing it from https://www.python.org/downloads/"
Write-Error $msg -Category NotInstalled
Exit 1