update `x install` documentation (#2084)

This commit is contained in:
Onur Özkan 2024-10-03 19:43:40 +03:00 committed by GitHub
parent 5e8e9cc899
commit 454dc454c1
1 changed files with 14 additions and 12 deletions

View File

@ -7,23 +7,25 @@ Youll want to run this command to do it:
./x dist ./x dist
``` ```
# Install distribution artifacts # Install from source
If youve built a distribution artifact you might want to install it and You might want to prefer installing Rust (and tools configured in your configuration)
test that it works on your target system. Youll want to run this command: by building from source. If so, you want to run this command:
```bash ```bash
./x install ./x install
``` ```
Note: If you are testing out a modification to a compiler, you Note: If you are testing out a modification to a compiler, you might
might want to use it to compile some project. want to build the compiler (with `./x build`) then create a toolchain as
Usually, you do not want to use `./x install` for testing. discussed in [here][create-rustup-toolchain].
Rather, you should create a toolchain as discussed in
[here][create-rustup-toolchain].
For example, if the toolchain you created is called foo, you For example, if the toolchain you created is called "foo", you would then
would then invoke it with `rustc +foo ...` (where ... represents invoke it with `rustc +foo ...` (where ... represents the rest of the arguments).
the rest of the arguments).
[create-rustup-toolchain]: ./how-to-build-and-run.md#creating-a-rustup-toolchain 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.
[create-rustup-toolchain]: ./how-to-build-and-run.md#creating-a-rustup-toolchain
[install options]: https://github.com/rust-lang/rust/blob/f7c8928f035370be33463bb7f1cd1aeca2c5f898/config.example.toml#L422-L442