You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/inside-rust/stage0-redesign/index.md
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This blog post focuses on motivation for the change and attempts to build a ment
14
14
15
15
# TL;DR: What is being changed?
16
16
17
-
We are [redesigning the initial bootstrap sequence][stage0-redesign-pr] so that the standard library will now only support one compiler version. Building the in-tree compiler will no longer involve building the in-tree standard library. Instead, the pre-built beta standard library will be used.
17
+
We are [redesigning the bootstrap sequence for the Rust toolchain][stage0-redesign-pr]. The standard library will move from supporting being built by both the previous toolchain version and the current version to only supporting the current version. This does not change the artifacts we distribute to end users of Rust.
18
18
19
19
**Current bootstrap sequence**
20
20
@@ -36,9 +36,15 @@ This section is intended to explain some basic bootstrapping concepts to make it
36
36
37
37
## Bootstrapping `rustc` {#bootstrapping-rust}
38
38
39
-
Building a C++ compiler toolchain like [`gcc`][gcc-bootstrap] or [`clang`][clang-bootstrap] doesn't usually involving building their stand libraries from source, but instead will link against a pre-built standard library across all bootstrap stages. Typically, this specified standard library is the system standard library.[^adapted]
39
+
Building a C++ compiler toolchain like [`gcc`][gcc-bootstrap] or [`clang`][clang-bootstrap] doesn't usually involving building their standard libraries from source, but instead will link against a pre-built standard library across all bootstrap stages. Typically, this specified standard library is the system standard library.[^adapted]
40
40
41
-
In the context of `rustc`, this is not the case, as the compiler and standard library are tightly coupled through *intrinsics* and *lang items*. Bootstrapping `rustc` involves building the standard library from source. Building a stage `N``rustc` requires building or acquiring the stage `N - 1``rustc`, as well as the stage `N - 1` standard library built by the stage `N - 1``rustc`.
41
+
The Rust toolchain as a whole, both currently and after this change, supports being built with just two minor versions of Rust: the previous version and its own version. For example, Rust 1.85.1 requires one of 1.84.0, 1.85.0, or 1.85.1 toolchains to build its source code into the 1.85.1 distributed artifacts.
42
+
43
+
Rust has historically always built the majority of in-tree source code against the in-tree standard library's API. This meant that the in-tree copy of the standard library had to support being built with both the previous release (e.g., 1.84) and the new release (e.g., 1.85), requiring extensive `cfg(bootstrap)` annotations to be compatible with the unstable API of the compiler (primarily changes in intrinsics and lang items).
44
+
45
+
The choice to require std to be built with two different compiler toolchains is largely historical. We don't have specific rationale available, but expect it to have made more sense when the standard library API was rapidly evolving and the compiler was unable to use crates.io dependencies for functionality.
0 commit comments