Skip to content

Scraping examples: works locally but not on docs.rs #2305

Closed
@killercup

Description

@killercup
Member

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)

Activity

killercup

killercup commented on Oct 13, 2023

@killercup
MemberAuthor

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

GuillaumeGomez commented on Oct 13, 2023

@GuillaumeGomez
Member

This now needs to be moved to cargo as it seems to be a cargo issue from what we could uncover.

fmease

fmease commented on Oct 13, 2023

@fmease
Member

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

GuillaumeGomez commented on Oct 13, 2023

@GuillaumeGomez
Member

It works if the crate is specified with path but doesn't when the crate is downloaded from crates.io (the default). That's why we reached this conclusion.

GuillaumeGomez

GuillaumeGomez commented on Nov 8, 2023

@GuillaumeGomez
Member

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

syphar commented on Nov 8, 2023

@syphar
Member

@GuillaumeGomez from what I remember of the discussion with @killercup , we were able to reproduce this locally, perhaps @Nemo157 knows more?

GuillaumeGomez

GuillaumeGomez commented on Nov 8, 2023

@GuillaumeGomez
Member

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

Nemo157 commented on Nov 8, 2023

@Nemo157
Member

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

GuillaumeGomez commented on Nov 8, 2023

@GuillaumeGomez
Member

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

GuillaumeGomez commented on Nov 28, 2023

@GuillaumeGomez
Member

So more information about this (for bevy): when adding back the workspace members:

[workspace]
members = [
  "crates/*",
]

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

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @killercup@Nemo157@syphar@GuillaumeGomez@fmease

        Issue actions

          Scraping examples: works locally but not on docs.rs · Issue #2305 · rust-lang/docs.rs