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
{{ message }}
Repository navigation
x doc compiler --open no longer opens any documentation #112440
title. I ran x doc compiler --open and nothing opened, cc #111955@jyn514 (havent actually checked that PR caused this). x doc rustc_middle --open still works
builder.run(&mut cargo.into());
// Let's open the first crate documentation page:
let rustc_driver = String::from("rustc_driver");
let krate = to_open.unwrap_or(&rustc_driver);
let index = out.join(krate).join("index.html");
builder.open_in_browser(index);
Documenting compiler (stage0 -> stage1, x86_64-unknown-linux-gnu)
thread 'main' panicked at 'symlink_dir_force(&builder.config, &out, &out_dir) failed with No such file or directory (os error 2)', doc.rs:697:9
stack backtrace:
0: rust_begin_unwind
at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/std/src/panicking.rs:593:5
1: core::panicking::panic_fmt
at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/panicking.rs:67:14
2: <bootstrap::doc::Rustc as bootstrap::builder::Step>::run
at ./src/bootstrap/doc.rs:697:9
3: bootstrap::builder::Builder::ensure
at ./src/bootstrap/builder.rs:2081:23
4: <bootstrap::doc::Rustc as bootstrap::builder::Step>::make_run
at ./src/bootstrap/doc.rs:657:9
5: bootstrap::builder::StepDescription::maybe_run
at ./src/bootstrap/builder.rs:305:13
6: bootstrap::builder::StepDescription::run
at ./src/bootstrap/builder.rs:371:17
7: bootstrap::builder::Builder::run_step_descriptions
at ./src/bootstrap/builder.rs:960:9
8: bootstrap::builder::Builder::execute_cli
at ./src/bootstrap/builder.rs:941:9
9: bootstrap::Build::build
at ./src/bootstrap/lib.rs:695:13
10: bootstrap::main
at ./src/bootstrap/bin/main.rs:60:5
11: core::ops::function::FnOnce::call_once
at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Ok, some more investigation: the builder wants to open index which is "rust/build/x86_64-unknown-linux-gnu/compiler-doc/rustc_driver/index.html" but this file doesn't exist.
x doc compiler --open builds that file, except under rustc_main, however. That's not much help.
Is the idea behind your suggested fix, to compile rustc_driver if nothing else is provided, or to open the (assumedly compiled) rustc_driver docs if nothing else is provided? Currently in that run function, self.crates = []. If the former is true, then the fix would be to check for if self.crates == [] and pass the arg to cargo that way. If the latter is true, then there's a further bug in that rustc_driver isn't being compiled when it's supposed to be.
Forgive the newcomer questions! If anyone wants to fix this before me, feel free - I see the prioritize label :)
If self.crates == [], that means we should build all the compiler crates. Maybe we need to add back the logic that was there before, to treat rustc_driver as the root? I guess since they're all part of the larger workspace cargo doc doesn't do the right thing by default like it does elsewhere.
Activity
jyn514 commentedon Jun 8, 2023
whoops yeah this is definitely my fault 😅
rust/src/bootstrap/doc.rs
Line 741 in c28ee60
let krate = to_open.unwrap_or(rustc_driver);sigaloid commentedon Jun 9, 2023
@rustbot claim
sigaloid commentedon Jun 9, 2023
@jyn514 What is
rustc_driverin this context? Looks like it wants a&Stringand "rustc_driver" doesn't seem to do the trick.jyn514 commentedon Jun 9, 2023
@sigaloid you might need to add a temporary
letbinding in a higher scope so you can assign a String to itsigaloid commentedon Jun 9, 2023
That gives me a panic over at
rust/src/bootstrap/doc.rs
Line 697 in c28ee60
jyn514 commentedon Jun 9, 2023
@sigaloid does d613134 fix it?
sigaloid commentedon Jun 9, 2023
It fixes the panic, but it doesn't fix the main issue (nothing opens).
jyn514 commentedon Jun 9, 2023
ok, you'll have to figure out why that didn't work and what the proper fix is.
sigaloid commentedon Jun 9, 2023
Ok, some more investigation: the builder wants to open
indexwhich is "rust/build/x86_64-unknown-linux-gnu/compiler-doc/rustc_driver/index.html" but this file doesn't exist.x doc compiler --openbuilds that file, except under rustc_main, however. That's not much help.Is the idea behind your suggested fix, to compile rustc_driver if nothing else is provided, or to open the (assumedly compiled)
rustc_driverdocs if nothing else is provided? Currently in thatrunfunction,self.crates = []. If the former is true, then the fix would be to check for ifself.crates == []and pass the arg to cargo that way. If the latter is true, then there's a further bug in thatrustc_driverisn't being compiled when it's supposed to be.Forgive the newcomer questions! If anyone wants to fix this before me, feel free - I see the prioritize label :)
jyn514 commentedon Jun 9, 2023
If self.crates == [], that means we should build all the compiler crates. Maybe we need to add back the logic that was there before, to treat rustc_driver as the root? I guess since they're all part of the larger workspace
cargo docdoesn't do the right thing by default like it does elsewhere.sigaloid commentedon Jun 9, 2023
Just to be sure: It should open this?

Rollup merge of rust-lang#112467 - sigaloid:master, r=albertlarsan68