Skip to content

Commit d3034ae

Browse files
sslime336tshepang
authored andcommitted
Change ./x.py into ./x
1 parent 7267158 commit d3034ae

29 files changed

+155
-157
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ git submodule update --remote src/doc/rustc-dev-guide
118118
git add -u
119119
git commit -m "Update rustc-dev-guide"
120120
# Note that you can use -i, which is short for --incremental, in the following command
121-
./x.py test --incremental src/doc/rustc-dev-guide # This is optional and should succeed anyway
121+
./x test --incremental src/doc/rustc-dev-guide # This is optional and should succeed anyway
122122
# Open a PR in rust-lang/rust
123123
```
124124

src/backend/updating-llvm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ so let's go through each in detail.
9090
`src/llvm-project` to ensure submodule updates aren't reverted.
9191
Some commands you should execute are:
9292

93-
* `./x.py build src/llvm` - test that LLVM still builds
94-
* `./x.py build src/tools/lld` - same for LLD
95-
* `./x.py build` - build the rest of rustc
93+
* `./x build src/llvm` - test that LLVM still builds
94+
* `./x build src/tools/lld` - same for LLD
95+
* `./x build` - build the rest of rustc
9696

9797
You'll likely need to update [`llvm-wrapper/*.cpp`][`llvm-wrapper`]
9898
to compile with updated LLVM bindings.
9999
Note that you should use `#ifdef` and such to ensure
100100
that the bindings still compile on older LLVM versions.
101101

102-
Note that `profile = "compiler"` and other defaults set by `./x.py setup`
102+
Note that `profile = "compiler"` and other defaults set by `./x setup`
103103
download LLVM from CI instead of building it from source.
104104
You should disable this temporarily to make sure your changes are being used.
105105
This is done by having the following setting in `config.toml`:

src/bug-fix-procedure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ general, if the test used to have `#[deny(overlapping_inherent_impls)]`, that
325325
can just be removed.
326326

327327
```
328-
./x.py test
328+
./x test
329329
```
330330

331331
#### All done!

src/building/bootstrapping.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ However, it takes a very long time to build
9696
because one must first build the new compiler with an older compiler
9797
and then use that to build the new compiler with itself.
9898
For development, you usually only want the `stage1` compiler,
99-
which you can build with `./x.py build library`.
99+
which you can build with `./x build library`.
100100
See [Building the compiler](./how-to-build-and-run.html#building-the-compiler).
101101

102102
### Stage 3: the same-result test
@@ -173,27 +173,27 @@ Build artifacts include, but are not limited to:
173173

174174
#### Examples
175175

176-
- `./x.py build --stage 0` means to build with the beta `rustc`.
177-
- `./x.py doc --stage 0` means to document using the beta `rustdoc`.
178-
- `./x.py test --stage 0 library/std` means to run tests on the standard library
179-
without building `rustc` from source ('build with stage 0, then test the
176+
- `./x build --stage 0` means to build with the beta `rustc`.
177+
- `./x doc --stage 0` means to document using the beta `rustdoc`.
178+
- `./x test --stage 0 library/std` means to run tests on the standard library
179+
without building `rustc` from source ('build with stage 0, then test the
180180
artifacts'). If you're working on the standard library, this is normally the
181181
test command you want.
182-
- `./x.py test tests/ui` means to build the stage 1 compiler and run
182+
- `./x test tests/ui` means to build the stage 1 compiler and run
183183
`compiletest` on it. If you're working on the compiler, this is normally the
184184
test command you want.
185185

186186
#### Examples of what *not* to do
187187

188-
- `./x.py test --stage 0 tests/ui` is not useful: it runs tests on the
188+
- `./x test --stage 0 tests/ui` is not useful: it runs tests on the
189189
_beta_ compiler and doesn't build `rustc` from source. Use `test tests/ui`
190190
instead, which builds stage 1 from source.
191-
- `./x.py test --stage 0 compiler/rustc` builds the compiler but runs no tests:
191+
- `./x test --stage 0 compiler/rustc` builds the compiler but runs no tests:
192192
it's running `cargo test -p rustc`, but cargo doesn't understand Rust's
193193
tests. You shouldn't need to use this, use `test` instead (without arguments).
194-
- `./x.py build --stage 0 compiler/rustc` builds the compiler, but does not build
195-
libstd or even libcore. Most of the time, you'll want `./x.py build
196-
library` instead, which allows compiling programs without needing to define
194+
- `./x build --stage 0 compiler/rustc` builds the compiler, but does not build
195+
libstd or even libcore. Most of the time, you'll want `./x build
196+
library` instead, which allows compiling programs without needing to define
197197
lang items.
198198

199199
### Building vs. running

src/building/build-install-distribution-artifacts.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
You might want to build and package up the compiler for distribution.
44
You’ll want to run this command to do it:
55

6-
```bash
7-
./x.py dist
8-
```
6+
```bash
7+
./x dist
8+
```
99

1010
# Install distribution artifacts
1111

1212
If you’ve built a distribution artifact you might want to install it and
1313
test that it works on your target system. You’ll want to run this command:
1414

15-
```bash
16-
./x.py install
17-
```
15+
```bash
16+
./x install
17+
```
1818

1919
Note: If you are testing out a modification to a compiler, you
2020
might want to use it to compile some project.
21-
Usually, you do not want to use `./x.py install` for testing.
21+
Usually, you do not want to use `./x install` for testing.
2222
Rather, you should create a toolchain as discussed in
2323
[here][create-rustup-toolchain].
2424

src/building/compiler-documenting.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ like the standard library (std) or the compiler (rustc).
1010
as rustdoc is under active development:
1111

1212
```bash
13-
./x.py doc
13+
./x doc
1414
```
1515

1616
If you want to be sure the documentation looks the same as on CI:
1717

1818
```bash
19-
./x.py doc --stage 1
19+
./x doc --stage 1
2020
```
2121

2222
This ensures that (current) rustdoc gets built,
@@ -26,9 +26,9 @@ like the standard library (std) or the compiler (rustc).
2626
you can build just the documentation you want:
2727

2828
```bash
29-
./x.py doc src/doc/book
30-
./x.py doc src/doc/nomicon
31-
./x.py doc compiler library
29+
./x doc src/doc/book
30+
./x doc src/doc/nomicon
31+
./x doc compiler library
3232
```
3333

3434
See [the nightly docs index page](https://doc.rust-lang.org/nightly/) for a full list of books.

src/building/how-to-build-and-run.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ if you want to learn more about `x.py`, [read this chapter][bootstrap].
6262
The `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

6868
This 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
114114
and create a `config.toml` for you with reasonable defaults. If you use a different default (which
115115
you'll likely want to do if you want to contribute to an area of rust other than the compiler, such
116116
as 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
120120
settings and explanations of them. See `src/bootstrap/defaults` for common settings to change.
121121

122122
If 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
124124
clean` will not cause a rebuild of LLVM.
125125

126126
## Common `x.py` commands
127127

128128
Here are the basic invocations of the `x.py` commands most commonly used when
129129
working 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

138138
As written, these commands are reasonable starting points. However, there are
139139
additional 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`
141141
provide many ways to compile or test a subset of the code, which can save a lot
142142
of time.
143143

@@ -160,7 +160,7 @@ Once you've created a `config.toml`, you are now ready to run
160160
probably the best "go to" command for building a local compiler:
161161

162162
```bash
163-
./x.py build library
163+
./x build library
164164
```
165165

166166
This 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

184184
Sometimes 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

188188
Note 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.
203203
Instead, 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

209209
If 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
256256
want 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`
267267
and 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

273273
Note 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
309309
in 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
330330
everything 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

src/building/new-target.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ relevant to your desired goal.
1010

1111
For very new targets, you may need to use a different fork of LLVM
1212
than what is currently shipped with Rust. In that case, navigate to
13-
the `src/llvm-project` git submodule (you might need to run `./x.py
13+
the `src/llvm-project` git submodule (you might need to run `./x
1414
check` at least once so the submodule is updated), check out the
1515
appropriate commit for your fork, then commit that new submodule
1616
reference in the main Rust repository.
@@ -135,7 +135,7 @@ cross-compile `rustc`:
135135

136136
```
137137
DESTDIR=/path/to/install/in \
138-
./x.py install -i --stage 1 --host aarch64-apple-darwin.json --target aarch64-apple-darwin \
138+
./x install -i --stage 1 --host aarch64-apple-darwin.json --target aarch64-apple-darwin \
139139
compiler/rustc library/std
140140
```
141141

src/building/prerequisites.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ recommend trying to build on a Raspberry Pi! We recommend the following.
2020
* 2+ cores. Having more cores really helps. 10 or 20 or more is not too many!
2121

2222
Beefier machines will lead to much faster builds. If your machine is not very
23-
powerful, a common strategy is to only use `./x.py check` on your local machine
23+
powerful, a common strategy is to only use `./x check` on your local machine
2424
and let the CI build test your changes when you push to a PR branch.
2525

2626
Building the compiler takes more than half an hour on my moderately powerful

0 commit comments

Comments
 (0)