Skip to content

mdbook test fails #79

Closed
Closed

Description

@Raymi306

From the README:

To preview your changes locally:

cargo install mdbook --version "^0.4" --force
mdbook build --open
mdbook test
$ mdbook test

. . .

Couldn't compile the test.

failures:
    update-0.8.md - Updating_to_0_8::Core_features::_::_no_longer_implements_ (line 48)
    update-0.8.md - Updating_to_0_8::Core_features::_::_no_longer_implements_ (line 55)
    update-0.8.md - Updating_to_0_8::Distributions (line 124)
    update-0.8.md - Updating_to_0_8::Distributions (line 133)
    update-0.8.md - Updating_to_0_8::Distributions (line 164)
    update-0.8.md - Updating_to_0_8::Distributions (line 169)

test result: FAILED. 0 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s

. . .

Activity

  1. dhardy commented on Mar 16, 2025

    @dhardy
    Member

    Yes, mdbook fails to resolve dependencies:

    ---- quick-start.md - Quick_start::Fixed_seed_RNGs (line 84) stdout ----
    error[E0463]: can't find crate for `rand`
     --> quick-start.md:85:1
      |
    2 | extern crate rand;
      | ^^^^^^^^^^^^^^^^^^ can't find crate
    
    error[E0463]: can't find crate for `rand_chacha`
     --> quick-start.md:86:1
      |
    3 | extern crate rand_chacha;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
    
    error[E0432]: unresolved import `rand_0_5`
     --> update-0.5.md:78:5
      |
    3 | use rand_0_5::{ChaChaRng, FromEntropy};
      |     ^^^^^^^^ you might be missing crate `rand_0_5`
      |
    help: consider importing the `rand_0_5` crate
      |
    2 + extern crate rand_0_5;
      |
    

    It's not easy to solve properly; mdbook needs its own Cargo.toml probably. See e.g. rust-lang/mdBook#394.

    We do have a work-around however:

    cd tests
    ./generate.sh
    cargo test
  2. vks commented on May 16, 2026

    @vks
    Contributor

    Do we want to wait for an upstream fix, or can we just close this issue?

  3. dhardy commented on May 17, 2026

    @dhardy
    Member

    We can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions