All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Jean Delvare <jdelvare@suse.de>
Cc: linux-kbuild@vger.kernel.org,
	Nicolas Schier <nicolas.schier@linux.dev>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Subject: Re: [PATCH v2] Makefile: Let kernel-doc.py use PYTHON3 override
Date: Fri, 7 Nov 2025 11:43:38 -0700	[thread overview]
Message-ID: <20251107184338.GA502997@ax162> (raw)
In-Reply-To: <20251107192933.2bfe9e57@endymion>

On Fri, Nov 07, 2025 at 07:29:33PM +0100, Jean Delvare wrote:
> It is possible to force a specific version of python to be used when
> building the kernel by passing PYTHON3= on the make command line.
> However kernel-doc.py is currently called with python3 hard-coded and
> thus ignores this setting.
> 
> Use $(PYTHON3) to run $(KERNELDOC) so that the desired version of
> python is used.
> 
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> ---

Thanks, I can take this as a fix for 6.18 since it results in warnings
in your environment. I will give it a day or so for folks to comment for
review.

> Changes in v2:
>  * Leave KERNELDOC alone and patch the calling sites instead.
> 
>  drivers/gpu/drm/Makefile      |    2 +-
>  drivers/gpu/drm/i915/Makefile |    2 +-
>  include/drm/Makefile          |    2 +-
>  scripts/Makefile.build        |    2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> --- linux-6.17.orig/drivers/gpu/drm/Makefile
> +++ linux-6.17/drivers/gpu/drm/Makefile
> @@ -244,7 +244,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
>  quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
>        cmd_hdrtest = \
>  		$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
> -		 PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
> +		 PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
>  		touch $@
>  
>  $(obj)/%.hdrtest: $(src)/%.h FORCE
> --- linux-6.17.orig/drivers/gpu/drm/i915/Makefile
> +++ linux-6.17/drivers/gpu/drm/i915/Makefile
> @@ -411,7 +411,7 @@ obj-$(CONFIG_DRM_I915_GVT_KVMGT) += kvmg
>  #
>  # Enable locally for CONFIG_DRM_I915_WERROR=y. See also scripts/Makefile.build
>  ifdef CONFIG_DRM_I915_WERROR
> -    cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none -Werror $<
> +    cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none -Werror $<
>  endif
>  
>  # header test
> --- linux-6.17.orig/include/drm/Makefile
> +++ linux-6.17/include/drm/Makefile
> @@ -11,7 +11,7 @@ always-$(CONFIG_DRM_HEADER_TEST) += \
>  quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
>        cmd_hdrtest = \
>  		$(CC) $(c_flags) -fsyntax-only -x c /dev/null -include $< -include $<; \
> -		PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
> +		PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(if $(CONFIG_WERROR)$(CONFIG_DRM_WERROR),-Werror) $<; \
>  		touch $@
>  
>  $(obj)/%.hdrtest: $(src)/%.h FORCE
> --- linux-6.17.orig/scripts/Makefile.build
> +++ linux-6.17/scripts/Makefile.build
> @@ -167,7 +167,7 @@ else ifeq ($(KBUILD_CHECKSRC),2)
>  endif
>  
>  ifneq ($(KBUILD_EXTRA_WARN),)
> -  cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(KERNELDOC) -none $(KDOCFLAGS) \
> +  cmd_checkdoc = PYTHONDONTWRITEBYTECODE=1 $(PYTHON3) $(KERNELDOC) -none $(KDOCFLAGS) \
>          $(if $(findstring 2, $(KBUILD_EXTRA_WARN)), -Wall) \
>          $<
>  endif
> 
> 
> -- 
> Jean Delvare
> SUSE L3 Support

  reply	other threads:[~2025-11-07 18:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 18:29 [PATCH v2] Makefile: Let kernel-doc.py use PYTHON3 override Jean Delvare
2025-11-07 18:43 ` Nathan Chancellor [this message]
2025-11-07 20:40 ` Mauro Carvalho Chehab
2025-11-08 11:20 ` Nicolas Schier
2025-11-09  2:57 ` Nathan Chancellor

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=20251107184338.GA502997@ax162 \
    --to=nathan@kernel.org \
    --cc=jdelvare@suse.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=nicolas.schier@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.