Skip to content

Conversation

notriddle
Copy link
Contributor

All of the docs need to be built with the same rustdoc. Otherwise, any change to the search index breaks everything, because the two rustdocs don't agree on the format.

Fixes #147142

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Sep 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 30, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

compilers.build_compiler()
}
Mode::ToolBootstrap => {
// bootstrap/host tools should be documented with the stage 0 compiler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe have a comment somewhere emphasizing that everything needs to be documented with the same rustdoc?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not 100% true. For local usage, you can document them with whatever you want, you only need the same rustdoc when you dist everything together and ship it as a single docs directory.

@Kobzol
Copy link
Member

Kobzol commented Sep 30, 2025

Hmm, this is not the best solution, because ideally we would still allow documenting local stage0 stuff using stage0 rustdoc, but override the rustdoc being used for the actual doc dist steps. However, that would require a lot of non-trivial refactoring due to the way the dist doc steps are currently structured. And I assume that not many people actually run stage0 rustdoc on these tools locally, so it shouldn't hopefully be a usability regression.

So let's go forward with this, for now.

Please let's just add a small comment on top of these stage0 tool_doc invocations that says that they currently use tool_target in order to be documented with stage1+ rustdoc when we dist them. Then you can r=me.

r? @Kobzol

@rustbot rustbot assigned Kobzol and unassigned Mark-Simulacrum Sep 30, 2025
@GuillaumeGomez
Copy link
Member

Is there anyone using stage 0 rustdoc to build docs?

@Mark-Simulacrum
Copy link
Member

Is there some way for bootstrap or rustdoc to notice (perhaps in the dist artifacts?) that we used two different versions and bail out? Maybe when we produce the rustc and std doc components we could run such a check?

All of the docs need to be built with the same rustdoc. Otherwise,
any change to the search index breaks everything, because the two
rustdocs don't agree on the format.
@notriddle
Copy link
Contributor Author

Okay, I've added the comment.

@bors r=Kobzol

@bors
Copy link
Collaborator

bors commented Sep 30, 2025

📌 Commit ba13b6e has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 30, 2025
bors added a commit that referenced this pull request Sep 30, 2025
Rollup of 6 pull requests

Successful merges:

 - #142506 (Add `Path::has_trailing_sep` and related methods)
 - #146886 (Add repr(align(2)) to RcInner and ArcInner)
 - #147166 (several small `proc_macro` cleanups)
 - #147172 (bootstrap: build bootstrap docs with in-tree rustdoc)
 - #147181 (cg_llvm: Replace enum `MetadataType` with a list of `MetadataKindId` constants)
 - #147187 (remove unnecessary test directives)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4cbaa70 into rust-lang:master Sep 30, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 30, 2025
rust-timer added a commit that referenced this pull request Sep 30, 2025
Rollup merge of #147172 - notriddle:tooldoc, r=Kobzol

bootstrap: build bootstrap docs with in-tree rustdoc

All of the docs need to be built with the same rustdoc. Otherwise, any change to the search index breaks everything, because the two rustdocs don't agree on the format.

Fixes #147142
@notriddle notriddle deleted the tooldoc branch October 1, 2025 02:45
@Kobzol
Copy link
Member

Kobzol commented Oct 1, 2025

Is there some way for bootstrap or rustdoc to notice (perhaps in the dist artifacts?) that we used two different versions and bail out? Maybe when we produce the rustc and std doc components we could run such a check?

I guess we'd have to add some metadata to the generated documentation and then check it in a post-dist test.

I think that the current bootstrap snapshot test is enough.

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

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Searching nightly-rustc docs is broken: "Unhandled Promise Rejection: Error: not a roaring bitmap: 101"

7 participants