Skip to contentSkip to conversation

boot/grub2: fix dependency on host-gawk

PATCH In review Brian Murphy 2 participants 4 messages Oct 15, 2021 – Oct 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boot/grub2: fix dependency on host-gawk

---
 boot/grub2/grub2.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/grub2/grub2.mk +1 -1
index e01ebb2edb..77bf26b739 100644
@@ -10,7 +10,7 @@ GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
 GRUB2_LICENSE = GPL-3.0+
 GRUB2_LICENSE_FILES = COPYING
 GRUB2_DEPENDENCIES = host-bison host-flex host-grub2
-HOST_GRUB2_DEPENDENCIES = host-bison host-flex
+HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk
 GRUB2_INSTALL_IMAGES = YES
 
 # 0001-build-Fix-GRUB-i386-pc-build-with-Ubuntu-gcc.patch and 2021/03/02
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Brian, All,

+Köry who did recent changes in grub2

On 2021-10-15 12:59 +0200, Brian Murphy spake thusly:

Quoted 1 line

Could you give a bit more details about the reason why host-gawk is needed? I've just been able to complete a grub2 build with mawk as my system awk. grub2's configure even detects that situation;

checking for gawk... no
checking for mawk... mawk

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 boot/grub2/grub2.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/grub2/grub2.mk +1 -1
index e01ebb2edb..77bf26b739 100644
@@ -10,7 +10,7 @@ GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
 GRUB2_LICENSE = GPL-3.0+
 GRUB2_LICENSE_FILES = COPYING
 GRUB2_DEPENDENCIES = host-bison host-flex host-grub2
-HOST_GRUB2_DEPENDENCIES = host-bison host-flex
+HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk
 GRUB2_INSTALL_IMAGES = YES
 
 # 0001-build-Fix-GRUB-i386-pc-build-with-Ubuntu-gcc.patch and 2021/03/02
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Yeah. I got this randomly when building - and pretty much always from clean:

aclocal.m4:17: warning: this file was generated for autoconf 2.69.
You have another version of autoconf.  It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.
rm -f stamp-h1
touch ../config-util.h.in
cd . && /bin/bash ./config.status config-util.h
config.status: creating config-util.h
In file included from ../include/grub/disk.h:22,
                 from ../include/grub/file.h:26,
                 from ../grub-core/fs/minix.c:21:
./config.h:38:10: fatal error: ./config-util.h: No such file or directory
   38 | #include <config-util.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:13096: libgrub.pp] Error 1
make[1]: Leaving directory '/home/brm/src/buildroot/br.pc/output/build/grub2-2.04/build-i386-pc'
make: *** [package/pkg-generic.mk:294: /home/brm/src/buildroot/br.pc/output/build/grub2-2.04/.stamp_built] Error 2

and when I run the command I get:

$ /bin/bash ./config.status config-util.h
config.status: creating config-util.h
./config.status: line 2356: gawk: command not found
config.status: error: could not create config-util.h

So grub ends up needing gawk to create this config-util.h. I do not have gawk installed on my build machine but other buildroot packages depend on host-gawk so it ends up being built. Perhaps grub autodetects gawk before it is ready to be used (sometimes) in a parallel build if it is going to be installed as a dependency from another package?

Making grub depend on host-gawk fixes this for me.

Quoted 40 lines · Yann E. MORIN

Brian, All,

+Köry who did recent changes in grub2

On 2021-10-15 12:59 +0200, Brian Murphy spake thusly:

Quoted 1 line

Could you give a bit more details about the reason why host-gawk is needed? I've just been able to complete a grub2 build with mawk as my system awk. grub2's configure even detects that situation;

checking for gawk... no
checking for mawk... mawk

Regards,
Yann E. MORIN.

Quoted 24 lines
---
  boot/grub2/grub2.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
boot/grub2/grub2.mk +1 -1
index e01ebb2edb..77bf26b739 100644
@@ -10,7 +10,7 @@ GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
  GRUB2_LICENSE = GPL-3.0+
  GRUB2_LICENSE_FILES = COPYING
  GRUB2_DEPENDENCIES = host-bison host-flex host-grub2
-HOST_GRUB2_DEPENDENCIES = host-bison host-flex
+HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk
  GRUB2_INSTALL_IMAGES = YES
 
  # 0001-build-Fix-GRUB-i386-pc-build-with-Ubuntu-gcc.patch and 2021/03/02
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 11 lines
Med venlig hilsen / Kind Regards / Mit freundlichen Grüssen

*Brian Murphy*

Development Engineer

robotize

Maglebjergvej 5B - 2800 Kgs. Lyngby - Denmark
Tel +45 3080 9070
Mail [email protected] - Web www.robotize.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Brian, All,

On 2021-10-25 11:06 +0200, Brian Murphy spake thusly:

Quoted 18 lines

Yeah. I got this randomly when building - and pretty much always from clean:

aclocal.m4:17: warning: this file was generated for autoconf 2.69. You have another version of autoconf.  It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.
rm -f stamp-h1
touch ../config-util.h.in
cd . && /bin/bash ./config.status config-util.h
config.status: creating config-util.h
In file included from ../include/grub/disk.h:22,
                 from ../include/grub/file.h:26,
                 from ../grub-core/fs/minix.c:21:
./config.h:38:10: fatal error: ./config-util.h: No such file or directory 38 | #include <config-util.h>
      |          ^~~~~~~~~~~~~~~

This is a parallel build issue; I also hit that issue even with gawk intalled on my system. We've already backported an upstream change to (at least partially?) fix that issue:

    https://git.buildroot.org/buildroot/commit/?id=51682c03a8b99d42c1b4e253da80c127d9146c9f
Quoted 7 lines

compilation terminated.
make[1]: *** [Makefile:13096: libgrub.pp] Error 1
make[1]: Leaving directory '/home/brm/src/buildroot/br.pc/output/build/grub2-2.04/build-i386-pc'
make: *** [package/pkg-generic.mk:294:
/home/brm/src/buildroot/br.pc/output/build/grub2-2.04/.stamp_built] Error 2

Quoted 5 lines

and when I run the command I get:

$ /bin/bash ./config.status config-util.h
config.status: creating config-util.h
./config.status: line 2356: gawk: command not found

This is indeed interesting.

Without gawk installed on my system, and without host-gawk available:

    $ which gawk
    [zilch]
    $ grep gawk ./config.status
    [zilch]
    $ /bin/bash ./config.status config-util.h
    config.status: creating config-util.h
    config.status: config-util.h is unchanged
    $ rm config-util.h
    $ /bin/bash ./config.status config-util.h
    config.status: creating config-util.h
Quoted 7 lines

config.status: error: could not create config-util.h

So grub ends up needing gawk to create this config-util.h. I do not have gawk installed on my build machine but other buildroot packages depend on host-gawk so it ends up being built. Perhaps grub autodetects gawk before it is ready to be used (sometimes) in a parallel build if it is going to be installed as a dependency from another package?

Ah, host-gawk ends up in the dep[endency chain og grub2 by way of anotehr package. In that case, running config.status manually like you did aboce will be mising the proper PATH that has Buildroot's host/bin/ directory so that gawk is found.

So, your build issue really looks like the parallel build issue we are supposed to have fixed already; see above.

Regards,
Yann E. MORIN.

Quoted 60 lines

Making grub depend on host-gawk fixes this for me.

Quoted 39 lines · Yann E. MORIN

Brian, All,

+Köry who did recent changes in grub2

On 2021-10-15 12:59 +0200, Brian Murphy spake thusly:

Quoted 1 line

Could you give a bit more details about the reason why host-gawk is needed? I've just been able to complete a grub2 build with mawk as my system awk. grub2's configure even detects that situation;

checking for gawk... no
checking for mawk... mawk

Regards,
Yann E. MORIN.

Quoted 23 lines
---
 boot/grub2/grub2.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/grub2/grub2.mk +1 -1
index e01ebb2edb..77bf26b739 100644
@@ -10,7 +10,7 @@ GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
 GRUB2_LICENSE = GPL-3.0+
 GRUB2_LICENSE_FILES = COPYING
 GRUB2_DEPENDENCIES = host-bison host-flex host-grub2
-HOST_GRUB2_DEPENDENCIES = host-bison host-flex
+HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk
 GRUB2_INSTALL_IMAGES = YES
 # 0001-build-Fix-GRUB-i386-pc-build-with-Ubuntu-gcc.patch and 2021/03/02
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 16 lines
Med venlig hilsen / Kind Regards / Mit freundlichen Grüssen

*Brian Murphy*

Development Engineer

robotize

Maglebjergvej 5B - 2800 Kgs. Lyngby - Denmark
Tel +45 3080 9070
Mail [email protected] - Web www.robotize.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot