Skip to content

Commit b86e8f2

Browse files
authored
Rollup merge of #85428 - leebradley:add-xpy-presetup-instructions, r=Mark-Simulacrum
Add x.py pre-setup instructions This change adds pre-setup instructions that outline how x.py requires python to be setup and how to work around the problem of x.py failing to locate python, especially now that Ubuntu 20.04's dropped default python command is causing people to encounter this issue regularly. See also: #71818
2 parents aef6848 + 4c12a5d commit b86e8f2

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,28 @@ Read ["Installation"] from [The Book].
1919
## Installing from Source
2020

2121
The Rust build system uses a Python script called `x.py` to build the compiler,
22-
which manages the bootstrapping process. More information about it can be found
23-
by running `./x.py --help` or reading the [rustc dev guide][rustcguidebuild].
22+
which manages the bootstrapping process. It lives in the root of the project.
23+
24+
The `x.py` command can be run directly on most systems in the following format:
25+
26+
```sh
27+
./x.py <subcommand> [flags]
28+
```
29+
30+
This is how the documentation and examples assume you are running `x.py`.
31+
32+
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:
33+
34+
```sh
35+
# Python 3
36+
python3 x.py <subcommand> [flags]
37+
38+
# Python 2.7
39+
python2.7 x.py <subcommand> [flags]
40+
```
41+
42+
More information about `x.py` can be found
43+
by running it with the `--help` flag or reading the [rustc dev guide][rustcguidebuild].
2444

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

0 commit comments

Comments
 (0)