Skip to content

Commit

Permalink
Rollup merge of #106146 - kadiwa4:readme-x-py, r=jyn514
Browse files Browse the repository at this point in the history
Readme: update section on how to run `x.py`

`./x.py` currently looks for `python3` (not `python`) in the `PATH`. I updated that in the readme and also mentioned a convenient way to run `x.py` on Windows. The PowerShell script is actually quite inconvenient to use (and not really necessary on the `cmd.exe` prompt) so I left it out.

In addition I adapted `./x` in one of the CI scripts.
  • Loading branch information
matthiaskrgr authored Dec 27, 2022
2 parents b8d71fc + 9bf4036 commit bb08f37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ Read ["Installation"] from [The Book].
The Rust build system uses a Python script called `x.py` to build the compiler,
which manages the bootstrapping process. It lives at the root of the project.

The `x.py` command can be run directly on most systems in the following format:
The `x.py` command can be run directly on most Unix systems in the following format:

```sh
./x.py <subcommand> [flags]
```

This is how the documentation and examples assume you are running `x.py`.

Systems such as Ubuntu 20.04 LTS do not create the necessary `python` command by default when Python is installed that allows `x.py` to be run directly. In that case, you can either create a symlink for `python` (Ubuntu provides the `python-is-python3` package for this), or run `x.py` using Python itself:
This is how the documentation and examples assume you are running `x.py`. Some alternative ways are:

```sh
# Python 3
python3 x.py <subcommand> [flags]
# 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]

# Python 2.7
python2.7 x.py <subcommand> [flags]
# You can also run Python yourself, e.g.:
python x.py <subcommand> [flags]
```

More information about `x.py` can be found
Expand Down
10 changes: 1 addition & 9 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ fi
ci_dir=`cd $(dirname $0) && pwd`
source "$ci_dir/shared.sh"

if command -v python > /dev/null; then
PYTHON="python"
elif command -v python3 > /dev/null; then
PYTHON="python3"
else
PYTHON="python2"
fi

if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try || isCiBranch try-perf; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.metrics"
Expand Down Expand Up @@ -201,7 +193,7 @@ if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then
mv metrics.json build
fi

CARGO_INCREMENTAL=0 $PYTHON ../x.py check
CARGO_INCREMENTAL=0 ../x check
fi

sccache --show-stats || true

0 comments on commit bb08f37

Please sign in to comment.