Skip to content

Conversation

el-ev
Copy link
Contributor

@el-ev el-ev commented Sep 21, 2025

SerializedSearchIndex::union calls Symbol::intern, requiring SESSION_GLOBALS to be set.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 21, 2025

r? @notriddle

rustbot has assigned @notriddle.
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

@GuillaumeGomez
Copy link
Member

Thanks! Can you add a regression test please?

@el-ev
Copy link
Contributor Author

el-ev commented Sep 22, 2025

I tried but couldn't write a test. The test utility automatically passes the current file path to rustdoc, so there's always an input file and it won't crash. I would appreciate any help with this.

@GuillaumeGomez
Copy link
Member

You can create a run-make tests like tests/run-make/rustdoc-map-file/rmake.rs.

@el-ev
Copy link
Contributor Author

el-ev commented Sep 22, 2025

You can create a run-make tests like tests/run-make/rustdoc-map-file/rmake.rs.

Test added, thanks.

@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Sep 22, 2025
.arg("--include-parts-dir=parts")
.arg("--merge=finalize")
.out_dir("out")
.run();
Copy link
Member

Choose a reason for hiding this comment

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

Please add a check to the output to ensure it doesn't crash.

Also, since you don't create a parts folder, I'm pretty sure it actually doesn't test the error:

error: --include-parts-dir expected parts/crate-info to be a file

So you need to create the folder and also the crate-info file into it too, and not empty too apparently otherwise we get:

error: could not write merged cross-crate info: "parts/crate-info": EOF while parsing a value at line 1 column 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, since you don't create a parts folder, I'm pretty sure it actually doesn't test the error

It doesn't test the error, it tests an ICE described in the linked issue.

So you need to create the folder and also the crate-info file into it too.

They should be created in the previous step by setting --parts-out-dir=parts.

Copy link
Member

Choose a reason for hiding this comment

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

Hum then it's surprising because I can't seem to reproduce it with latest nightly:

rustdoc 1.92.0-nightly (9f32ccf35 2025-09-21)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's strange. I can still reproduce it:

❯ rustdoc -vV
rustdoc 1.92.0-nightly (9f32ccf35 2025-09-21)
binary: rustdoc
commit-hash: 9f32ccf35fb877270bc44a86a126440f04d676d0
commit-date: 2025-09-21
host: aarch64-apple-darwin
release: 1.92.0-nightly
LLVM version: 21.1.1
❯ touch test.rs
❯ rustdoc test.rs -Zunstable-options --parts-out-dir=/tmp/parts_tmp --merge=none
❯ rustdoc -Zunstable-options --include-parts-dir=/tmp/parts_tmp --merge=finalize

thread 'main' (4343049) panicked at /rust/deps/scoped-tls-1.0.1/src/lib.rs:168:9:

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, got it. So two things missing: please check that the first command succeeded and created the expected files. And then check that the second command output doesn't contain the string error: internal compiler error:.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. .run() already implies a successful exit check.

@GuillaumeGomez
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 22, 2025

📌 Commit 42ebba2 has been approved by GuillaumeGomez

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 22, 2025
bors added a commit that referenced this pull request Sep 22, 2025
Rollup of 5 pull requests

Successful merges:

 - #146795 (Enable `limit_rdylib_exports` on wasm targets)
 - #146828 (fix a crash in rustdoc merge finalize without input file)
 - #146848 (Add x86_64-unknown-motor (Motor OS) tier 3 target)
 - #146884 (Fix modification check of `rustdoc-json-types`)
 - #146887 (Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit de7065b into rust-lang:master Sep 22, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 22, 2025
rust-timer added a commit that referenced this pull request Sep 22, 2025
Rollup merge of #146828 - el-ev:issue146646, r=GuillaumeGomez

fix a crash in rustdoc merge finalize without input file

- Closes #146646

`SerializedSearchIndex::union` calls `Symbol::intern`, requiring `SESSION_GLOBALS` to be set.
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Sep 23, 2025
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146795 (Enable `limit_rdylib_exports` on wasm targets)
 - rust-lang/rust#146828 (fix a crash in rustdoc merge finalize without input file)
 - rust-lang/rust#146848 (Add x86_64-unknown-motor (Motor OS) tier 3 target)
 - rust-lang/rust#146884 (Fix modification check of `rustdoc-json-types`)
 - rust-lang/rust#146887 (Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples)

r? `@ghost`
`@rustbot` modify labels: rollup
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Sep 24, 2025
fix a crash in rustdoc merge finalize without input file

- Closes rust-lang#146646

`SerializedSearchIndex::union` calls `Symbol::intern`, requiring `SESSION_GLOBALS` to be set.
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Sep 24, 2025
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#146795 (Enable `limit_rdylib_exports` on wasm targets)
 - rust-lang#146828 (fix a crash in rustdoc merge finalize without input file)
 - rust-lang#146848 (Add x86_64-unknown-motor (Motor OS) tier 3 target)
 - rust-lang#146884 (Fix modification check of `rustdoc-json-types`)
 - rust-lang#146887 (Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Sep 25, 2025
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146795 (Enable `limit_rdylib_exports` on wasm targets)
 - rust-lang/rust#146828 (fix a crash in rustdoc merge finalize without input file)
 - rust-lang/rust#146848 (Add x86_64-unknown-motor (Motor OS) tier 3 target)
 - rust-lang/rust#146884 (Fix modification check of `rustdoc-json-types`)
 - rust-lang/rust#146887 (Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Oct 9, 2025
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#146795 (Enable `limit_rdylib_exports` on wasm targets)
 - rust-lang#146828 (fix a crash in rustdoc merge finalize without input file)
 - rust-lang#146848 (Add x86_64-unknown-motor (Motor OS) tier 3 target)
 - rust-lang#146884 (Fix modification check of `rustdoc-json-types`)
 - rust-lang#146887 (Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustdoc crashes when running --merge=finalize without an input crate root

5 participants