Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Commonly used middleware" links are broken in middleware module docs #1180

Closed
jplatte opened this issue Jul 21, 2022 · 14 comments · Fixed by #1205
Closed

"Commonly used middleware" links are broken in middleware module docs #1180

jplatte opened this issue Jul 21, 2022 · 14 comments · Fixed by #1205
Labels
A-axum E-help-wanted Call for participation: Help is requested to fix this issue. T-docs Topic: documentation

Comments

@jplatte
Copy link
Member

jplatte commented Jul 21, 2022

Title says it all.

@davidpdrsn davidpdrsn added T-docs Topic: documentation E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. A-axum labels Jul 21, 2022
@lameferret
Copy link

I'd like to work on this.

@jplatte
Copy link
Member Author

jplatte commented Jul 22, 2022

Go ahead!

@jplatte
Copy link
Member Author

jplatte commented Jul 25, 2022

@davidpdrsn have you been following the discussion in #1184? There seem to be some reproducibility issues with this bug. Maybe it's worth just doing another small point release with recent back-portable improvements and seeing whether this is fixed when docs.rs does a re-generation of the docs? Or alternatively, I think there's a way for people from the docs.rs team to trigger re-builds of existing docs, if you want I can get in touch with them.

@davidpdrsn
Copy link
Member

@jplatte Sure! I'll backport some stuff and prep a release PR.

@davidpdrsn
Copy link
Member

0.5.14 is out. Lets see if that fixes it 🤞

@davidpdrsn
Copy link
Member

Seems that didn't fix it :(

@jplatte jplatte removed the E-easy Call for participation: Experience needed to fix: Easy / not much label Jul 26, 2022
@jplatte
Copy link
Member Author

jplatte commented Jul 26, 2022

Right. Have you tried reproducing locally yourself? If it's really not reproducible easily, we might have to have a closer look at how docs.rs actually operates (which Nightly / which compiler flags / ...).

@davidpdrsn
Copy link
Member

I tried a regular cargo doc yesterday and that worked. So yeah I think we need to dig deeper.

@jplatte
Copy link
Member Author

jplatte commented Jul 26, 2022

Did you try what I posted in #1184?

@davidpdrsn
Copy link
Member

That works if I build with RUSTDOCFLAGS='--cfg docsrs' cargo +nightly doc --all-features so without --no-deps.

@jplatte
Copy link
Member Author

jplatte commented Jul 26, 2022

But what happens with --no-deps? That's important, docs.rs doesn't re-create all the dependencies docs when documenting one crate (it uses the rustdoc-map feature instead to be able to generate cross-crate links).

@davidpdrsn
Copy link
Member

Then it doesn't work and I get these errors in the browser dev console

image

@jplatte
Copy link
Member Author

jplatte commented Jul 26, 2022

Right. I would expect that #1184 changes nothing about that? I think we just have to use http links to docs.rs for now. And ideally report a bug about this on rust-lang/rust (I couldn't find an existing one).

@jplatte
Copy link
Member Author

jplatte commented Jul 28, 2022

Sooo.. I found out what's wrong! It's that the intra-doc links only resolve tower / tower-http actually contain those items, which is determined by the features activated on them. It looks like somehow docs.rs ignores dev-dependencies when building docs, which are of course usually not required for docs to build correctly, but here they are. I'll look for existing bug reports about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum E-help-wanted Call for participation: Help is requested to fix this issue. T-docs Topic: documentation
Projects
None yet
3 participants