diff --git a/Cargo.toml b/Cargo.toml index 67c7a9d67edc8..fe444de6b2782 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,6 +55,7 @@ exclude = [ "compiler/rustc_codegen_gcc", "src/bootstrap", "tests/rustdoc-gui", + "src/doc/reference/mdbook-spec", # HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`. "obj", ] diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index d888e63275cda..7f7c0100947b7 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -2496,7 +2496,9 @@ impl BookTest { let path = builder.src.join(&self.path); // Books often have feature-gated example text. rustbook_cmd.env("RUSTC_BOOTSTRAP", "1"); - rustbook_cmd.env("PATH", new_path).arg("test").arg(path); + rustbook_cmd.env("PATH", new_path).arg("test").arg(&path); + // The reference has a nested `cargo run` in `preprocessor.spec` which uses relative paths. + rustbook_cmd.current_dir(&path); // Books may also need to build dependencies. For example, `TheBook` has // code samples which use the `trpl` crate. For the `rustdoc` invocation