Skip to content

Commit e484abb

Browse files
jyn514tshepangRalfJung
authored andcommitted
Add post about changes to x.py defaults (rust-lang#666)
* Add x.py post * rustc is a program, so it should be rendered as code * Improve wording Co-authored-by: Tshepang Lekhonkhobe <tshepang@gmail.com> Co-authored-by: Ralf Jung <post@ralfj.de> * Mention what `build` does, not just what it doesn't do * Add a short rationale for the changes * Improve wording * Highlight `x.py` as code * Improve wording * libstd was built three times, not rustc * Update the filename with the current date * 'stage 2 libstd' is just a copy of stage 1 Co-authored-by: Tshepang Lekhonkhobe <tshepang@gmail.com> Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent 9e85618 commit e484abb

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: post
3+
title: "Changes to x.py defaults"
4+
author: Joshua Nelson
5+
team: the compiler team <https://www.rust-lang.org/governance/teams/compiler>
6+
---
7+
8+
Recently, the defaults for [`x.py`], the tool used to [bootstrap] the Rust compiler from source, changed. If you regularly contribute to Rust, this might affect your workflow.
9+
10+
## What changes were made?
11+
12+
- The default stage is now dependent on the subcommand:
13+
+ `dist`: stage 2
14+
+ `build`: stage 1
15+
+ `test`: stage 1
16+
+ `doc`: stage 0
17+
18+
- stage 1 `rustc` artifacts are no longer built by `x.py build --stage 1`. To get the old behavior back, use `x.py build --stage 1 src/rustc`. The new behavior for `build --stage 1` builds everything except `rustc`, which includes the standard library, `rustdoc`, and various other tools (if the tools are enabled).
19+
20+
- `debuginfo` now defaults to `1` when `debug = true`. Previously, the default was 2.
21+
22+
## Why were the changes made?
23+
24+
Previously, `x.py build` would build `rustc` twice:
25+
26+
1. `build/stage0-std`
27+
2. `build/stage0-rustc`
28+
3. `build/stage1-std`
29+
4. `build/stage1-rustc`
30+
31+
Normally, contributors only want to build the compiler once, which lets them test their changes quickly. After this change, that's now the default:
32+
33+
1. `build/stage0-std`
34+
2. `build/stage0-rustc`
35+
3. `build/stage1-std`
36+
37+
`debuginfo = 2` generates several gigabytes of debug information,
38+
making the previous default settings for `debug = true` very painful.
39+
40+
For a detailed rationale of the changes, as well as more information about the alternatives considered, see
41+
42+
- [the MCP]
43+
- the [implementation PR]
44+
- the [Zulip stream]
45+
46+
[`x.py`]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#what-is-xpy
47+
[bootstrap]: https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html
48+
[the MCP]: https://github.com/rust-lang/compiler-team/issues/326
49+
[implementation PR]: https://github.com/rust-lang/rust/pull/73964
50+
[Zulip stream]: https://rust-lang.zulipchat.com/#narrow/stream/233931-xxx/topic/Use.20sane.20defaults.20in.20x.py.20compiler-team.23326

0 commit comments

Comments
 (0)