From e8f47da4f2aed4a4b57271e7954b09cec0d2418c Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Tue, 11 Aug 2020 23:40:09 -0400 Subject: [PATCH 01/11] Add x.py post --- .../2020-08-12-changes-to-x-py-defaults.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md new file mode 100644 index 000000000..193504e70 --- /dev/null +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -0,0 +1,34 @@ +--- +layout: post +title: "Changes to x.py defaults" +author: Joshua Nelson +team: the compiler team +--- + +Recently, the defaults for [x.py] - the tool used to [bootstrap] the rust compiler from source - changed. If you regularly contribute to the rust compiler, this might affect your workflow. + +## What changes were made? + +- The default stage is now dependent on the subcommand. + + `dist`: stage 2 + + `build`: stage 1 + + `test`: stage 1 + + `doc`: stage 0 + +- stage1 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`. + +- `debuginfo` now defaults to `1` when `debug = true`. Previously, the default was 2. + +## Why were the changes made? + +For a detailed rationale of the changes, as well as more information about the alternatives considered, see + +- [the MCP] +- the [implementation PR] +- the [Zulip stream] + +[x.py]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#what-is-xpy +[bootstrap]: https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html +[the MCP]: https://github.com/rust-lang/compiler-team/issues/326 +[implementation PR]: https://github.com/rust-lang/rust/pull/73964 +[Zulip stream]: https://rust-lang.zulipchat.com/#narrow/stream/233931-xxx/topic/Use.20sane.20defaults.20in.20x.py.20compiler-team.23326 From bbe45abe0f05c2cb4ab586422c70684b43d1f149 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 12 Aug 2020 13:32:41 -0400 Subject: [PATCH 02/11] rustc is a program, so it should be rendered as code --- posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md index 193504e70..575fb8781 100644 --- a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -15,7 +15,7 @@ Recently, the defaults for [x.py] - the tool used to [bootstrap] the rust compil + `test`: stage 1 + `doc`: stage 0 -- stage1 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`. +- stage1 `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`. - `debuginfo` now defaults to `1` when `debug = true`. Previously, the default was 2. From 2f7de902e023ecdaadad148e86920d197264e974 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 13 Aug 2020 16:43:53 -0400 Subject: [PATCH 03/11] Improve wording Co-authored-by: Tshepang Lekhonkhobe Co-authored-by: Ralf Jung --- posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md index 575fb8781..90f8bca79 100644 --- a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -5,11 +5,11 @@ author: Joshua Nelson team: the compiler team --- -Recently, the defaults for [x.py] - the tool used to [bootstrap] the rust compiler from source - changed. If you regularly contribute to the rust compiler, this might affect your workflow. +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. ## What changes were made? -- The default stage is now dependent on the subcommand. +- The default stage is now dependent on the subcommand: + `dist`: stage 2 + `build`: stage 1 + `test`: stage 1 From 9b770da72d7acfbdddbeda76f8da899bbbb12107 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 13 Aug 2020 16:48:17 -0400 Subject: [PATCH 04/11] Mention what `build` does, not just what it doesn't do --- posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md index 90f8bca79..ab446278c 100644 --- a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -15,7 +15,7 @@ Recently, the defaults for [x.py], the tool used to [bootstrap] the Rust compile + `test`: stage 1 + `doc`: stage 0 -- stage1 `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`. +- stage1 `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). - `debuginfo` now defaults to `1` when `debug = true`. Previously, the default was 2. From c3df59b13e497aae387cc566171fa3f0702cefde Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 13 Aug 2020 17:39:34 -0400 Subject: [PATCH 05/11] Add a short rationale for the changes --- .../2020-08-12-changes-to-x-py-defaults.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md index ab446278c..19fa8065c 100644 --- a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -21,6 +21,19 @@ Recently, the defaults for [x.py], the tool used to [bootstrap] the Rust compile ## Why were the changes made? +Previously, `x.py build` would build `rustc` three separate times: + +1. `build/stage0-rustc` +2. `build/stage1-rustc` +3. `build/stage2-rustc` + +Normally, contributors only want to build the compiler once, which lets them test their changes quickly. After this change, this is in fact what happens: + +1. `build/stage0-rustc` + +`debuginfo = 2` generates several gigabytes of debug information, +making the previous default settings for `debug = true` very painful. + For a detailed rationale of the changes, as well as more information about the alternatives considered, see - [the MCP] From cf91f1f3e38389bc83c4c2d87f043dd61cd78e83 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 26 Aug 2020 16:39:13 -0400 Subject: [PATCH 06/11] Improve wording --- posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md index 19fa8065c..bf655f7b0 100644 --- a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -27,7 +27,7 @@ Previously, `x.py build` would build `rustc` three separate times: 2. `build/stage1-rustc` 3. `build/stage2-rustc` -Normally, contributors only want to build the compiler once, which lets them test their changes quickly. After this change, this is in fact what happens: +Normally, contributors only want to build the compiler once, which lets them test their changes quickly. After this change, that's now the case: 1. `build/stage0-rustc` From 0e436872d7a1b3a32776beff88b73d5dc1c0a30f Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 26 Aug 2020 16:45:48 -0400 Subject: [PATCH 07/11] Highlight `x.py` as code --- posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md index bf655f7b0..fc5afac22 100644 --- a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -5,7 +5,7 @@ author: Joshua Nelson team: the compiler team --- -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. +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. ## What changes were made? @@ -40,7 +40,7 @@ For a detailed rationale of the changes, as well as more information about the a - the [implementation PR] - the [Zulip stream] -[x.py]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#what-is-xpy +[`x.py`]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#what-is-xpy [bootstrap]: https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html [the MCP]: https://github.com/rust-lang/compiler-team/issues/326 [implementation PR]: https://github.com/rust-lang/rust/pull/73964 From 5a87a5aaa9887372639061c108add671023b636b Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 26 Aug 2020 17:04:01 -0400 Subject: [PATCH 08/11] Improve wording --- posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md index fc5afac22..b1be5be07 100644 --- a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -15,7 +15,7 @@ Recently, the defaults for [`x.py`], the tool used to [bootstrap] the Rust compi + `test`: stage 1 + `doc`: stage 0 -- stage1 `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). +- 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). - `debuginfo` now defaults to `1` when `debug = true`. Previously, the default was 2. @@ -27,7 +27,7 @@ Previously, `x.py build` would build `rustc` three separate times: 2. `build/stage1-rustc` 3. `build/stage2-rustc` -Normally, contributors only want to build the compiler once, which lets them test their changes quickly. After this change, that's now the case: +Normally, contributors only want to build the compiler once, which lets them test their changes quickly. After this change, that's now the default: 1. `build/stage0-rustc` From 29eef782ea2376d960da6cb857508149102a0e16 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 30 Aug 2020 08:10:04 -0400 Subject: [PATCH 09/11] libstd was built three times, not rustc --- .../2020-08-12-changes-to-x-py-defaults.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md index b1be5be07..bbdf1c1d1 100644 --- a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md @@ -21,15 +21,19 @@ Recently, the defaults for [`x.py`], the tool used to [bootstrap] the Rust compi ## Why were the changes made? -Previously, `x.py build` would build `rustc` three separate times: +Previously, `x.py build` would build `rustc` twice and the standard library three times: -1. `build/stage0-rustc` -2. `build/stage1-rustc` -3. `build/stage2-rustc` +1. `build/stage0-std` +2. `build/stage0-rustc` +3. `build/stage1-std` +4. `build/stage1-rustc` +5. `build/stage2-std` Normally, contributors only want to build the compiler once, which lets them test their changes quickly. After this change, that's now the default: -1. `build/stage0-rustc` +1. `build/stage0-std` +2. `build/stage0-rustc` +3. `build/stage1-std` `debuginfo = 2` generates several gigabytes of debug information, making the previous default settings for `debug = true` very painful. From 1afb969347ba1fc092a85628d94b67cfff85a509 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 30 Aug 2020 08:26:35 -0400 Subject: [PATCH 10/11] Update the filename with the current date --- ...to-x-py-defaults.md => 2020-08-30-changes-to-x-py-defaults.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename posts/inside-rust/{2020-08-12-changes-to-x-py-defaults.md => 2020-08-30-changes-to-x-py-defaults.md} (100%) diff --git a/posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-30-changes-to-x-py-defaults.md similarity index 100% rename from posts/inside-rust/2020-08-12-changes-to-x-py-defaults.md rename to posts/inside-rust/2020-08-30-changes-to-x-py-defaults.md From 91b26296cb6c6466ad38635334075311ecba1aae Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sun, 30 Aug 2020 08:33:11 -0400 Subject: [PATCH 11/11] 'stage 2 libstd' is just a copy of stage 1 --- posts/inside-rust/2020-08-30-changes-to-x-py-defaults.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/posts/inside-rust/2020-08-30-changes-to-x-py-defaults.md b/posts/inside-rust/2020-08-30-changes-to-x-py-defaults.md index bbdf1c1d1..355e5fea4 100644 --- a/posts/inside-rust/2020-08-30-changes-to-x-py-defaults.md +++ b/posts/inside-rust/2020-08-30-changes-to-x-py-defaults.md @@ -21,13 +21,12 @@ Recently, the defaults for [`x.py`], the tool used to [bootstrap] the Rust compi ## Why were the changes made? -Previously, `x.py build` would build `rustc` twice and the standard library three times: +Previously, `x.py build` would build `rustc` twice: 1. `build/stage0-std` 2. `build/stage0-rustc` 3. `build/stage1-std` 4. `build/stage1-rustc` -5. `build/stage2-std` Normally, contributors only want to build the compiler once, which lets them test their changes quickly. After this change, that's now the default: