Open dtolnay opened 1 month ago
Hi @dtolnay , thank you for the report!
My hunch is that this is related to the toml-tweaker in the rustwide
library we and crater are using.
That being said, I think the source we upload and render in docs.rs should not include the tweaked toml, but the one from the archive.
I can dig deeper this week
I noticed that the source code rendered by docs.rs at
https://docs.rs/crate/${name}/${version}/source/Cargo.toml
is different from the Cargo.toml actually in the published archive, athttps://static.crates.io/crates/${name}/${version}/download
. (Note: this is not a confusion between Cargo.toml vs Cargo.toml.orig.)From skimming the code in this repo, I did not come across what is causing the contents to get mangled, so I have opened this issue to verify whether this is intentional. Naively I would expect docs.rs's
source
pages to be serving exactly the contents that are in the published archives.Example
https://docs.rs/crate/unicode-ident/1.0.13/source/Cargo.toml currently shows this content:
However, according to
curl --silent https://static.crates.io/crates/unicode-ident/1.0.13/download | tar xzO unicode-ident-1.0.13/Cargo.toml
the crate contains the following different content instead. This would also be the same content found in$CARGO_HOME/registry/src/index.crates.io-6f17d22bba15001f/unicode-ident-1.0.13/Cargo.toml
.The TOML data structure is the same but docs.rs has seemingly alphabetized the content, and also stripped the comment block that had been inserted by Cargo.