From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Andy Shevchenko <andriy.shevchenko@intel.com>
Subject: Re: [PATCH] docs: Makefile: Inherit PYTHONPYCACHEPREFIX setting as env variable
Date: Wed, 7 May 2025 16:44:55 +0200 [thread overview]
Message-ID: <20250507164455.76daaae2@sal.lan> (raw)
In-Reply-To: <0253ce98-960c-4498-8ace-a4354e3ebc26@gmail.com>
Em Thu, 1 May 2025 17:21:07 +0900
Akira Yokosawa <akiyks@gmail.com> escreveu:
> Commit 6c2f0b28d76e ("docs: Makefile: store __pycache__ at the output
> directory") assigns a new path to PYTHONPYCACHEPREFIX for building
> kernel documentation.
>
> However, it is not necessarily optimal for everyone.
>
> If you find PYTHONPYCACHEPREFIX is already set, it strongly suggests
> that the developer has selected the setting as best suited for one's own
> workflow.
>
> Use "?=" in the assignment to PYTHONPYCACHEPREFIX so that the path of
> $(abspath $(BUILDDIR)/__pycache__) works only as a safeguard.
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sorry for not answering it earlier... I took a quick vacation last week
to rest after a long trip abroad.
It is a little late for that, as Jon already applied, but the change
looks good to me:
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> Mauro,
>
> I left other Makefiles commit 5c5c32d7abd9 ("scripts/kernel-doc.py:
> don't create *.pyc files") has touched, as I'm not sure which path to
> assign in them.
Well, O= sets some environment var, but granted it requires some time
to understand kernel Makefiles and see where exactly it stores the
dest directory. I won't have any time this week or the next one to
check it, but I can try to write a patch for that later on, if nobody
does that before.
> Additional Notes:
>
> Python's default behavior, which is safe in cases where the source tree
> is never shared heterogeneously, can be restored by defining it empty
> by saying:
>
> export PYTHONPYCACHEPREFIX=
>
> As the path in the env var can have white spaces, a quote pair is added
> to make it a single token.
Perhaps it makes sense to place it somewhere at the documentation.
Regards,
Mauro
>
> Thanks,
> Akira
> --
> Documentation/Makefile | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 59e95ebae786..d30d66ddf1ad 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -82,9 +82,11 @@ loop_cmd = $(echo-cmd) $(cmd_$(1)) || exit;
> # $5 reST source folder relative to $(src),
> # e.g. "userspace-api/media" for the linux-tv book-set at ./Documentation/userspace-api/media
>
> +PYTHONPYCACHEPREFIX ?= $(abspath $(BUILDDIR)/__pycache__)
> +
> quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
> cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \
> - PYTHONPYCACHEPREFIX=$(abspath $(BUILDDIR)/__pycache__) \
> + PYTHONPYCACHEPREFIX="$(PYTHONPYCACHEPREFIX)" \
> BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(src)/$5/$(SPHINX_CONF)) \
> $(PYTHON3) $(srctree)/scripts/jobserver-exec \
> $(CONFIG_SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \
>
> base-commit: c0fe189b590c754f69e0cb87c5b5674cad535cf6
prev parent reply other threads:[~2025-05-07 14:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 8:21 [PATCH] docs: Makefile: Inherit PYTHONPYCACHEPREFIX setting as env variable Akira Yokosawa
2025-05-06 13:07 ` Jonathan Corbet
2025-05-07 14:44 ` 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=20250507164455.76daaae2@sal.lan \
--to=mchehab+huawei@kernel.org \
--cc=akiyks@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.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).