Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3
@ 2024-09-11 17:19 Julien Olivain
  2024-09-14 14:37 ` Yann E. MORIN
  2024-09-21  8:18 ` Peter Korsgaard
  0 siblings, 2 replies; 6+ messages in thread
From: Julien Olivain @ 2024-09-11 17:19 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain, Vincent Stehlé, Thomas Petazzoni

When the build host does not have a Python interpreter installed,
host-grub2 is failing to configure due to this missing interpreter.
Note that host-grub2 is the first package to fail because it is a
dependency of grub2. The grub2 target package has the same dependency
requirement.

The issue can be quickly reproduced on a host without Python with the
commands:

    cat <<EOF >.config
    BR2_aarch64=y
    BR2_TARGET_GRUB2=y
    BR2_TOOLCHAIN_EXTERNAL=y
    EOF
    make olddefconfig
    make grub2

grub2 autotools configure.ac search for a Python interpreter since
upstream commit [1] 8b467844e "python: Use AM_PATH_PYTHON to determine
interpreter for gentpl.py", first included in grub v2.04 released
on 2019-07-04. For reference, grub2 has been updated to that version
in commit [2] ea7ec41c "boot/grub2: bump to verson 2.04".

This commit fixes the issue by adding the host-python3 dependency to
host-grub2 and grub2.

Fixes:

    checking for a Python interpreter with version >= 2.6... none
    configure: error: no suitable Python interpreter found

[1] https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=8b467844e11170077c8ca727c39d2bd36eeb5f08
[2] https://gitlab.com/buildroot.org/buildroot/-/commit/ea7ec41cf64e86a692ac45e0d012c6e8199ef110

Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 boot/grub2/grub2.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 1263c63cfd..7c95adc739 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -9,8 +9,8 @@ GRUB2_SITE = http://ftp.gnu.org/gnu/grub
 GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
 GRUB2_LICENSE = GPL-3.0+
 GRUB2_LICENSE_FILES = COPYING
-GRUB2_DEPENDENCIES = host-bison host-flex host-gawk host-grub2
-HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk
+GRUB2_DEPENDENCIES = host-bison host-flex host-gawk host-grub2 host-python3
+HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk host-python3
 GRUB2_INSTALL_IMAGES = YES
 
 # CVE-2019-14865 is about a flaw in the grub2-set-bootflag tool, which
-- 
2.46.0

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

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

* Re: [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3
  2024-09-11 17:19 [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3 Julien Olivain
@ 2024-09-14 14:37 ` Yann E. MORIN
  2024-09-21  8:18 ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2024-09-14 14:37 UTC (permalink / raw)
  To: Julien Olivain; +Cc: Vincent Stehlé, Thomas Petazzoni, buildroot

Julien, All,

On 2024-09-11 19:19 +0200, Julien Olivain spake thusly:
> When the build host does not have a Python interpreter installed,
> host-grub2 is failing to configure due to this missing interpreter.
> Note that host-grub2 is the first package to fail because it is a
> dependency of grub2. The grub2 target package has the same dependency
> requirement.
> 
> The issue can be quickly reproduced on a host without Python with the
> commands:
> 
>     cat <<EOF >.config
>     BR2_aarch64=y
>     BR2_TARGET_GRUB2=y
>     BR2_TOOLCHAIN_EXTERNAL=y
>     EOF
>     make olddefconfig
>     make grub2
> 
> grub2 autotools configure.ac search for a Python interpreter since
> upstream commit [1] 8b467844e "python: Use AM_PATH_PYTHON to determine
> interpreter for gentpl.py", first included in grub v2.04 released
> on 2019-07-04. For reference, grub2 has been updated to that version
> in commit [2] ea7ec41c "boot/grub2: bump to verson 2.04".
> 
> This commit fixes the issue by adding the host-python3 dependency to
> host-grub2 and grub2.
> 
> Fixes:
> 
>     checking for a Python interpreter with version >= 2.6... none
>     configure: error: no suitable Python interpreter found
> 
> [1] https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=8b467844e11170077c8ca727c39d2bd36eeb5f08
> [2] https://gitlab.com/buildroot.org/buildroot/-/commit/ea7ec41cf64e86a692ac45e0d012c6e8199ef110
> 
> 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.

> ---
>  boot/grub2/grub2.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> index 1263c63cfd..7c95adc739 100644
> --- a/boot/grub2/grub2.mk
> +++ b/boot/grub2/grub2.mk
> @@ -9,8 +9,8 @@ GRUB2_SITE = http://ftp.gnu.org/gnu/grub
>  GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
>  GRUB2_LICENSE = GPL-3.0+
>  GRUB2_LICENSE_FILES = COPYING
> -GRUB2_DEPENDENCIES = host-bison host-flex host-gawk host-grub2
> -HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk
> +GRUB2_DEPENDENCIES = host-bison host-flex host-gawk host-grub2 host-python3
> +HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk host-python3
>  GRUB2_INSTALL_IMAGES = YES
>  
>  # CVE-2019-14865 is about a flaw in the grub2-set-bootflag tool, which
> -- 
> 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] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3
  2024-09-11 17:19 [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3 Julien Olivain
  2024-09-14 14:37 ` Yann E. MORIN
@ 2024-09-21  8:18 ` Peter Korsgaard
  2024-09-29  9:24   ` Julien Olivain
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Korsgaard @ 2024-09-21  8:18 UTC (permalink / raw)
  To: Julien Olivain; +Cc: Vincent Stehlé, Thomas Petazzoni, buildroot

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

 > When the build host does not have a Python interpreter installed,
 > host-grub2 is failing to configure due to this missing interpreter.
 > Note that host-grub2 is the first package to fail because it is a
 > dependency of grub2. The grub2 target package has the same dependency
 > requirement.

 > The issue can be quickly reproduced on a host without Python with the
 > commands:

 >     cat <<EOF >.config
 >     BR2_aarch64=y
 >     BR2_TARGET_GRUB2=y
 >     BR2_TOOLCHAIN_EXTERNAL=y
 >     EOF
 >     make olddefconfig
 >     make grub2

 > grub2 autotools configure.ac search for a Python interpreter since
 > upstream commit [1] 8b467844e "python: Use AM_PATH_PYTHON to determine
 > interpreter for gentpl.py", first included in grub v2.04 released
 > on 2019-07-04. For reference, grub2 has been updated to that version
 > in commit [2] ea7ec41c "boot/grub2: bump to verson 2.04".

 > This commit fixes the issue by adding the host-python3 dependency to
 > host-grub2 and grub2.

 > Fixes:

 >     checking for a Python interpreter with version >= 2.6... none
 >     configure: error: no suitable Python interpreter found

 > [1] https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=8b467844e11170077c8ca727c39d2bd36eeb5f08
 > [2] https://gitlab.com/buildroot.org/buildroot/-/commit/ea7ec41cf64e86a692ac45e0d012c6e8199ef110

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

Given that it apparently doesn't need any special python modules could
we use $(BR2_PYTHON3_HOST_DEPENDENCY) instead to only build python3 if
not available on the host / older than 3.4?

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

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

* Re: [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3
  2024-09-21  8:18 ` Peter Korsgaard
@ 2024-09-29  9:24   ` Julien Olivain
  2024-09-29  9:52     ` Peter Korsgaard
  0 siblings, 1 reply; 6+ messages in thread
From: Julien Olivain @ 2024-09-29  9:24 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: Vincent Stehlé, Thomas Petazzoni, buildroot

Hi Peter, All,

On 21/09/2024 10:18, Peter Korsgaard wrote:
>>>>>> "Julien" == Julien Olivain <ju.o@free.fr> writes:
> 
>  > When the build host does not have a Python interpreter installed,
>  > host-grub2 is failing to configure due to this missing interpreter.
>  > Note that host-grub2 is the first package to fail because it is a
>  > dependency of grub2. The grub2 target package has the same 
> dependency
>  > requirement.
> 
>  > The issue can be quickly reproduced on a host without Python with 
> the
>  > commands:
> 
>  >     cat <<EOF >.config
>  >     BR2_aarch64=y
>  >     BR2_TARGET_GRUB2=y
>  >     BR2_TOOLCHAIN_EXTERNAL=y
>  >     EOF
>  >     make olddefconfig
>  >     make grub2
> 
>  > grub2 autotools configure.ac search for a Python interpreter since
>  > upstream commit [1] 8b467844e "python: Use AM_PATH_PYTHON to 
> determine
>  > interpreter for gentpl.py", first included in grub v2.04 released
>  > on 2019-07-04. For reference, grub2 has been updated to that version
>  > in commit [2] ea7ec41c "boot/grub2: bump to verson 2.04".
> 
>  > This commit fixes the issue by adding the host-python3 dependency to
>  > host-grub2 and grub2.
> 
>  > Fixes:
> 
>  >     checking for a Python interpreter with version >= 2.6... none
>  >     configure: error: no suitable Python interpreter found
> 
>  > [1] 
> https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=8b467844e11170077c8ca727c39d2bd36eeb5f08
>  > [2] 
> https://gitlab.com/buildroot.org/buildroot/-/commit/ea7ec41cf64e86a692ac45e0d012c6e8199ef110
> 
>  > Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
>  > Signed-off-by: Julien Olivain <ju.o@free.fr>
> 
> Given that it apparently doesn't need any special python modules could
> we use $(BR2_PYTHON3_HOST_DEPENDENCY) instead to only build python3 if
> not available on the host / older than 3.4?

Yes, I confirm that for now, there is no specific python module
requirement, and Python 3.4 should also be sufficient. So we could
switch to BR2_PYTHON3_HOST_DEPENDENCY to save the time of the host
python build.

The same comment applies to the Linux kernel.

Since those patches were recently merged in [1] and [2], I'll propose
followup patches as an improvement.

> --
> Bye, Peter Korsgaard

Best regards,

Julien.

[1] 
https://gitlab.com/buildroot.org/buildroot/-/commit/86bb1b2360bdaed069cd087541f4edad1d5ce925
[2] 
https://gitlab.com/buildroot.org/buildroot/-/commit/abce4a2b365276a7fa081d327289e5e6d8bdca7e
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3
  2024-09-29  9:24   ` Julien Olivain
@ 2024-09-29  9:52     ` Peter Korsgaard
  2024-10-03 11:05       ` Peter Korsgaard
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Korsgaard @ 2024-09-29  9:52 UTC (permalink / raw)
  To: Julien Olivain; +Cc: Vincent Stehlé, Thomas Petazzoni, buildroot

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

Hi,

 >> Given that it apparently doesn't need any special python modules
 >> could
 >> we use $(BR2_PYTHON3_HOST_DEPENDENCY) instead to only build python3 if
 >> not available on the host / older than 3.4?

 > Yes, I confirm that for now, there is no specific python module
 > requirement, and Python 3.4 should also be sufficient. So we could
 > switch to BR2_PYTHON3_HOST_DEPENDENCY to save the time of the host
 > python build.

 > The same comment applies to the Linux kernel.

 > Since those patches were recently merged in [1] and [2], I'll propose
 > followup patches as an improvement.

Great, thanks!

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

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

* Re: [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3
  2024-09-29  9:52     ` Peter Korsgaard
@ 2024-10-03 11:05       ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2024-10-03 11:05 UTC (permalink / raw)
  To: Julien Olivain; +Cc: Vincent Stehlé, Thomas Petazzoni, buildroot

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

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

 >>> Given that it apparently doesn't need any special python modules
 >>> could
 >>> we use $(BR2_PYTHON3_HOST_DEPENDENCY) instead to only build python3 if
 >>> not available on the host / older than 3.4?

 >> Yes, I confirm that for now, there is no specific python module
 >> requirement, and Python 3.4 should also be sufficient. So we could
 >> switch to BR2_PYTHON3_HOST_DEPENDENCY to save the time of the host
 >> python build.

 >> The same comment applies to the Linux kernel.

 >> Since those patches were recently merged in [1] and [2], I'll propose
 >> followup patches as an improvement.

 > Great, thanks!

Committed to 2024.02.x and 2024.08.x, thanks.

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

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

end of thread, other threads:[~2024-10-03 11:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11 17:19 [Buildroot] [PATCH 1/1] boot/grub2: needs host-python3 Julien Olivain
2024-09-14 14:37 ` Yann E. MORIN
2024-09-21  8:18 ` Peter Korsgaard
2024-09-29  9:24   ` Julien Olivain
2024-09-29  9:52     ` Peter Korsgaard
2024-10-03 11:05       ` Peter Korsgaard

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