Closed
Description
In bevyengine/bevy#9154, I tried adding metadata to have the many examples bevy comes with show up in their API docs.
I have a full reproduction and detailed description of what I tried here: killercup/test-rustdoc-example-scraping-across-workspace-on-docrs#1
This relates to rust-lang/rust#88791
cc @rust-lang/docs-rs
(talked to @GuillaumeGomez about this already)
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
killercup commentedon Oct 13, 2023
After talking to some folks from @rust-lang/docs-rs, we discovered that no scraped examples are shown for items that are re-exported from other crates. It works for path dependencies.
GuillaumeGomez commentedon Oct 13, 2023
This now needs to be moved to
cargo
as it seems to be a cargo issue from what we could uncover.fmease commentedon Oct 13, 2023
Have you tried minimizing this issue to not rely on Cargo but just on
rustc
&rustdoc
and have failed? Just from reading the issue description, this sounds like a https://github.com/rust-lang/rust/labels/A-cross-crate-reexports issue but I haven't looked much into this issue.GuillaumeGomez commentedon Oct 13, 2023
It works if the crate is specified with
path
but doesn't when the crate is downloaded fromcrates.io
(the default). That's why we reached this conclusion.GuillaumeGomez commentedon Nov 8, 2023
Moved the issue in docs.rs as it seems to be a docs.rs-specific issue: every crate gets its scraped examples working when documenting them locally. My guess is that maybe we are using a read-only FS when we should not. To be confirmed.
syphar commentedon Nov 8, 2023
@GuillaumeGomez from what I remember of the discussion with @killercup , we were able to reproduce this locally, perhaps @Nemo157 knows more?
GuillaumeGomez commentedon Nov 8, 2023
That's also what I remember and yet I can't reproduce it locally again. @killercup and I talked about it in killercup/test-rustdoc-example-scraping-across-workspace-on-docrs#1. The surprising part being that the docs.rs command line (with
cargo rustdoc
) works locally.Nemo157 commentedon Nov 8, 2023
Yeah, my recollection is that the difference was that it didn't reproduce in the repository, but only in the published package, not anything to do with what docs.rs does with that package specifically.
GuillaumeGomez commentedon Nov 8, 2023
Ok, I'll keep the issue here for the time being and try to check what's going on when we get the crate from crates.io.
GuillaumeGomez commentedon Nov 28, 2023
So more information about this (for bevy): when adding back the workspace members:
And copying the relevant files locally, the examples are scraped as expected. Next step is to take a look into cargo and figure out why it's even needed in the first place.
3 remaining items