diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 4787578e19db0..9299a47c70c57 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -1319,6 +1319,10 @@ impl Step for UnstableBookGen { cmd.arg(rustc_path); cmd.arg(out); + // Running rustc requires the library path if rust.rpath = false + // or any other libraries are in a custom location. + builder.add_rustc_lib_path(self.build_compiler, &mut cmd); + cmd.run(builder); } } diff --git a/src/tools/unstable-book-gen/src/main.rs b/src/tools/unstable-book-gen/src/main.rs index 923ca65b25501..e95d00f96c15e 100644 --- a/src/tools/unstable-book-gen/src/main.rs +++ b/src/tools/unstable-book-gen/src/main.rs @@ -128,6 +128,7 @@ fn collect_compiler_flags(rustc_path: impl AsRef) -> Features { rustc.env("RUSTC_BOOTSTRAP", "1"); rustc.arg("-Zhelp"); let output = t!(rustc.output()); + assert!(output.status.success(), "`rustc -Zhelp` failed: {output:?}"); let help_str = t!(String::from_utf8(output.stdout)); let parts = help_str.split("\n -Z").collect::>(); assert!(!parts[1..].is_empty(), "no -Z options were found");