This diagram is based on the diagram in Joshua Nelson's talk on
bootstrapping at RustConf 2022 [1]. I converted it to Mermaid and made
some tweaks to simplify it and bring it closer to bootstrap's
terminology, and then Ralf Jung added nodes for copying artifacts.
[1]: https://rustconf.com/schedule#bootstrapping-the-once-and-future-compiler
Co-authored-by: Joshua Nelson <github@jyn.dev>
Co-authored-by: Ralf Jung <post@ralfj.de>
Since https://github.com/rust-lang/rust/pull/95503, `library/std` means
"build just std and its dependencies"; to get the old behavior that built
`proc_macro` and `test`, you need `x build library`.
- Update `library/std` to `library`
- Remove the `-i` suggestions; `incremental = true` is already the default for most profiles, in
which case `-i` does nothing. If you don't have incremental enabled, I still think suggesting `-i`
is bad idea, because it's easy to forget once, at which point you'll end up rebuilding the whole
compiler / standard library.
- Remove a few repetitive sections and don't discuss incremental in such detail
Incremental works well enough that it should "just work" for most people;
I don't think it needs multiple paragraphs of explanation so early in the guide.
- Clarify that `test library/std` *only* tests libstd in a few places
Cargo check isn't supported and gives an error that CFG_CHANNEL is missing.
It also generates a new target dir and recompiles dependencies.
Use x.py instead, which avoids both issues.
This is a follow-up to #1279.
The "Getting Started" chapter is, TBH, pretty bad when it comes to the
stuff about building and testing. It has far too much detail and lots of
repetition, which would be overwhelming to a newcomer.
This commit removes most of it, leaving behind just quick mentions of
the most common `x.py` commands: `check`, `build`, `test`, `fmt`, with
links to the appropriate chapters for details. There were a few
interesting details that weren't covered elsewhere, so I moved those
into other chapters.
* Move `x.py` intro section before first use, and shorten it.
* Improve `x.py setup` docs.
In "Getting Started", strip it back to the bare minimum. Some of this is
moved into the later section.
In the later section, add notable details like config.toml.example how
and `profile` works. Also make the config.toml example more concise.
* Move details about the repository.
Less detail in "Getting Started", more in the later sections.
* Move details about the prereqs.
Less detail in "Getting Started", more in the later sections.
Use paragraphs instead of bullet-points.
Edits throughout for clarity.
Use semantic line breaks in edited sections.
Co-authored-by: Joshua Nelson <github@jyn.dev>
* Move 'force-unstable-if-unmarked' to the bootstrapping chapter
* Document how to stabilize a library feature
Note that features can't be stabilized until they go through FCP and
that FCP happens on the tracking issue, not the PR.
* Fix wrong glob
By default `**` behaves the same as two `*` side by side, i.e. it only
globs file paths, not directories. `shopt -s globstar` needs to be set
for it to mean a directory. I didn't notice this before now because
`globstar` is set by default in interactive mode, but not otherwise.
`download-ci-llvm` is available and enabled by default for all tier 1
platforms, so there is no need to change it. Using system LLVM over CI
llvm is still supported, but is not recommended. Building LLVM from
source is still supported.
This also notes that you need to explicitly disable downloading LLVM
when updating the submodule.
Document the newly added `x` binary that wraps `x.py`, which can be
installed system-wide, and can be run from any subdirectory of a rust
repo checkout.
This makes the compiler faster to running without sacrificing too much
performance. It still shows logging so contributors aren't confused by
`debug!` doing nothing.
This is a companion to [this PR](https://github.com/rust-lang/rust/pull/76356), which deals with including functionality for automatically running `tidy --bless` on each commit.
Undo editor auto-formatting and clarify git hook renaming
a word
Phrasing
Apply suggestions from code review
Co-authored-by: Camelid <37223377+camelid@users.noreply.github.com>
* Explain stages in terms of the compiler currently running
- Address some confusing points
+ stage N+1 -> stage N artifacts
+ Use more likely examples of an ABI break
+ stage N -> stage N compiler
- Mention why rustc occasionally uses `cfg(bootstrap)`
- Note that stage1 is built using two different versions
- Add lots of examples
+ `test src/test/ui` and `test compiler/rustc` run different compilers 😢
+ Separate examples of what to do from examples of what not to do
- 'ship stage 1 artifacts' -> 'ship stage 2 compiler'
This is hopefully less confusing.
* build -> x.py build
* Add section on build artifacts
* Improve wording
Co-authored-by: Camelid <37223377+camelid@users.noreply.github.com>
* uplifted -> assembled
Co-authored-by: Camelid <37223377+camelid@users.noreply.github.com>