From: Jonathan Corbet <corbet@lwn.net>
To: Carlos Bilbao <carlos.bilbao@amd.com>, ojeda@kernel.org
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
bilbao@vt.edu, Carlos Bilbao <carlos.bilbao@amd.com>
Subject: Re: [PATCH] docs: Integrate rustdoc-generated output to Rust docs
Date: Mon, 28 Nov 2022 15:23:16 -0700 [thread overview]
Message-ID: <87h6yi67mz.fsf@meer.lwn.net> (raw)
In-Reply-To: <20221128201932.168313-1-carlos.bilbao@amd.com>
Carlos Bilbao <carlos.bilbao@amd.com> writes:
> Include HTML output generated from rustdoc into the Linux kernel
> documentation on Rust. Add Makefile target `make htmlrust` to combine
> make htmldocs and the generation of Rust documentation.
>
> Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
> ---
> Documentation/Makefile | 11 +++++++++++
> Documentation/rust/index.rst | 1 +
> Documentation/rust/rustdoc.rst | 10 ++++++++++
> Makefile | 2 +-
> 4 files changed, 23 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/rust/rustdoc.rst
Thanks for doing this. I do have a number of comments; please let me
know if you think I'm missing something somewhere.
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 64d44c1ecad3..02ed01fa3499 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -95,6 +95,17 @@ htmldocs:
> @$(srctree)/scripts/sphinx-pre-install --version-check
> @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
>
> +ifdef CONFIG_RUST
> +htmlrust:
> + @make rustavailable
> + @make LLVM=1 rustdoc
> + @cp -r rust/doc/* Documentation/output/
> + @make htmldocs
> +else
> +htmlrust:
> + @echo "Error: CONFIG_RUST must be defined (see .config)"
> +endif
First, if at all possible, the Rust documentation should just be built
along with the rest; no need for a separate make command. We don't have
separate build commands for any other subsystem's docs, and Rust should
be a first-class citizen here too.
Second, I'm not a big fan of that "cp" command, for a couple of reasons:
- It dumps a bunch of stuff into the main output directory, which risks
overwriting something someday. It seems like
Documentation/output/html/rust might be a better place.
- Rather than copying, I'd suggest changing the rustdoc command that
generates that output to just put it in the place where it should be.
Preferably it should work properly when people use separate build
trees as well.
It would also be nice to set up proper dependencies so that the Rust
docs are only regenerated if something has changed.
Does this all make sense? Sorry to come back with all this stuff...I
really do want to see this happen.
Thanks,
jon
next prev parent reply other threads:[~2022-11-28 22:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 20:19 [PATCH] docs: Integrate rustdoc-generated output to Rust docs Carlos Bilbao
2022-11-28 21:06 ` Miguel Ojeda
2022-11-28 22:23 ` Jonathan Corbet [this message]
2022-11-30 14:18 ` Carlos Bilbao
2022-11-30 3:57 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6yi67mz.fsf@meer.lwn.net \
--to=corbet@lwn.net \
--cc=bilbao@vt.edu \
--cc=carlos.bilbao@amd.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox