From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Carlos Bilbao <carlos.bilbao@kernel.org>,
Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-kernel@vger.kernel.org, Miguel Ojeda <ojeda@kernel.org>
Subject: Re: [PATCH 0/1] fix rustdoc build detection
Date: Mon, 17 Nov 2025 13:32:03 +0100 [thread overview]
Message-ID: <20251117133203.71b97d47@foz.lan> (raw)
In-Reply-To: <CANiq72m3deG_QsH8-AskTR9LcNL=G6E9o2fu+oi9RVXn1PK_+Q@mail.gmail.com>
Em Mon, 17 Nov 2025 12:22:48 +0100
Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> escreveu:
> On Mon, Nov 17, 2025 at 11:48 AM Mauro Carvalho Chehab
> <mchehab+huawei@kernel.org> wrote:
> >
> > Sure, Sphinx (including kernel-doc) build and rust doca build are
> > independent. Yet, Makefile "htmldocs" target currently does both.
> >
> > It could make sense to have a separate target if one want to build
> > them both, e.g. something like:
>
> My understanding (Cc'ing Carlos) is that the idea was that `htmldocs`
> built the Rust docs if possible.
>
> I don't mind if that is changed etc., but I think it is important to
> keep the `rustdoc` target simple and focused: it is a "basic"
> operation (which is also used to lint docs too), and way faster than
> building the HTML docs, and it doesn't depend on them.
Heh, the same applies to the current usage of htmldocs - specially
when SPHINXDIRS is used, e.g. one doing, for instance:
make SPHINXDOCS=driver-api/<subsystem>
may not be interested on building rust docs, which, on such case,
may be a lot slower than a partial build. Also, I don't think that
rustdoc currently does something similar to SPHINXDOCS.
So, at least for me, it does make sense to have separate targets
for Sphinx, Rust and both (*).
(*) now, how such targets would be named is a completely different
question.
> Apologies if I put it perhaps a bit too tersely in my previous message
> -- everyone contributing to Rust code is supposed to rely on that
> target to test their commits, and needing the whole Sphinx setup would
> make the target way worse in practice.
Agreed.
>
> Now, in the future, if we start relying on generating references for
> the Rust docs from the C side and things like that (which is my plan,
> but it is long term: first item in
> https://github.com/Rust-for-Linux/linux/issues/350), we may need to
> rethink things a bit (i.e. we may need to run a subset of the kernel
> normal docs to build the Rust docs), but even then ideally we should
> only introduce the minimal dependency needed.
IMO, this is a separate discussion, as you may need a different
toolset.
The way I see, for issue #350 IMO the best would be to create a
Sphinx extension similar to:
Documentation/sphinx/parser_yaml.py
E.g. you would create a parser_rust.py module there, which would
generate ReST output from the rust code(*). Besides allowing cross
references between Sphinx, C and Rust, this would also allow
generating epub and pdf output.
(*) In practice, teaching rustdoc how to produce ReST output.
Alternatively, rustdoc could generate a markdown output and use
a sphinx markdown extension at parser_rust.py, to convert from
MD to ReST like this extension:
https://www.sphinx-doc.org/en/master/usage/markdown.html
Besides allowing cross references between Sphinx, C and Rust, a Sphinx
extension would also allow generating epub and pdf output, removing
all extra Makefile (or wrapper) code related to rustdoc.
-
Another alternative would be to use intersphinx, but I guess
making it working would be a lot more complex - as we don't even
support it yet on our current Sphinx output.
Thanks,
Mauro
next prev parent reply other threads:[~2025-11-17 12:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 9:12 [PATCH 0/1] fix rustdoc build detection Mauro Carvalho Chehab
2025-11-17 9:12 ` [PATCH 1/1] docs: makefile: move rustdoc check to the build wrapper Mauro Carvalho Chehab
2025-11-17 9:20 ` Miguel Ojeda
2025-11-17 11:04 ` Mauro Carvalho Chehab
2025-11-18 16:38 ` Jonathan Corbet
2025-11-18 19:11 ` Mauro Carvalho Chehab
2025-11-18 20:32 ` Mauro Carvalho Chehab
2025-11-18 21:34 ` Miguel Ojeda
2025-11-18 21:40 ` Miguel Ojeda
2025-11-20 20:13 ` Mauro Carvalho Chehab
2025-11-17 9:19 ` [PATCH 0/1] fix rustdoc build detection Miguel Ojeda
2025-11-17 10:48 ` Mauro Carvalho Chehab
2025-11-17 11:22 ` Miguel Ojeda
2025-11-17 11:25 ` Miguel Ojeda
2025-11-17 12:32 ` Mauro Carvalho Chehab [this message]
2025-11-18 22:02 ` Miguel Ojeda
2025-11-21 9:40 ` Mauro Carvalho Chehab
2025-11-24 1:51 ` Miguel Ojeda
2025-11-24 8:18 ` Mauro Carvalho Chehab
2025-11-24 8:34 ` Mauro Carvalho Chehab
2025-11-18 23:23 ` Carlos Bilbao
2025-11-21 9:12 ` Mauro Carvalho Chehab
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=20251117133203.71b97d47@foz.lan \
--to=mchehab+huawei@kernel.org \
--cc=carlos.bilbao@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).