From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F96B76026; Sat, 31 Jan 2026 15:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769872164; cv=none; b=YkelGCavkz4RFm+1UcxwcTTx1kbCPPj2pC1++FRTxQGoUxaCavWyPUP3owK/VWC9BRr4Me8ahhxSIOYV8zeiER14PU352qqBbdZenYJsm9VlYpJvDQbC7d8GnlOp6wIY+Xd+My2UfjFholYC6Fbtzkzlcbf4atVupfWU+c8JRws= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769872164; c=relaxed/simple; bh=gcdo6o76TtPtyJoi2SieZGmlGf1ucBdMSPbQiU7BwbA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P1eWlJSYb6qpjJ8mD6Ck4f0jemXOhmZGs1BJikNMYw/8jvXm4xGbJwC7Y213oYdZqw+MEzNm5cLhJvVkp258k24nMwjThP40MvKtJD5SliHqBtC62lBwGoq/qKCNSjL+KpstArPp7+45Yn/0ENk+YETapgrmARXx1fQb9oRWkRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mvfyn8Q3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mvfyn8Q3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33380C4CEF1; Sat, 31 Jan 2026 15:09:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769872163; bh=gcdo6o76TtPtyJoi2SieZGmlGf1ucBdMSPbQiU7BwbA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mvfyn8Q3NfDjS6Wqqvu1MvQr40vvyugzNqD4PSSrDQKvllVQfl7dz9aVG4Rcof5ng 8M+z9L8Logi3seWl+orotwTFkDHXFwx4STTTr3wQaLC/gImpgPHWJbtJizVQyUTPI/ MqtpjEUZJwgl6TpT8/CFvXuSQr3CJ/rnIAfev9M6NfgcPeAewPX6veYPZ24qTY4dBH 4ZVE6XjqSdSSELOqr1FK3JMkDQyNjkZEow6n+NpWk2gCgi+l6AgdBcRG9T8P5HwDCs e6qJ49qtg42/WfIp/4hGILQObfVmHm+SupupEjoH3O5D4MtqqlsAYRLRTkUDvM0JtM 5Ah85DXy1R5Jg== Date: Sat, 31 Jan 2026 16:08:52 +0100 From: Nicolas Schier To: Mauro Carvalho Chehab Cc: Nathan Chancellor , Rong Zhang , Jonathan Corbet , Mauro Carvalho Chehab , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH] kbuild: install-extmod-build: Add missing python libraries Message-ID: Mail-Followup-To: Mauro Carvalho Chehab , Nathan Chancellor , Rong Zhang , Jonathan Corbet , Mauro Carvalho Chehab , Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org References: <20260129175321.415295-1-i@rong.moe> <20260130011106.GA359714@ax162> <20260130063056.72fbe458@foz.lan> <20260130064011.GA2981809@ax162> <20260130092816.162a48fe@foz.lan> Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260130092816.162a48fe@foz.lan> On Fri, Jan 30, 2026 at 09:32:03AM +0100, Mauro Carvalho Chehab wrote: > On Thu, 29 Jan 2026 23:40:11 -0700 > Nathan Chancellor wrote: > > > On Fri, Jan 30, 2026 at 06:30:56AM +0100, Mauro Carvalho Chehab wrote: > > > On Thu, 29 Jan 2026 18:11:06 -0700 > > > Nathan Chancellor wrote: > > > > On Fri, Jan 30, 2026 at 01:49:55AM +0800, Rong Zhang wrote: > > ... > > > > > $ make -C /lib/modules/6.19.0-rc6/build/ M="$(pwd)" modules V=1 W=1 > > > > > [...] > > > > > make -f /usr/src/linux-headers-6.19.0-rc6/scripts/Makefile.build obj=. need-builtin=1 need-modorder=1 > > > > > # CC [M] mod.o > > > > > [...] > > > > > # cmd_checkdoc mod.o > > > > > PYTHONDONTWRITEBYTECODE=1 python3 /usr/src/linux-headers-6.19.0-rc6/scripts/kernel-doc.py -none mod.c > > > > > > This sounds really weird, as it is trying to run scripts/kernel-doc.py > > > instead of tools/docs/kernel-doc. Does the out-of-tree Makefile > > > override KERNELDOC variable? The current version contains: > > > > > > KERNELDOC = $(srctree)/tools/docs/kernel-doc > > > > > > But somehow it is using the old version before the renames: > > > > > > KERNELDOC = $(srctree)/scripts/kernel-doc.py > > > > Well I think based on the "6.19.0-rc6" in the path above, this is > > mainline, not -next, so the rename has has not happend there yet. > > Ah, ok. On your e-mail you mentioned the renaming patch, so I > ended assuming that was the case. > > > > > > Btw, I did a very quick test here, using an old OOT project I have > > > at github: > > > > > > https://github.com/mchehab/xr_serial > > ... > > > It sounds to me that Rong may be using a Makefile on his OOT project > > > that was not updated to pick the right kernel-doc tool. > > > > If I use that project with Rong's original command, the > > linux-upstream-headers package from the pacman-pkg target (which uses > > install-extmod-build), and the following fix up for a more modern kernel > > version, I see the following error: > > > > $ make -C /usr/lib/modules/6.19.0-rc7-next-20260129/build M=/tmp/xr_serial modules V=1 W=1 > > ... > > # CC [M] xr_serial.o > > gcc ... > > # cmd_checkdoc xr_serial.o > > PYTHONDONTWRITEBYTECODE=1 python3 /usr/lib/modules/6.19.0-rc7-next-20260129/build/tools/docs/kernel-doc -none xr_serial.c > > python3: can't open file '/usr/lib/modules/6.19.0-rc7-next-20260129/build/tools/docs/kernel-doc': [Errno 2] No such file or directory > > make[3]: *** [/usr/lib/modules/6.19.0-rc7-next-20260129/build/scripts/Makefile.build:287: xr_serial.o] Error 2 > > > > If it is not expected that kernel-doc runs for external modules, then > > maybe cmd_checkdoc should also be wrapped in a check for KBUILD_EXTMOD? > > I don't particularly see any reason why running kernel-doc for external > modules, as the goal of running it there (outside make htmldocs) is to > detect early problems at linux-next and other CIs. > > On the other hand, I also don't see any problem on encapsulating > kernel-doc at the tarball created by install-extmod-build with something > like: > > ifeq ($(KBUILD_EXTMOD),) > ifneq ($(KBUILD_EXTRA_WARN),) > cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(KDOCFLAGS) \ > $(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \ > $< > endif > endif > > at scripts/Makefile.build. > > > So, feel free to add to either one of the approaches: > > Reviewed-by: Mauro Carvalho Chehab Thanks everybody for report and analysis! I put Mauro's suggestion into a new patch for kbuild-next: https://lore.kernel.org/linux-kbuild/20260131-run-kernel-doc-only-in-tree-v1-1-93a9c695dfb1@kernel.org/ I plan to send the pull request tonight. > That's said, it should be noticed that the DRM subsystem also has > some similar code: > > drivers/gpu/drm/Makefile: PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \ > drivers/gpu/drm/i915/Makefile: cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none -Werror $< > drivers/gpu/drm/i915/Makefile: $(KERNELDOC) -none -Werror $<; touch $@ > include/drm/Makefile: PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \ > scripts/Makefile.build: cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(KDOCFLAGS) \ > > but I suspect that only scripts/Makefile.build probably need > such check. yes, I think so too, as the definitions in drm should only take effect on hdrtest target. Kind regards, Nicolas