Skip to content

Use -Z rustdoc-map instead of rewriting it - #1188

Merged
jyn514 merged 4 commits into
rust-lang:masterfrom
jyn514:rustdoc-map
Nov 22, 2020
Merged

Use -Z rustdoc-map instead of rewriting it#1188
jyn514 merged 4 commits into
rust-lang:masterfrom
jyn514:rustdoc-map

Conversation

@jyn514

@jyn514 jyn514 commented Nov 22, 2020

Copy link
Copy Markdown
Member

Closes #1177, closes #1165. Fixes #1166.

@jyn514 jyn514 added S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. A-builds Area: Building the documentation for a crate labels Nov 22, 2020
@Nemo157

Nemo157 commented Nov 22, 2020

Copy link
Copy Markdown
Contributor

A crate to test #1166 with is futures-util-preview 0.2.2, it depends on futures-core-preview which has the lib name futures_core. (Note that futures-core-preview has an html_root_url, so the only way to check would be looking at the command line passed to rustdoc, which we don't show 😦).

@Nemo157

Nemo157 commented Nov 22, 2020

Copy link
Copy Markdown
Contributor

Tested with this little patch applied on top:

diff --git src/docbuilder/rustwide_builder.rs src/docbuilder/rustwide_builder.rs
index 83592dc..1a80aea 100644
--- src/docbuilder/rustwide_builder.rs
+++ src/docbuilder/rustwide_builder.rs
@@ -579,6 +579,9 @@ impl RustwideBuilder {

         // Add docs.rs specific arguments
         let mut cargo_args = Vec::new();
+        cargo_args.push("--verbose".into());
+        cargo_args.push(r#"--config=doc.extern-map.registries.crates-io="https://docs.rs""#.into());
+        cargo_args.push("-Zunstable-options".into());
         if let Some(cpu_limit) = self.config.build_cpu_limit {
             cargo_args.push(format!("-j{}", cpu_limit));
         }

On master I see us passing:

"--extern-html-root-url" "futures_core_preview=https://docs.rs/futures-core-preview/0.2.3"

And on this branch I see cargo passing:

--extern-html-root-url 'futures_core=https://docs.rs/futures-core-preview/0.2.3/'

So this definitely fixes #1166

@jyn514

jyn514 commented Nov 22, 2020

Copy link
Copy Markdown
Member Author

Thanks, that definitely looks like the right approach since it means the hyperlinks will work even when built with old versions of nightly :)

This is ready for re-review.

@jyn514 jyn514 added S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed and removed S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. labels Nov 22, 2020
Comment thread src/docbuilder/rustwide_builder.rs Outdated
@jyn514 jyn514 added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Nov 22, 2020
@jyn514
jyn514 merged commit 7ec7f9b into rust-lang:master Nov 22, 2020
@jyn514
jyn514 deleted the rustdoc-map branch November 22, 2020 19:32
@emilyalbini

Copy link
Copy Markdown
Member

Random note on this: it'd be nice if rustdoc-map allowed using the semver pattern instead of the version, since docs.rs would then redirect to the latest semver-compatible docs automatically:

https://docs.rs/rustwide/^0.10/...

@jyn514

jyn514 commented Nov 24, 2020

Copy link
Copy Markdown
Member Author

That would be nice, yeah - it needs rustdoc changes first, though.
#1055

@jyn514 jyn514 removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-builds Area: Building the documentation for a crate

Projects

None yet

3 participants