Skip to content

Commit 1d919c9

Browse files
committed
Auto merge of rust-lang#74124 - ehuss:fix-doc-dry-run-up-to-date, r=Mark-Simulacrum
Fix occasional bootstrap panic in docs. I am occasionally running into this panic when running `x.py`: > thread 'main' panicked at 'source "/Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/md-doc/unstable-book" failed to get metadata: No such file or directory (os error 2)', src/build_helper/lib.rs:173:19 I have not been able to figure out the exact sequence of commands that leads to this error (I tried for quite a while to reproduce it). I think it may involve updating my tree, but I am uncertain. An artificial way to trigger it is to build the documentation, and then delete the `md-doc` directory manually. The cause is that bootstrap does a "dry run" before every command, and in this case `up_to_date` panics because the destination exists (`build/x86_64-apple-darwin/doc/unstable-book/index.html `) but the source does not (`build/x86_64-apple-darwin/md-doc/unstable-book`). I am uncertain if it is important that the last line `builder.run(…)` needs to be called during the dry run. This patch seems to fix the issue, though.
2 parents 8ac1525 + 561d5ac commit 1d919c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bootstrap/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl Step for RustbookSrc {
156156
let index = out.join("index.html");
157157
let rustbook = builder.tool_exe(Tool::Rustbook);
158158
let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook);
159-
if up_to_date(&src, &index) && up_to_date(&rustbook, &index) {
159+
if builder.config.dry_run || up_to_date(&src, &index) && up_to_date(&rustbook, &index) {
160160
return;
161161
}
162162
builder.info(&format!("Rustbook ({}) - {}", target, name));

0 commit comments

Comments
 (0)