Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH next 1/1] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3
@ 2024-09-05 22:17 Julien Olivain
  2024-09-16 11:10 ` Yann E. MORIN
  2024-10-12 13:47 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Julien Olivain @ 2024-09-05 22:17 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain, Vincent Stehlé

Kernel commit [1] introduced MSM GPU driver header generation with a
Python script. This commit was first included in v6.10. This driver is
also enabled as a module in the arm64 architecture default
configuration. See [2]. This is a common situation.

This missing dependency is not detected in the Buildroot CI, because
the reference docker image contains a python3 interpreter. See [3].

For information, the Linux latest kernel version was updated in
Buildroot commit 2b6dba00b "linux: bump latest version to 6.10".
See [4].

The issue can be observed by running the following commands on a host
without the python3 interpreter installed:

    cat <<EOF >.config
    BR2_aarch64=y
    BR2_LINUX_KERNEL=y
    BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
    BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
    BR2_TOOLCHAIN_EXTERNAL=y
    EOF
    make olddefconfig
    make linux

The Kernel build fails with output:

      GENHDR  drivers/gpu/drm/msm/generated/a2xx.xml.h
    /bin/sh: 1: python3: not found
    make[7]: *** [drivers/gpu/drm/msm/Makefile:176: drivers/gpu/drm/msm/generated/a2xx.xml.h] Error 127

This commit fixes this issue by introducing a new
BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3 configuration that will need to be
selected in relevant situations.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0fddd045f88e34d6160785a3a5e506d374566454
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/configs/defconfig?h=v6.10.8#n868
[3] https://gitlab.com/buildroot.org/buildroot/-/blob/2024.08-rc3/support/docker/Dockerfile?ref_type=tags#L40
[4] https://gitlab.com/buildroot.org/buildroot/-/commit/2b6dba00be27a09bc7e88faf0871f82bf95589cf

Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 linux/Config.in | 11 +++++++++++
 linux/linux.mk  |  4 ++++
 2 files changed, 15 insertions(+)

diff --git a/linux/Config.in b/linux/Config.in
index 429a7eabef..782366586c 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -492,6 +492,17 @@ config BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE
 	  such as "BTF: .tmp_vmlinux.btf: pahole (pahole) is not
 	  available".
 
+config BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3
+	bool "Needs host python3"
+	help
+	  Some Linux kernel configuration options (such as the
+	  CONFIG_DRM_MSM in v6.10 and greater) require a host python3
+	  interpreter. Enabling this option will ensure host-python3
+	  gets built before the Linux kernel.
+
+	  Enable this option if you get a Linux kernel build failure
+	  such as "python3: not found".
+
 # Linux extensions
 source "linux/Config.ext.in"
 
diff --git a/linux/linux.mk b/linux/linux.mk
index 16d9f19470..92035d0da9 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -138,6 +138,10 @@ define LINUX_FIXUP_CONFIG_PAHOLE_CHECK
 endef
 endif
 
+ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3),y)
+LINUX_DEPENDENCIES += host-python3
+endif
+
 # If host-uboot-tools is selected by the user, assume it is needed to
 # create a custom image
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y)
-- 
2.46.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH next 1/1] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3
  2024-09-05 22:17 [Buildroot] [PATCH next 1/1] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3 Julien Olivain
@ 2024-09-16 11:10 ` Yann E. MORIN
  2024-10-12 13:47 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2024-09-16 11:10 UTC (permalink / raw)
  To: Julien Olivain; +Cc: Vincent Stehlé, buildroot

Julien, All,

On 2024-09-06 00:17 +0200, Julien Olivain spake thusly:
> Kernel commit [1] introduced MSM GPU driver header generation with a
> Python script. This commit was first included in v6.10. This driver is
> also enabled as a module in the arm64 architecture default
> configuration. See [2]. This is a common situation.
> 
> This missing dependency is not detected in the Buildroot CI, because
> the reference docker image contains a python3 interpreter. See [3].
> 
> For information, the Linux latest kernel version was updated in
> Buildroot commit 2b6dba00b "linux: bump latest version to 6.10".
> See [4].
> 
> The issue can be observed by running the following commands on a host
> without the python3 interpreter installed:
> 
>     cat <<EOF >.config
>     BR2_aarch64=y
>     BR2_LINUX_KERNEL=y
>     BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
>     BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
>     BR2_TOOLCHAIN_EXTERNAL=y
>     EOF
>     make olddefconfig
>     make linux
> 
> The Kernel build fails with output:
> 
>       GENHDR  drivers/gpu/drm/msm/generated/a2xx.xml.h
>     /bin/sh: 1: python3: not found
>     make[7]: *** [drivers/gpu/drm/msm/Makefile:176: drivers/gpu/drm/msm/generated/a2xx.xml.h] Error 127
> 
> This commit fixes this issue by introducing a new
> BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3 configuration that will need to be
> selected in relevant situations.
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0fddd045f88e34d6160785a3a5e506d374566454
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/configs/defconfig?h=v6.10.8#n868
> [3] https://gitlab.com/buildroot.org/buildroot/-/blob/2024.08-rc3/support/docker/Dockerfile?ref_type=tags#L40
> [4] https://gitlab.com/buildroot.org/buildroot/-/commit/2b6dba00be27a09bc7e88faf0871f82bf95589cf
> 
> Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
> Signed-off-by: Julien Olivain <ju.o@free.fr>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  linux/Config.in | 11 +++++++++++
>  linux/linux.mk  |  4 ++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/linux/Config.in b/linux/Config.in
> index 429a7eabef..782366586c 100644
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -492,6 +492,17 @@ config BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE
>  	  such as "BTF: .tmp_vmlinux.btf: pahole (pahole) is not
>  	  available".
>  
> +config BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3
> +	bool "Needs host python3"
> +	help
> +	  Some Linux kernel configuration options (such as the
> +	  CONFIG_DRM_MSM in v6.10 and greater) require a host python3
> +	  interpreter. Enabling this option will ensure host-python3
> +	  gets built before the Linux kernel.
> +
> +	  Enable this option if you get a Linux kernel build failure
> +	  such as "python3: not found".
> +
>  # Linux extensions
>  source "linux/Config.ext.in"
>  
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 16d9f19470..92035d0da9 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -138,6 +138,10 @@ define LINUX_FIXUP_CONFIG_PAHOLE_CHECK
>  endef
>  endif
>  
> +ifeq ($(BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3),y)
> +LINUX_DEPENDENCIES += host-python3
> +endif
> +
>  # If host-uboot-tools is selected by the user, assume it is needed to
>  # create a custom image
>  ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS),y)
> -- 
> 2.46.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH next 1/1] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3
  2024-09-05 22:17 [Buildroot] [PATCH next 1/1] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3 Julien Olivain
  2024-09-16 11:10 ` Yann E. MORIN
@ 2024-10-12 13:47 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-10-12 13:47 UTC (permalink / raw)
  To: Julien Olivain; +Cc: Vincent Stehlé, buildroot

>>>>> "Julien" == Julien Olivain <ju.o@free.fr> writes:

 > Kernel commit [1] introduced MSM GPU driver header generation with a
 > Python script. This commit was first included in v6.10. This driver is
 > also enabled as a module in the arm64 architecture default
 > configuration. See [2]. This is a common situation.

 > This missing dependency is not detected in the Buildroot CI, because
 > the reference docker image contains a python3 interpreter. See [3].

 > For information, the Linux latest kernel version was updated in
 > Buildroot commit 2b6dba00b "linux: bump latest version to 6.10".
 > See [4].

 > The issue can be observed by running the following commands on a host
 > without the python3 interpreter installed:

 >     cat <<EOF >.config
 >     BR2_aarch64=y
 >     BR2_LINUX_KERNEL=y
 >     BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
 >     BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
 >     BR2_TOOLCHAIN_EXTERNAL=y
 >     EOF
 >     make olddefconfig
 >     make linux

 > The Kernel build fails with output:

 >       GENHDR  drivers/gpu/drm/msm/generated/a2xx.xml.h
 >     /bin/sh: 1: python3: not found
 >     make[7]: *** [drivers/gpu/drm/msm/Makefile:176: drivers/gpu/drm/msm/generated/a2xx.xml.h] Error 127

 > This commit fixes this issue by introducing a new
 > BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3 configuration that will need to be
 > selected in relevant situations.

 > [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0fddd045f88e34d6160785a3a5e506d374566454
 > [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/configs/defconfig?h=v6.10.8#n868
 > [3] https://gitlab.com/buildroot.org/buildroot/-/blob/2024.08-rc3/support/docker/Dockerfile?ref_type=tags#L40
 > [4] https://gitlab.com/buildroot.org/buildroot/-/commit/2b6dba00be27a09bc7e88faf0871f82bf95589cf

 > Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
 > Signed-off-by: Julien Olivain <ju.o@free.fr>

Committed to 2024.08.x together with the followup patch to use
BR2_PYTHON3_HOST_DEPENDENCY, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-12 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-05 22:17 [Buildroot] [PATCH next 1/1] linux: add BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3 Julien Olivain
2024-09-16 11:10 ` Yann E. MORIN
2024-10-12 13:47 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox