From ed02421badcb3a3725a0c6093e2b5f27a0ec2306 Mon Sep 17 00:00:00 2001 From: rustbot <47979223+rustbot@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:01:23 -0400 Subject: [PATCH 1/4] Update books --- src/doc/edition-guide | 2 +- src/doc/embedded-book | 2 +- src/doc/reference | 2 +- src/doc/rustc-dev-guide | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/edition-guide b/src/doc/edition-guide index c7ebae25cb480..1f07c242f8162 160000 --- a/src/doc/edition-guide +++ b/src/doc/edition-guide @@ -1 +1 @@ -Subproject commit c7ebae25cb4801a31b6f05353f6d85bfa6feedd1 +Subproject commit 1f07c242f8162a711a5ac5a4ea8fa7ec884ee7a9 diff --git a/src/doc/embedded-book b/src/doc/embedded-book index f40a8b420ec4b..ddbf1b4e2858f 160000 --- a/src/doc/embedded-book +++ b/src/doc/embedded-book @@ -1 +1 @@ -Subproject commit f40a8b420ec4b4505d9489965e261f1d5c28ba23 +Subproject commit ddbf1b4e2858fedb71b7c42eb15c4576517dc125 diff --git a/src/doc/reference b/src/doc/reference index c64e52a3d306e..b2fd0f288b8b9 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit c64e52a3d306eac0129f3ad6c6d8806ab99ae2e9 +Subproject commit b2fd0f288b8b94cb34d53a893b9217251bf4e4c1 diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide index 07bc9ca9eb1cd..59d94ea75a0b1 160000 --- a/src/doc/rustc-dev-guide +++ b/src/doc/rustc-dev-guide @@ -1 +1 @@ -Subproject commit 07bc9ca9eb1cd6d9fbbf758c2753b748804a134f +Subproject commit 59d94ea75a0b157e148af14c73c2dd60efb7b60a From 66ebb47b0428cc16095a9928608f155e74f19df8 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 21 Oct 2024 10:19:58 -0700 Subject: [PATCH 2/4] Update Cargo.lock due to mdbook extension changes --- src/tools/rustbook/Cargo.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/rustbook/Cargo.lock b/src/tools/rustbook/Cargo.lock index 060deb1834400..27ccb205b50ab 100644 --- a/src/tools/rustbook/Cargo.lock +++ b/src/tools/rustbook/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "adler2" @@ -704,6 +704,7 @@ dependencies = [ "semver", "serde_json", "tempfile", + "walkdir", ] [[package]] From 87fb4eaa9d892d3331c2651736d6d141ea827b90 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 23 Oct 2024 10:51:16 -0700 Subject: [PATCH 3/4] Update reference --- src/doc/reference | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/reference b/src/doc/reference index b2fd0f288b8b9..23ce619966541 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit b2fd0f288b8b94cb34d53a893b9217251bf4e4c1 +Subproject commit 23ce619966541bf2c80d45fdfeecf3393e360a13 From df8551b60aa2b3442ccda21ac5a8bcabd2a7d67c Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 23 Oct 2024 10:52:12 -0700 Subject: [PATCH 4/4] Update rustbook to support new test linking in reference --- src/bootstrap/src/core/build_steps/doc.rs | 9 ++++++++- src/tools/rustbook/src/main.rs | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index ca2b874264788..69ec832a44aa7 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -170,7 +170,14 @@ impl Step for RustbookSrc

{ builder.add_rustc_lib_path(compiler, &mut rustbook_cmd); } - rustbook_cmd.arg("build").arg(&src).arg("-d").arg(&out).run(builder); + rustbook_cmd + .arg("build") + .arg(&src) + .arg("-d") + .arg(&out) + .arg("--rust-root") + .arg(&builder.src) + .run(builder); for lang in &self.languages { let out = out.join(lang); diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index 2118af6139690..f905b9277ff51 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -22,6 +22,11 @@ fn main() { .required(false) .value_parser(clap::value_parser!(String)); + let root_arg = arg!(--"rust-root" +"Path to the root of the rust source tree") + .required(false) + .value_parser(clap::value_parser!(PathBuf)); + let dir_arg = arg!([dir] "Root directory for the book\n\ (Defaults to the current directory when omitted)") .value_parser(clap::value_parser!(PathBuf)); @@ -37,6 +42,7 @@ fn main() { .about("Build the book from the markdown files") .arg(d_arg) .arg(l_arg) + .arg(root_arg) .arg(&dir_arg), ) .subcommand( @@ -96,7 +102,8 @@ pub fn build(args: &ArgMatches) -> Result3<()> { } if book.config.get_preprocessor("spec").is_some() { - book.with_preprocessor(Spec::new()); + let rust_root = args.get_one::("rust-root").cloned(); + book.with_preprocessor(Spec::new(rust_root)?); } book.build()?;