Skip to content

Commit 9bf4036

Browse files
committed
readme: update section on how to run x.py
1 parent d9ee0f4 commit 9bf4036

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

README.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,23 @@ Read ["Installation"] from [The Book].
2020
The Rust build system uses a Python script called `x.py` to build the compiler,
2121
which manages the bootstrapping process. It lives at the root of the project.
2222

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

2525
```sh
2626
./x.py <subcommand> [flags]
2727
```
2828

29-
This is how the documentation and examples assume you are running `x.py`.
30-
31-
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:
29+
This is how the documentation and examples assume you are running `x.py`. Some alternative ways are:
3230

3331
```sh
34-
# Python 3
35-
python3 x.py <subcommand> [flags]
32+
# On a Unix shell if you don't have the necessary `python3` command
33+
./x <subcommand> [flags]
34+
35+
# On the Windows Command Prompt (if .py files are configured to run Python)
36+
x.py <subcommand> [flags]
3637

37-
# Python 2.7
38-
python2.7 x.py <subcommand> [flags]
38+
# You can also run Python yourself, e.g.:
39+
python x.py <subcommand> [flags]
3940
```
4041

4142
More information about `x.py` can be found

src/ci/run.sh

+1-9
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ fi
4545
ci_dir=`cd $(dirname $0) && pwd`
4646
source "$ci_dir/shared.sh"
4747

48-
if command -v python > /dev/null; then
49-
PYTHON="python"
50-
elif command -v python3 > /dev/null; then
51-
PYTHON="python3"
52-
else
53-
PYTHON="python2"
54-
fi
55-
5648
if ! isCI || isCiBranch auto || isCiBranch beta || isCiBranch try || isCiBranch try-perf; then
5749
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
5850
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.metrics"
@@ -201,7 +193,7 @@ if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then
201193
mv metrics.json build
202194
fi
203195

204-
CARGO_INCREMENTAL=0 $PYTHON ../x.py check
196+
CARGO_INCREMENTAL=0 ../x check
205197
fi
206198

207199
sccache --show-stats || true

0 commit comments

Comments
 (0)