From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Chen Miao <chenmiao.ku@gmail.com>
Cc: corbet@lwn.net, alexs@kernel.org, si.yanteng@linux.dev,
skhan@linuxfoundation.org, dzm91@hust.edu.cn, mchehab@kernel.org,
wy@wyuan.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/6] docs: sphinx-build-wrapper: prefer gmake
Date: Thu, 13 Aug 2026 23:36:01 +0200 [thread overview]
Message-ID: <20260813233601.50922c98@foz.lan> (raw)
In-Reply-To: <CAKxVwgeqTn=hAaGWOh1TBSqz122fPOQ=SrYQubAtpXPCiF9b=Q@mail.gmail.com>
On Thu, 13 Aug 2026 17:38:59 +0800
Chen Miao <chenmiao.ku@gmail.com> wrote:
> Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 于2026年8月13日周四 04:23写道:
> >
> > On Thu, 13 Aug 2026 02:23:21 +0800
> > Chen Miao <chenmiao.ku@gmail.com> wrote:
> >
> > > Homebrew installs GNU Make as gmake on macOS, but the Sphinx build
> > > wrapper invokes make directly when generating Info and Rust
> > > documentation. This can make the dependency check succeed while those
> > > documentation targets still use an incompatible make implementation.
> > >
> > > Honor MAKE when it names a compatible GNU Make. Otherwise check gmake and
> > > then make, selecting the first GNU Make 4.0 or newer. Use the common kdoc
> > > detector to keep this selection consistent with sphinx-pre-install.
> > >
> > > Signed-off-by: Chen Miao <chenmiao.ku@gmail.com>
> > > ---
> > > tools/docs/sphinx-build-wrapper | 23 ++++++++++++++++-------
> > > 1 file changed, 16 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrapper
> > > index 1bb962202..15c7e0938 100755
> > > --- a/tools/docs/sphinx-build-wrapper
> > > +++ b/tools/docs/sphinx-build-wrapper
> > > @@ -63,6 +63,7 @@ SRC_DIR = os.path.dirname(os.path.realpath(__file__))
> > > sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))
> > >
> > > from kdoc.python_version import PythonVersion
> > > +from kdoc.gmake_detect import find_gmake
> > > from kdoc.latex_fonts import LatexFontChecker
> > > from jobserver import JobserverExec # pylint: disable=C0413,C0411,E0401
> > >
> > > @@ -97,6 +98,14 @@ class SphinxBuilder:
> > > with the Kernel.
> > > """
> > >
> > > + def get_make(self):
> > > + """Select the first GNU Make 4.0 or newer in preference order."""
> > > + make = find_gmake(self.env.get("MAKE"))
> > > + if make:
> > > + return make
> > > +
> > > + sys.exit("GNU Make 4.0 or newer is required")
> > > +
> > > def get_path(self, path, use_cwd=False, abs_path=False):
> > > """
> > > Ancillary routine to handle patches the right way, as shell does.
> > > @@ -569,9 +578,10 @@ class SphinxBuilder:
> > > texinfo directory.
> > > """
> > >
> > > + make = self.get_make()
> > > for output_dir in output_dirs:
> > > try:
> > > - subprocess.run(["make", "info"], cwd=output_dir, check=True)
> > > + subprocess.run([make, "info"], cwd=output_dir, check=True)
> > > except subprocess.CalledProcessError as e:
> > > sys.exit(f"Error generating info docs: {e}")
> > >
> > > @@ -787,12 +797,11 @@ class SphinxBuilder:
> > >
> > > if rustdoc and target in ["htmldocs", "epubdocs"]:
> > > print("Building rust docs")
> > > - if "MAKE" in self.env:
> > > - cmd = [self.env["MAKE"]]
> > > - else:
> > > - cmd = ["make", "LLVM=1"]
> > > -
> > > - cmd += [ "rustdoc"]
> > > + make = self.get_make()
> > > + cmd = [make]
> > > + if make != self.env.get("MAKE"):
> > > + cmd.append("LLVM=1")
> >
> > Did you test bulding documentation with CONFIG_RUST=y?
> >
> > AFAIKT, building rust docs only work with LLVM, as GCC doesn't build
> > Rust code yet(*). When the time comes and gcc starts supporting it,
> > the code would likely need to check for gcc version as well.
> >
> > (*) There is an experimental Rust support on gcc under development.
> > No idea about its current status. According with:
> >
> > https://docs.kernel.org/rust/quick-start.html
> >
> > "GCC also works for some configurations, but it is
> > very experimental".
> >
> > Thanks,
> > Mauro
> >
> Yes, I tested it on macOS with CONFIG_RUST=y using:
>
> make LLVM=1 SPHINXDIRS=rust htmldocs
No. I meant:
$ make LLVM=1 menuconfig # enable rust
$ grep CONFIG_RUST .config # check if it was enabled
$ make SPHINXDIRS=rust htmldocs
>
> The Rust documentation path was selected and the wrapper invoked rustdoc with
> the LLVM build configuration.
>
> The initial build exposed a few macOS host-build portability issues unrelated
> to this series, including the lack of ELF headers required by host tools and
> GNU sed-specific uses in Rust-related build rules. After fixing those issues
> locally, the rustdoc build and the Sphinx HTML documentation build completed
> successfully.
>
> Those fixes are outside the scope of this series. If macOS host-build support
> is useful, I can send them as a separate patch series.
>
> Thanks,
> Chen Miao
Thanks,
Mauro
next prev parent reply other threads:[~2026-08-13 21:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 18:23 [PATCH v3 0/6] docs: sphinx-pre-install: improve dependency checks Chen Miao
2026-08-12 18:23 ` [PATCH v3 1/6] docs: kdoc: add GNU Make detection Chen Miao
2026-08-12 20:13 ` Mauro Carvalho Chehab
2026-08-13 9:27 ` Chen Miao
2026-08-12 18:23 ` [PATCH v3 2/6] docs: sphinx-pre-install: add macOS Homebrew support Chen Miao
2026-08-12 20:15 ` Mauro Carvalho Chehab
2026-08-12 18:23 ` [PATCH v3 3/6] docs: sphinx-pre-install: check GNU Make version Chen Miao
2026-08-12 20:17 ` Mauro Carvalho Chehab
2026-08-12 18:23 ` [PATCH v3 4/6] docs: sphinx-build-wrapper: prefer gmake Chen Miao
2026-08-12 20:23 ` Mauro Carvalho Chehab
2026-08-13 9:38 ` Chen Miao
2026-08-13 21:36 ` Mauro Carvalho Chehab [this message]
2026-08-12 18:23 ` [PATCH v3 5/6] docs/zh_CN: doc-guide: document macOS Sphinx setup Chen Miao
2026-08-13 15:36 ` Weijie Yuan
2026-08-13 16:04 ` Chen Miao
2026-08-13 16:07 ` Weijie Yuan
2026-08-12 18:23 ` [PATCH v3 6/6] docs/zh_CN: how-to: document case-sensitive APFS setup Chen Miao
2026-08-13 15:46 ` Weijie Yuan
2026-08-13 16:23 ` Chen Miao
2026-08-13 16:28 ` Weijie Yuan
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=20260813233601.50922c98@foz.lan \
--to=mchehab+huawei@kernel.org \
--cc=alexs@kernel.org \
--cc=chenmiao.ku@gmail.com \
--cc=corbet@lwn.net \
--cc=dzm91@hust.edu.cn \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=si.yanteng@linux.dev \
--cc=skhan@linuxfoundation.org \
--cc=wy@wyuan.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