Re: [PATCH] kbuild: Do not run kernel-doc when building external modules

From: Masahiro Yamada

Date: Wed Feb 04 2026 - 02:06:24 EST


On Sun, Feb 1, 2026 at 12:15 AM Nicolas Schier <nsc@xxxxxxxxxx> wrote:
>
> On Fri, 30 Jan 2026 14:37:47 -0700, Nathan Chancellor wrote:
> > After commit 778b8ebe5192 ("docs: Move the python libraries to
> > tools/lib/python"), building an external module with any value of W=
> > against the output of install-extmod-build fails with:
> >
> > $ make -C /usr/lib/modules/6.19.0-rc7-00108-g4d310797262f/build M=$PWD W=1
> > make: Entering directory '/usr/lib/modules/6.19.0-rc7-00108-g4d310797262f/build'
> > make[1]: Entering directory '...'
> > CC [M] ...
> > Traceback (most recent call last):
> > File "/usr/lib/modules/6.19.0-rc7-00108-g4d310797262f/build/scripts/kernel-doc.py", line 339, in <module>
> > main()
> > ~~~~^^
> > File "/usr/lib/modules/6.19.0-rc7-00108-g4d310797262f/build/scripts/kernel-doc.py", line 295, in main
> > from kdoc.kdoc_files import KernelFiles # pylint: disable=C0415
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > ModuleNotFoundError: No module named 'kdoc'
> >
> > [...]
>
> Applied to kbuild/linux.git (kbuild-fixes-unstable), thanks!


I believe this is a wrong direction to go.

Since kernel-doc is a part of Kbuild,
all dependent libraries should exist under scripts/.


--
Best Regards
Masahiro Yamada