-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Description
I tried this code: x doc compiler/rustc --stage 0
I expected to see this happen: bootstrap documents the whole compiler, like it does for x doc compiler
.
Instead, this happened:
thread 'main' panicked at 'no entry found for key', src/bootstrap/lib.rs:1324:26
The problem is that impl Step for Rustc
is too naive and expects the name of each crate to match its file path on disk:
Lines 625 to 633 in 05d2221
if !builder.src.join("compiler").join(&root_crate).exists() { | |
builder.info(&format!( | |
"\tskipping - compiler/{} (unknown compiler crate)", | |
root_crate | |
)); | |
} else { | |
compiler_crates.extend( | |
builder | |
.in_tree_crates(root_crate, Some(target)) |
Lines 1319 to 1324 in 05d2221
fn in_tree_crates(&self, root: &str, target: Option<TargetSelection>) -> Vec<&Crate> { | |
let mut ret = Vec::new(); | |
let mut list = vec![INTERNER.intern_str(root)]; | |
let mut visited = HashSet::new(); | |
while let Some(krate) = list.pop() { | |
let krate = &self.crates[&krate]; |
It needs to map from the path to the name somehow. There's already a way to go from the name to the path:
Lines 320 to 322 in 05d2221
impl Crate { | |
fn local_path(&self, build: &Build) -> PathBuf { | |
self.path.strip_prefix(&build.config.src).unwrap().into() |
but I don't think there's a way to do the reverse.
Meta
HEAD is 11909e3.
@rustbot label +A-bootstrap
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)