-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bootstrap: Various Step refactors #111955
Conversation
r? @clubby789 (rustbot has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super familiar with the code here but looks broadly good and (aside from a couple of nitpicks) a lot cleaner
This comment has been minimized.
This comment has been minimized.
@bors r+ |
📌 Commit e72ad594bfd2965bd8cc9774a64d5ba4fa23e53d has been approved by It is now in the queue for this repository. |
Just for later reference - Mark and I discussed about a year ago that this is the eventual direction we want to move bootstrap towards: #95503 (comment), https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/bootstrap.20.2B.20building.20individual.20crates.20.2395503/near/279768255 This keeps the design mentioned there, where I think I've been the reviewer for all PRs involving |
Generate docs for bootstrap itself This verifies the intra-doc links are correct, and hopefully makes things easier for new contributors. Note that this will conflict with rust-lang#111955, i'm pretty sure i typo-ed some of the intra-doc links lol
Generate docs for bootstrap itself This verifies the intra-doc links are correct, and hopefully makes things easier for new contributors. Note that this will conflict with rust-lang#111955, i'm pretty sure i typo-ed some of the intra-doc links lol
Generate docs for bootstrap itself This verifies the intra-doc links are correct, and hopefully makes things easier for new contributors. Note that this will conflict with rust-lang#111955, i'm pretty sure i typo-ed some of the intra-doc links lol
⌛ Testing commit e72ad594bfd2965bd8cc9774a64d5ba4fa23e53d with merge 3bd00e870384ff8b0547fbea6c0c38b8ebc6d850... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
…lias Before: ``` thread 'main' panicked at 'no entry found for key', builder.rs:110:30 ``` After: ``` thread 'main' panicked at 'missing crate for path library', check.rs:89:26 ```
This is useful for profiling metadata generation. This comes very close to removing all_krates, but doesn't quite - there's one last usage left in `doc`.
This fixes the panic from the previous commit.
Previously `description` only supported `Testing` and `Benchmarking`, and `msg` gave weird results for `doc` (it would say `Docing`).
Previously they were using `all_krates` and various hacks to determine which crates to document. Switch them to `crate_or_deps` so `ShouldRun` tells them which crate to document instead of having to guess. This also makes a few other refactors: - Remove the now unused `all_krates`; new code should only use `crate_or_deps`. - Add tests for documenting Std - Remove the unnecessary `run_cargo_rustdoc_for` closure so that we only run cargo once - Give a more helpful error message when documenting a no_std target - Use `builder.msg` in the Steps instead of `builder.info`
and document why the single remaining place can't switch
- Switch from `cargo rustdoc` to `cargo doc` This allows passing `-p` to multiple packages. - Remove `OsStr` support It doesn't work with RUSTDOCFLAGS, and we don't support non-utf8 paths anyway. - Pass `-p std` for each crate in the standard library By default cargo only documents the top-level crate, which is `sysroot` and has no docs.
@bors r=clubby789 |
Rollup of 7 pull requests Successful merges: - rust-lang#107916 (fix comment on Allocator trait) - rust-lang#111543 (Uplift `clippy::invalid_utf8_in_unchecked` lint) - rust-lang#111872 (fix: dedup `static_candidates` before report) - rust-lang#111955 (bootstrap: Various Step refactors) - rust-lang#112060 (`EarlyBinder::new` -> `EarlyBinder::bind`) - rust-lang#112064 (Migrate GUI colors test to original CSS color format) - rust-lang#112100 (Don't typecheck recovered method call from suggestion) r? `@ghost` `@rustbot` modify labels: rollup
…-crates, r=albertlarsan68 bootstrap: update defaults for `compiler` and `library` aliases * `x doc compiler` now documents all of compiler, not just `rustc_driver`. * `x doc` with compiler docs enabled now includes `rustc-main` and `rustc_smir`. `rustc_codegen_llvm` is only included if the LLVM backend is enabled, which is the default. * `x doc library` now excludes `sysroot`. * `x check compiler` and `x check library` now properly check tests/benches/examples of all compiler or library crates, respectively. Note that `x check compiler` will check the library artifacts, but not tests. fixes the fallout from rust-lang#111955, cc `@jyn514`
…-crates, r=albertlarsan68 bootstrap: update defaults for `compiler` and `library` aliases * `x doc compiler` now documents all of compiler, not just `rustc_driver`. * `x doc` with compiler docs enabled now includes `rustc-main` and `rustc_smir`. `rustc_codegen_llvm` is only included if the LLVM backend is enabled, which is the default. * `x doc library` now excludes `sysroot`. * `x check compiler` and `x check library` now properly check tests/benches/examples of all compiler or library crates, respectively. Note that `x check compiler` will check the library artifacts, but not tests. fixes the fallout from rust-lang#111955, cc ``@jyn514``
…-crates, r=albertlarsan68 bootstrap: update defaults for `compiler` and `library` aliases * `x doc compiler` now documents all of compiler, not just `rustc_driver`. * `x doc` with compiler docs enabled now includes `rustc-main` and `rustc_smir`. `rustc_codegen_llvm` is only included if the LLVM backend is enabled, which is the default. * `x doc library` now excludes `sysroot`. * `x check compiler` and `x check library` now properly check tests/benches/examples of all compiler or library crates, respectively. Note that `x check compiler` will check the library artifacts, but not tests. fixes the fallout from rust-lang#111955, cc ```@jyn514```
…rates, r=albertlarsan68 bootstrap: update defaults for `compiler` and `library` aliases * `x doc compiler` now documents all of compiler, not just `rustc_driver`. * `x doc` with compiler docs enabled now includes `rustc-main` and `rustc_smir`. `rustc_codegen_llvm` is only included if the LLVM backend is enabled, which is the default. * `x doc library` now excludes `sysroot`. * `x check compiler` and `x check library` now properly check tests/benches/examples of all compiler or library crates, respectively. Note that `x check compiler` will check the library artifacts, but not tests. fixes the fallout from rust-lang#111955, cc `@jyn514`
/// multiple times, whereas a single call to `paths` will only ever generate a single call to | ||
/// `paths`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a single call to paths will only ever generate a single call to paths" eh... what does that mean?^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, this is a blast from the past. probably i meant "a single call to make_run
", by analogy with the docs above? i honestly don't remember though, it's been ages.
This ended up being a bunch of only somewhat related changes, sorry 😓 on the bright side, they're all fairly small and well-commented in the commit messages.
Document
ShouldRun::crates
Switch Steps from crates to crate_or_deps where possible
and document why the single remaining place can't switch
Switch doc::{Std, Rustc} to
crate_or_deps
Previously they were using
all_krates
and various hacks to determinewhich crates to document. Switch them to
crate_or_deps
soShouldRun
tells them which crate to document instead of having to guess.
This also makes a few other refactors:
all_krates
; new code should only usecrate_or_deps
.run_cargo_rustdoc_for
closure so that we onlyrun cargo once
builder.msg
in the Steps instead ofbuilder.info
Extend
msg
anddescription
to work with any subcommandPreviously
description
only supportedTesting
andBenchmarking
,and
msg
gave weird results fordoc
(it would sayDocing
).Add a
make_run_crates
function and use it Rustc and StdThis fixes the panic from the previous commit.
Allow checking individual crates
This is useful for profiling metadata generation.
This comes very close to removing all_krates, but doesn't quite -
there's one last usage left in
doc
. This is fixed in a later commit.Give a more helpful error when calling
cargo_crates_in_set
for an aliasBefore:
After: