Skip to content
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

mdbook 0.4.44 will break ./x.py doc #137052

Closed
pvdrz opened this issue Feb 14, 2025 · 2 comments · Fixed by #137191
Closed

mdbook 0.4.44 will break ./x.py doc #137052

pvdrz opened this issue Feb 14, 2025 · 2 comments · Fixed by #137191
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools

Comments

@pvdrz
Copy link
Contributor

pvdrz commented Feb 14, 2025

What the title says, if you update the Cargo.lock file so it updates mdbook from 0.4.43 to 0.4.44, running ./x.py doc will panic:

thread 'main' panicked at /home/christian/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/mdbook-0.4.44/src/renderer/html_handlebars/search.rs:47:81:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x793b8ae44089 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hfc1f21f8db201d29
   1:     0x793b8ae9fec3 - core::fmt::write::h016056faa7a6981e
   2:     0x793b8ae0669f - std::io::Write::write_fmt::h24b894747b35c3c0
   3:     0x793b8ae43ed3 - std::sys::backtrace::BacktraceLock::print::heebf86472dec8fe7
   4:     0x793b8ae241fc - std::panicking::default_hook::{{closure}}::h6d72acfbda71ec98
   5:     0x793b8ae24109 - std::panicking::default_hook::h8be7653a5e9957aa
   6:     0x793b8ae2473e - std::panicking::rust_panic_with_hook::h6aa9de01d2a3556f
   7:     0x793b8ae45066 - std::panicking::begin_panic_handler::{{closure}}::he4940efa6b78295e
   8:     0x793b8ae442b9 - std::sys::backtrace::__rust_end_short_backtrace::h6d8392e54739a970
   9:     0x793b8ae2429d - rust_begin_unwind
  10:     0x793b87896880 - core::panicking::panic_fmt::he144472e74486d6c
  11:     0x793b8789690c - core::panicking::panic::h9b72aee951677e47
  12:     0x793b878967f9 - core::option::unwrap_failed::h6e1b719b223197a6
  13:     0x5ab541711bef - mdbook[a979f49934072b30]::renderer::html_handlebars::search::create_files
  14:     0x5ab541782d36 - <mdbook[a979f49934072b30]::renderer::html_handlebars::hbs_renderer::HtmlHandlebars as mdbook[a979f49934072b30]::renderer::Renderer>::render
  15:     0x5ab54171f512 - <mdbook[a979f49934072b30]::book::MDBook>::execute_build_process
  16:     0x5ab54171ea06 - <mdbook[a979f49934072b30]::book::MDBook>::build
  17:     0x5ab5416f07d3 - error_index_generator[7ec2f52f1ffd143e]::main
  18:     0x5ab5416f1373 - std[778bddf7b4c93277]::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  19:     0x5ab5416f49e9 - std[778bddf7b4c93277]::rt::lang_start::<()>::{closure#0}
  20:     0x793b8ae3f915 - std::rt::lang_start_internal::h808f256575e6d97e
  21:     0x5ab5416f11e8 - main
  22:     0x793b86e35488 - <unknown>
  23:     0x793b86e3554c - __libc_start_main
  24:     0x5ab5416ece35 - _start
  25:                0x0 - <unknown>
Command has failed. Rerun with -v to see more details.
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 14, 2025
@GrigorenkoPV
Copy link
Contributor

Can reproduce on master (273465e).

  1. Apply this patch:
    diff --git a/Cargo.lock b/Cargo.lock
    index 38a861727a9..9d736356bb5 100644
    --- a/Cargo.lock
    +++ b/Cargo.lock
    @@ -2230,9 +2230,9 @@ dependencies = [
    
    [[package]]
    name = "mdbook"
    -version = "0.4.43"
    +version = "0.4.44"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    -checksum = "fe1f98b8d66e537d2f0ba06e7dec4f44001deec539a2d18bfc102d6a86189148"
    +checksum = "f9da1e54401fe5d45a664c57e112e70f18e8c5a73e268c179305b932ee864574"
    dependencies = [
    "ammonia",
    "anyhow",
  2. Then ./x doc src/tools/error_index_generator

@ehuss
Copy link
Contributor

ehuss commented Feb 17, 2025

Thanks for the report! I will take a look at this.

@ehuss ehuss self-assigned this Feb 17, 2025
@ehuss ehuss added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 17, 2025
@bors bors closed this as completed in 05dbe6d Feb 19, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 19, 2025
Rollup merge of rust-lang#137191 - ehuss:update-mdbook, r=jieyouxu

Update mdbook and move error_index_generator

This moves error_index_generator to the rustbook workspace so that it can share the dependency with mdbook. I had forgotten that error_index_generator is using mdbook.

This includes a corresponding update to mdbook which avoids a regression in error_index_generator.

Closes rust-lang#137052
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants