@@ -62,7 +62,7 @@ if you want to learn more about `x.py`, [read this chapter][bootstrap].
6262The ` x.py ` command can be run directly on most Unix systems in the following format:
6363
6464``` sh
65- ./x.py < subcommand> [flags]
65+ ./x < subcommand> [flags]
6666```
6767
6868This is how the documentation and examples assume you are running ` x.py ` .
@@ -110,7 +110,7 @@ You can install it with `cargo install --path src/tools/x`.
110110
111111## Create a ` config.toml `
112112
113- To start, run ` ./x.py setup ` and select the ` compiler ` defaults. This will do some initialization
113+ To start, run ` ./x setup ` and select the ` compiler ` defaults. This will do some initialization
114114and create a ` config.toml ` for you with reasonable defaults. If you use a different default (which
115115you'll likely want to do if you want to contribute to an area of rust other than the compiler, such
116116as rustdoc), make sure to read information about that default (located in ` src/bootstrap/defaults ` )
@@ -120,24 +120,24 @@ Alternatively, you can write `config.toml` by hand. See `config.example.toml` fo
120120settings and explanations of them. See ` src/bootstrap/defaults ` for common settings to change.
121121
122122If you have already built ` rustc ` and you change settings related to LLVM, then you may have to
123- execute ` rm -rf build ` for subsequent configuration changes to take effect. Note that `./x.py
123+ execute ` rm -rf build ` for subsequent configuration changes to take effect. Note that `./x
124124clean` will not cause a rebuild of LLVM.
125125
126126## Common ` x.py ` commands
127127
128128Here are the basic invocations of the ` x.py ` commands most commonly used when
129129working on ` rustc ` , ` std ` , ` rustdoc ` , and other tools.
130130
131- | Command | When to use it |
132- | --- | --- |
133- | ` ./x.py check ` | Quick check to see if most things compile; [ rust-analyzer can run this automatically for you] [ rust-analyzer ] |
134- | ` ./x.py build ` | Builds ` rustc ` , ` std ` , and ` rustdoc ` |
135- | ` ./x.py test ` | Runs all tests |
136- | ` ./x.py fmt ` | Formats all code |
131+ | Command | When to use it |
132+ | ----------- | --------------------------------------------------------------------------------------------------------- --- |
133+ | ` ./x check ` | Quick check to see if most things compile; [ rust-analyzer can run this automatically for you] [ rust-analyzer ] |
134+ | ` ./x build ` | Builds ` rustc ` , ` std ` , and ` rustdoc ` |
135+ | ` ./x test ` | Runs all tests |
136+ | ` ./x fmt ` | Formats all code |
137137
138138As written, these commands are reasonable starting points. However, there are
139139additional options and arguments for each of them that are worth learning for
140- serious development work. In particular, ` ./x.py build ` and ` ./x.py test `
140+ serious development work. In particular, ` ./x build ` and ` ./x test `
141141provide many ways to compile or test a subset of the code, which can save a lot
142142of time.
143143
@@ -160,7 +160,7 @@ Once you've created a `config.toml`, you are now ready to run
160160probably the best "go to" command for building a local compiler:
161161
162162``` bash
163- ./x.py build library
163+ ./x build library
164164```
165165
166166This may * look* like it only builds the standard library, but that is not the case.
@@ -183,10 +183,10 @@ see [the section on avoiding rebuilds for std][keep-stage].
183183
184184Sometimes you don't need a full build. When doing some kind of
185185"type-based refactoring", like renaming a method, or changing the
186- signature of some function, you can use ` ./x.py check ` instead for a much faster build.
186+ signature of some function, you can use ` ./x check ` instead for a much faster build.
187187
188188Note that this whole command just gives you a subset of the full ` rustc `
189- build. The ** full** ` rustc ` build (what you get with `./x.py build
189+ build. The ** full** ` rustc ` build (what you get with `./x build
190190--stage 2 compiler/rustc`) has quite a few more steps:
191191
192192- Build ` rustc ` with the stage1 compiler.
@@ -203,7 +203,7 @@ the compiler unless you are planning to use a recently added nightly feature.
203203Instead, you can just build using the bootstrap compiler.
204204
205205``` bash
206- ./x.py build --stage 0 library
206+ ./x build --stage 0 library
207207```
208208
209209If you choose the ` library ` profile when running ` x.py setup ` , you can omit ` --stage 0 ` (it's the
@@ -256,7 +256,7 @@ custom toolchain for a project (e.g. via `rustup override set stage1`) you may
256256want to build this component:
257257
258258``` bash
259- ./x.py build proc-macro-srv-cli
259+ ./x build proc-macro-srv-cli
260260```
261261
262262## Building targets for cross-compilation
@@ -267,7 +267,7 @@ For example, if your host platform is `x86_64-unknown-linux-gnu`
267267and your cross-compilation target is ` wasm32-wasi ` , you can build with:
268268
269269``` bash
270- ./x.py build --target x86_64-unknown-linux-gnu --target wasm32-wasi
270+ ./x build --target x86_64-unknown-linux-gnu --target wasm32-wasi
271271```
272272
273273Note that if you want the resulting compiler to be able to build crates that
@@ -309,18 +309,18 @@ Here are a few other useful `x.py` commands. We'll cover some of them in detail
309309in other sections:
310310
311311- Building things:
312- - ` ./x.py build ` – builds everything using the stage 1 compiler,
312+ - ` ./x build ` – builds everything using the stage 1 compiler,
313313 not just up to ` std `
314- - ` ./x.py build --stage 2 ` – builds everything with the stage 2 compiler including
314+ - ` ./x build --stage 2 ` – builds everything with the stage 2 compiler including
315315 ` rustdoc `
316316- Running tests (see the [ section on running tests] ( ../tests/running.html ) for
317317 more details):
318- - ` ./x.py test library/std ` – runs the unit tests and integration tests from ` std `
319- - ` ./x.py test tests/ui ` – runs the ` ui ` test suite
320- - ` ./x.py test tests/ui/const-generics ` - runs all the tests in
321- the ` const-generics/ ` subdirectory of the ` ui ` test suite
322- - ` ./x.py test tests/ui/const-generics/const-types.rs ` - runs
323- the single test ` const-types.rs ` from the ` ui ` test suite
318+ - ` ./x test library/std ` – runs the unit tests and integration tests from ` std `
319+ - ` ./x test tests/ui ` – runs the ` ui ` test suite
320+ - ` ./x test tests/ui/const-generics ` - runs all the tests in
321+ the ` const-generics/ ` subdirectory of the ` ui ` test suite
322+ - ` ./x test tests/ui/const-generics/const-types.rs ` - runs
323+ the single test ` const-types.rs ` from the ` ui ` test suite
324324
325325### Cleaning out build directories
326326
@@ -330,7 +330,7 @@ you should file a bug as to what is going wrong. If you do need to clean
330330everything up then you only need to run one command!
331331
332332``` bash
333- ./x.py clean
333+ ./x clean
334334```
335335
336336` rm -rf build ` works too, but then you have to rebuild LLVM, which can take
0 commit comments