[Rust]: https://www.rust-lang.org
-**Note: this README is for _users_ rather than _contributors_.
+**Note: this README is for _users_ rather than _contributors_.**
If you wish to _contribute_ to the compiler, you should read [CONTRIBUTING.md](CONTRIBUTING.md) instead.
## Quick Start
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
The Rust build system uses a file named `config.toml` in the root of the
source tree to determine various configuration settings for the build.
- Copy the default `config.toml.example` to `config.toml` to get started.
+ Set up the defaults intended for distros to get started. You can see a full list of options
+ in `config.toml.example`.
```sh
- cp config.toml.example config.toml
+ printf 'profile = "user" \nchangelog-seen = 2 \n' > config.toml
```
If you plan to use `x.py install` to create an installation, it is recommended
When complete, `./x.py install` will place several programs into
`$PREFIX/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
- API-documentation tool. This install does not include [Cargo],
- Rust's package manager. To build and install Cargo, you may
- run `./x.py install cargo` or set the `build.extended` key in
- `config.toml` to `true` to build and install all tools.
+ API-documentation tool. If you've set `profile = "user"` or `build.extended = true`, it will
+ also include [Cargo], Rust's package manager.
[Cargo]: https://github.com/rust-lang/cargo
- `x86_64-pc-windows-msvc`
The build triple can be specified by either specifying `--build=<triple>` when
-invoking `x.py` commands, or by copying the `config.toml` file (as described
+invoking `x.py` commands, or by creating a `config.toml` file (as described
in [Installing From Source](#installing-from-source)), and modifying the
`build` option under the `[build]` section.
make && sudo make install
```
-When using the configure script, the generated `config.mk` file may override the
-`config.toml` file. To go back to the `config.toml` file, delete the generated
-`config.mk` file.
+`configure` generates a `config.toml` which can also be used with normal `x.py` invocations.
## Building Documentation