Skip to content

x doc compiler --open no longer opens any documentation #112440

Closed

Description

@BoxyUwU

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

Activity

  1. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    C-bugCategory: This is a bug.
    on Jun 8, 2023
  2. jyn514 commented on Jun 8, 2023

    @jyn514
    Member

    whoops yeah this is definitely my fault 😅

    if let Some(krate) = to_open {
    needs to be let krate = to_open.unwrap_or(rustc_driver);

  3. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Jun 8, 2023
  4. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jun 8, 2023
  5. sigaloid commented on Jun 9, 2023

    @sigaloid
    Contributor

    @rustbot claim

  6. sigaloid commented on Jun 9, 2023

    @sigaloid
    Contributor

    @jyn514 What is rustc_driver in this context? Looks like it wants a &String and "rustc_driver" doesn't seem to do the trick.

  7. jyn514 commented on Jun 9, 2023

    @jyn514
    Member

    @sigaloid you might need to add a temporary let binding in a higher scope so you can assign a String to it

  8. sigaloid commented on Jun 9, 2023

    @sigaloid
    Contributor
            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);
    

    That gives me a panic over at

    t!(symlink_dir_force(&builder.config, &out, &out_dir));

    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.
    
  9. jyn514 commented on Jun 9, 2023

    @jyn514
    Member

    @sigaloid does d613134 fix it?

  10. sigaloid commented on Jun 9, 2023

    @sigaloid
    Contributor

    It fixes the panic, but it doesn't fix the main issue (nothing opens).

  11. jyn514 commented on Jun 9, 2023

    @jyn514
    Member

    ok, you'll have to figure out why that didn't work and what the proper fix is.

  12. sigaloid commented on Jun 9, 2023

    @sigaloid
    Contributor

    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 :)

  13. jyn514 commented on Jun 9, 2023

    @jyn514
    Member

    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.

  14. sigaloid commented on Jun 9, 2023

    @sigaloid
    Contributor

    Just to be sure: It should open this?
    image

  15. added a commit that references this issue on Jun 10, 2023
    4d36c84
  16. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall 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)regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions