Skip to content

cargo should clear doc directory between versions #8461

Closed
@ehuss

Description

@ehuss

Rustdoc can fail if you build documentation with different versions of rustdoc. Rustdoc has some persistent files (like search-index.js) which are not internally versioned. If the format of these changes, this can cause things to break. Example:

In a project with at least one dependency:

  1. cargo +1.40.0 doc
  2. cargo +1.41.0 doc --no-deps --open

The result will have javascript errors in the console, and the sidebar and search will be broken.

cc rust-lang/rust#70781

To fix this, Cargo should retain a fingerprint somewhere that tracks the rustc version used when building documentation. Changes to that should cause Cargo to delete the doc directory.

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

    Issue actions