+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
+
+### Building on a Unix-like system
+1. Make sure you have installed the dependencies:
+
+ * `g++` 5.1 or later or `clang++` 3.5 or later
+ * `python` 3 or 2.7
+ * GNU `make` 3.81 or later
+ * `cmake` 3.13.4 or later
+ * `ninja`
+ * `curl`
+ * `git`
+ * `ssl` which comes in `libssl-dev` or `openssl-devel`
+ * `pkg-config` if you are compiling on Linux and targeting Linux
+
+2. Clone the [source] with `git`:
+
+ ```sh
+ git clone https://github.com/rust-lang/rust.git
+ cd rust
+ ```
+
+[source]: https://github.com/rust-lang/rust
+
+3. Configure the build settings:
+
+ 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.
+
+ ```sh
+ cp config.toml.example config.toml
+ ```
+
+ If you plan to use `x.py install` to create an installation, it is recommended
+ that you set the `prefix` value in the `[install]` section to a directory.
+
+ Create install directory if you are not installing in default directory.
+
+4. Build and install:
+
+ ```sh
+ ./x.py build && ./x.py install
+ ```
+
+ 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.
+
+[Cargo]: https://github.com/rust-lang/cargo
+
+### Building on Windows
+
+There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by
+Visual Studio, and the GNU ABI used by the GCC toolchain. Which version of Rust
+you need depends largely on what C/C++ libraries you want to interoperate with:
+for interop with software produced by Visual Studio use the MSVC build of Rust;
+for interop with GNU software built using the MinGW/MSYS2 toolchain use the GNU
+build.
+
+#### MinGW
+
+[MSYS2][msys2] can be used to easily build Rust on Windows:
+
+[msys2]: https://www.msys2.org/
+
+1. Grab the latest [MSYS2 installer][msys2] and go through the installer.
+
+2. Run `mingw32_shell.bat` or `mingw64_shell.bat` from wherever you installed
+ MSYS2 (i.e. `C:\msys64`), depending on whether you want 32-bit or 64-bit
+ Rust. (As of the latest version of MSYS2 you have to run `msys2_shell.cmd
+ -mingw32` or `msys2_shell.cmd -mingw64` from the command line instead)
+
+3. From this terminal, install the required tools:
+
+ ```sh
+ # Update package mirrors (may be needed if you have a fresh install of MSYS2)
+ pacman -Sy pacman-mirrors
+
+ # Install build tools needed for Rust. If you're building a 32-bit compiler,
+ # then replace "x86_64" below with "i686". If you've already got git, python,
+ # or CMake installed and in PATH you can remove them from this list. Note
+ # that it is important that you do **not** use the 'python2', 'cmake' and 'ninja'
+ # packages from the 'msys2' subsystem. The build has historically been known
+ # to fail with these packages.
+ pacman -S git \
+ make \
+ diffutils \
+ tar \
+ mingw-w64-x86_64-python \
+ mingw-w64-x86_64-cmake \
+ mingw-w64-x86_64-gcc \
+ mingw-w64-x86_64-ninja
+ ```
+
+4. Navigate to Rust's source code (or clone it), then build it: