Re: [PATCH] rust: kbuild: clean output before running `rustdoc`
From: Miguel Ojeda
Date: Tue Aug 12 2025 - 15:54:55 EST
On Sat, Jul 26, 2025 at 3:34 PM Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:
>
> `rustdoc` can get confused when generating documentation into a folder
> that contains generated files from other `rustdoc` versions.
>
> For instance, running something like:
>
> rustup default 1.78.0
> make LLVM=1 rustdoc
> rustup default 1.88.0
> make LLVM=1 rustdoc
>
> may generate errors like:
>
> error: couldn't generate documentation: invalid template: last line expected to start with a comment
> |
> = note: failed to create or modify "./Documentation/output/rust/rustdoc/src-files.js"
>
> Thus just always clean the output folder before generating the
> documentation -- we are anyway regenerating it every time the `rustdoc`
> target gets called, at least for the time being.
>
> Cc: stable@xxxxxxxxxxxxxxx # Needed in 6.12.y and later (Rust is pinned in older LTSs).
> Reported-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
> Closes: https://rust-for-linux.zulipchat.com/#narrow/channel/288089/topic/x/near/527201113
> Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
Applied to `rust-fixes` -- thanks everyone!
Cheers,
Miguel