linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Carlos Bilbao <carlos.bilbao.osdev@gmail.com>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	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: Fri, 21 Nov 2025 10:12:36 +0100	[thread overview]
Message-ID: <20251121101236.5b1f9989@foz.lan> (raw)
In-Reply-To: <cdadc017-8874-4af0-b62a-62f70ee5d9eb@gmail.com>

Em Tue, 18 Nov 2025 17:23:48 -0600
Carlos Bilbao <carlos.bilbao.osdev@gmail.com> escreveu:

> Hey there,
> 
> On 11/17/25 05:22, Miguel Ojeda wrote:
> > 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.  
> 
> 
> Thanks! I'll also take a look at this, although I fear it'll be complicated
> without a way to reproduce what Mauro experienced.

I was able to get the scenario on linux-next. It is a little bit
tricky to reproduce.

1) I did a build with:

	$ make distclean
	$ make SPHINXDIRS=peci htmldocs

   rustdoc was not called.

2) copied a .config that has CONFIG_RUST there:

	$ cp config-rust .config
	$ make SPHINXDIRS=peci htmldocs

   rustdoc was not called.

3) manually called rustdoc:

	$ make rustdoc

   rustdoc was built.

4) now, I re-ran htmldocs:

	$ make SPHINXDIRS=peci htmldocs

   rustdoc was built.

5) I replaced .config with a config without rust:

	$ make allyesconfig
	$ make SPHINXDIRS=peci htmldocs
	...
	Using alabaster theme
	Using Python kernel-doc
	  SYNC    include/config/auto.conf
	  HOSTCC  scripts/basic/fixdep
	  DESCEND objtool
	  INSTALL libsubcmd_headers
	  CC      scripts/mod/empty.o
	  CC      scripts/mod/devicetable-offsets.s
	  MKELF   scripts/mod/elfconfig.h
	  HOSTCC  scripts/mod/modpost.o
	  HOSTCC  scripts/mod/sumversion.o
	  HOSTCC  scripts/mod/symsearch.o
	  HOSTCC  scripts/mod/file2alias.o
	  HOSTLD  scripts/mod/modpost
	  CC      kernel/bounds.s
	  CC      arch/x86/kernel/asm-offsets.s
	  UPD     include/generated/asm-offsets.h
	  CC      kernel/sched/rq-offsets.s
	  CALL    scripts/checksyscalls.sh
	make[4]: *** No rule to make target 'rustdoc'.  Stop.
	make[3]: *** [Makefile:1855: rustdoc] Error 2
	Ignored errors when building rustdoc: Command '['make', 'rustdoc']' returned non-zero exit status 2.. Is RUST enabled?

There are other combinations that produce weird things.

If, instead of step (5), we do:

	$ echo >.config
	$ LANG=C make SPHINXDIRS=peci htmldocs

it will produce, after building htmldocs from Sphinx:

	Using alabaster theme
	Using Python kernel-doc
	  SYNC    include/config/auto.conf
	  HOSTCC  scripts/basic/fixdep
	*
	* Restart config...
	*
	*
	* General setup
	*
	Compile also drivers which will not load (COMPILE_TEST) [N/y/?] (NEW) 

---

My understanding is that the issue is caused because (by purpose)
make htmldocs doesn't sync configuration. It doesn't need, as
building docs doesn't really depend on any .config flag.

However, this check at the Makefile:

	ifneq ($(wildcard $(srctree)/.config),)
	ifeq ($(CONFIG_RUST),y)
        	RUSTDOC=--rustdoc
	endif
	endif

Uses a cached value of "CONFIG_RUST" from the last build, with may
or may not be present anymore.

My patch solves this by not using the cached result, but, instead
checking if CONFIG_RUST is enabled directly at the .config file.

Thanks,
Mauro

      reply	other threads:[~2025-11-21  9:12 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
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 [this message]

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=20251121101236.5b1f9989@foz.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=carlos.bilbao.osdev@gmail.com \
    --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).