Description
Docs.rs shows 'empty_library' in the sidebar and has no search results other than empty_library
.
Original bug report
When publishing a no_std crate without dependencies, it will add an empty_library
to the crates on [docs.rs].
Reproduction steps:
- Publish a no_std library without dependencies.
- The docs.rs page will now have a
empty_library
in the crates.
This seems like a rather awkward way to tell the reader the crate has no dependencies. Now if you click any deeper into the documentation, on the left (under the crates header) the empty_library will be a clickable link that leads to a dead link.
This is what I mean: Link to CRC8-RS Docs
Activity
Nemo157 commentedon Mar 11, 2021
Not specific to
no-std
libraries, seems to have started happening within the last month or so, either a docs.rs, rustwide or rustdoc change. Skimming the docs.rs merge requests none stand out to me as potentially causing this.Nemo157 commentedon Mar 11, 2021
More specifically it appears to have changed between
and
(from comparing https://docs.rs/syn/1.0.62/syn/ and https://docs.rs/syn/1.0.61/syn/)
docs.rs changes: da1f362...918ee5d
rustdoc changes: rust-lang/rust@45b3c28...caca212
Nemo157 commentedon Mar 11, 2021
To confirm I went back through the release pages and found the exact builds which changed behaviour, https://docs.rs/near-runtime/4.0.0-pre.1/near_runtime/ was the last build that didn't show
empty_library
, and https://docs.rs/mangadex-api/0.2.4/mangadex_api/ was the first build that showed it (currently on page https://docs.rs/releases/recent/59, but will be moving further back as more builds happen). These were both with docs.rsda1f362
, but therustc
version changed.[-]Publishing a no_std crate without dependencies causes a `empty_library` dependency.[/-][+]Publishing a crate without dependencies causes a `empty_library` dependency.[/+]coastalwhite commentedon Mar 11, 2021
Would this then be a
rustdoc
issue, and should I open one over there?I am not getting this behaviour, when just normally compiling documentation on my local machine. It could be that there are some flags of
rustdoc
that are bugged.Nemo157 commentedon Mar 11, 2021
It seems like it's a change in
rustdoc
behaviour, but it is docs.rs specific, we useempty_library
as a dummy library. It might be that we need to change something here to workaround whatever changed rather than changing rustdoc. (I skimmed the PRs, and couldn't see anything that would have changed rustdoc's behaviour in that release 🤷).docs.rs/src/docbuilder/rustwide_builder.rs
Line 59 in 65e946c
jyn514 commentedon Mar 11, 2021
I'd expect this to be a regression from rust-lang/rust#80845, cc @GuillaumeGomez. Do we maybe keep the artifacts from the
empty_library
crate around when documenting other crates?Nemo157 commentedon Mar 11, 2021
Huh, weird that that PR doesn't appear in the compare view though? Looks like that would be in the 2021-03-06/07 nightly, not the 2021-03-05 one.
jyn514 commentedon Mar 11, 2021
Oh oops I was looking at the wrong dates. These are the changes between the toolchains:
It would be helpful if someone could bisect them.
GuillaumeGomez commentedon Mar 11, 2021
Checking what's wrong.
GuillaumeGomez commentedon Mar 11, 2021
It's an interesting "bug" from rustdoc indeed. Sending a fix.
GuillaumeGomez commentedon Mar 11, 2021
Actually no, it's not a bug from rustdoc. Here how it works for rustdoc:
crates.js
list the crates fromsearch-index.js
. Meaning that at some point, the file isn't empty as it should. The problem here is that the rustdoc update wasn't fully integrated into docs.rs.GuillaumeGomez commentedon Mar 11, 2021
So here, I see two possibilities:
crates.js
from the foldercrates.js
when the--disable-per-crate-search
argument is passed in rustdoc.Which solution do you prefer?
11 remaining items