Skip to content

Conversation

mladedav
Copy link
Collaborator

Motivation

The failed docs.rs build of 0.8.5 was not caught in CI though it probably should have been.

Solution

Add --cfg docsrs to the rustdoc invocations. This makes the docs build process more like what's going to happen in the docs.rs build and can check for similar kinds of failures that are gated behind this cfg option.

@syphar
Copy link

syphar commented Sep 30, 2025

A better way to test if docs would succeed is cargo docs-rs.

There are still some possible edge cases, especially around system dependencies, but cargo docs-rs comes quite near to what we actually do.

@mladedav
Copy link
Collaborator Author

Thanks for the suggestion. However, it fails for me locally on proc-macro2, not sure why:

error[E0412]: cannot find type `SourceFile` in crate `proc_macro`
   --> /home/mladedav/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/proc-macro2-1.0.92/src/wrapper.rs:366:26
    |
366 |     Compiler(proc_macro::SourceFile),
    |                          ^^^^^^^^^^ not found in `proc_macro`
    |
help: consider importing one of these structs
    |
  1 + use crate::SourceFile;
    |
  1 + use crate::fallback::SourceFile;
    |
help: if you import `SourceFile`, refer to it directly
    |
366 -     Compiler(proc_macro::SourceFile),
366 +     Compiler(SourceFile),
    |

(there are two more similar errors)

I can also see that bevy ended up doing this manually too because of lack of --workspace support (we don't need that since we're just checking and not publishing the docs) but maybe using some of those settings would be closer to docs.rs and hopefully good enough for this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants