Skip to content

Commit 61cadd2

Browse files
Rajkumar Natarajanmark-i-m
Rajkumar Natarajan
authored andcommitted
issue-130 updated the review comments
1 parent 062e158 commit 61cadd2

5 files changed

+37
-78
lines changed

src/build-install-distribution-artifacts.md

+7-13
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,16 @@ You’ll want to run this command to do it:
77
./x.py dist
88
```
99

10-
## Other Flags
11-
12-
The same flags from build are available here.
13-
You might want to consider adding on the -j flag for faster builds
14-
when building a distribution artifact.
15-
16-
```bash
17-
-j, --jobs JOBS number of jobs to run in parallel
18-
```
19-
20-
2110
# Install distribution artifacts
2211

23-
If you’ve built a distribution artifact you might want to install it and
12+
If you’ve built a distribution artifact you might want to install it and
2413
test that it works on your target system. You’ll want to run this command:
2514

2615
```bash
2716
./x.py install
28-
```
17+
```
18+
19+
Note: If you are testing out a modification to a compiler, you might want to use it to compile some project.
20+
Usually, you do not want to use ./x.py install for testing.
21+
Rather, you should create a toolchain as discussed in how-to-build-and-run.html#creating-a-rustup-toolchain.
22+
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).

src/compiler-benchmarking.md

-11
This file was deleted.

src/compiler-documenting.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,9 @@ Much like individual tests or building certain components you can build only
3434
the documentation you want.
3535

3636
## Document internal rustc items
37-
By default rustc does not build the compiler docs for its internal items.
38-
Mostly because this is useless for the average user. However, you might need
39-
to have it available so you can understand the types. Here’s how you can
40-
compile it yourself. From the top level directory where x.py is located run:
4137

42-
```bash
43-
cp config.toml.example config.toml
44-
```
38+
Compiler documentation is not built by default - there's a flag in config.toml for achieving the same.
39+
But, when enabled, compiler documentation does include internal items.
4540

4641
Next open up config.toml and make sure these two lines are set to true:
4742

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

+1-25
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ debuginfo-lines = true
4747
use-jemalloc = false
4848
```
4949

50-
### what is x.py?
50+
### What is x.py?
5151

5252
x.py is the script used to orchestrate the tooling in the rustc repository.
5353
It is the script that can build docs, run tests, and compile rustc.
@@ -88,7 +88,6 @@ compiling `rustc` is done in stages:
8888
can build the libraries with the stage2 compiler. The result ought
8989
to be identical to before, unless something has broken.
9090

91-
9291
#### Build Flags
9392

9493
There are other flags you can pass to the build portion of x.py that can be
@@ -111,29 +110,6 @@ Options:
111110
-h, --help print this help message
112111
```
113112

114-
One thing to keep in mind is that `rustc` is a _bootstrapping_ compiler. That
115-
is, since `rustc` is written in Rust, we need to use an older version of the
116-
compiler to compile the newer version. In particular, the newer version of the
117-
compiler, `libstd`, and other tooling may use some unstable features
118-
internally. The result is the compiling `rustc` is done in stages.
119-
120-
- **Stage 0:** the stage0 compiler can be your existing
121-
(perhaps older version of)
122-
Rust compiler, the current _beta_ compiler or you may download the binary
123-
from the internet.
124-
- **Stage 1:** the code in your clone (for new version)
125-
is then compiled with the stage0
126-
compiler to produce the stage1 compiler.
127-
However, it was built with an older compiler (stage0),
128-
so to optimize the stage1 compiler we go to next stage.
129-
- **Stage 2:** we rebuild our stage1 compiler with itself
130-
to produce the stage2 compiler (i.e. it builds
131-
itself) to have all the _latest optimizations_.
132-
- _(Optional)_ **Stage 3**: to sanity check of our new compiler,
133-
we can build it again
134-
with stage2 compiler which must be identical to itself,
135-
unless something has broken.
136-
137113
For hacking, often building the stage 1 compiler is enough, but for
138114
final testing and release, the stage 2 compiler is used.
139115

src/tests/running.md

+27-22
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,33 @@ the debuginfo test suite:
4040
> ./x.py test --stage 1 src/test/debuginfo
4141
```
4242

43+
### Run only the tidy script
44+
45+
```bash
46+
> ./x.py test src/tools/tidy
47+
```
48+
49+
### Run tests on the standard library
50+
51+
```bash
52+
> ./x.py test src/libstd
53+
```
54+
55+
### Run tests on the standard library and run the tidy script
56+
57+
```bash
58+
> ./x.py test src/libstd src/tools/tidy
59+
```
60+
61+
### Run tests on the standard library using a stage 1 compiler
62+
63+
```bash
64+
> ./x.py test src/libstd --stage 1
65+
```
66+
67+
By listing which test suites you want to run you avoid having to run
68+
tests for components you did not change at all.
69+
4370
**Warning:** Note that bors only runs the tests with the full stage 2
4471
build; therefore, while the tests **usually** work fine with stage 1,
4572
there are some limitations. In particular, the stage1 compiler doesn't
@@ -92,25 +119,3 @@ just `rs` files, so you can do something like
92119
This is much faster, but doesn't always work. For example, some tests
93120
include directives that specify specific compiler flags, or which rely
94121
on other crates, and they may not run the same without those options.
95-
96-
### Run only the tidy script
97-
```bash
98-
> ./x.py test src/tools/tidy
99-
```
100-
### Run tests on the standard library
101-
```bash
102-
> ./x.py test src/libstd
103-
```
104-
105-
### Run tests on the standard library and run the tidy script
106-
```bash
107-
> ./x.py test src/libstd src/tools/tidy
108-
```
109-
110-
### Run tests on the standard library using a stage 1 compiler
111-
```bash
112-
> ./x.py test src/libstd --stage 1
113-
```
114-
115-
By listing which test suites you want to run you avoid having to run tests for
116-
components you did not change at all.

0 commit comments

Comments
 (0)