Home Explore Blog CI



rustc

1st chunk of `src/building/build-install-distribution-artifacts.md`
fc2baba7c9dedd3584702a304355345e8296acec93c1ff9000000001000003ea
# Build distribution artifacts

You might want to build and package up the compiler for distribution.
You’ll want to run this command to do it:

```bash
./x dist
```

# Install from source

You might want to prefer installing Rust (and tools configured in your configuration)
by building from source. If so, you want to run this command:

```bash
./x install
```

   Note: If you are testing out a modification to a compiler, you might
   want to build the compiler (with `./x build`) then create a toolchain as
   discussed in [here][create-rustup-toolchain].

   For example, if the toolchain you created is called "foo", you would then
   invoke it with `rustc +foo ...` (where ... represents the rest of the arguments).

Instead of installing Rust (and tools in your config file) globally, you can set `DESTDIR`
environment variable to change the installation path. If you want to set installation paths
more dynamically, you should prefer [install options] in your config file to achieve that.


Title: Building and Installing Rust from Source
Summary
This section describes how to build distribution artifacts and install Rust from source using the `./x dist` and `./x install` commands, respectively. It also explains how to create a custom toolchain for testing compiler modifications and how to customize the installation path using the `DESTDIR` environment variable or install options in the config file.