BobBuildTool/basement

glibc missing dependency to gawk

Closed this issue · 5 comments

missing dependency of util::gawk for glibc build

configure: error:
*** These critical programs are missing or too old: gawk
*** Check the INSTALL file for required versions.
++ bob_handle_error 1

for compat and non-compat glibc.

I fixed it like that:

diff --git a/recipes/libs/compat/glibc.yaml b/recipes/libs/compat/glibc.yaml
index 55c7fe8..49a2ba6 100644
--- a/recipes/libs/compat/glibc.yaml
+++ b/recipes/libs/compat/glibc.yaml
@@ -3,6 +3,9 @@ inherit: [make, patch]
 depends:
     - kernel::linux-libc-headers
     -
+        name: utils::gawk
+        use: [tools]
+    -
         name: devel::compat::gcc-cross-bare
         use: [tools]

@@ -20,7 +23,7 @@ checkoutScript: |
     patchApplySeries $<<glibc/*.diff>>

 buildVars: [AUTOCONF_TARGET]
-buildTools: [gcc-cross-bare, target-toolchain, bison]
+buildTools: [gcc-cross-bare, target-toolchain, bison, gawk]
 buildScript: |
     EXTRA=
     [ -e $1/usr/include/selinux/selinux.h ] || EXTRA+=" --without-selinux"
diff --git a/recipes/libs/glibc.yaml b/recipes/libs/glibc.yaml
index 674cb09..b1a0139 100644
--- a/recipes/libs/glibc.yaml
+++ b/recipes/libs/glibc.yaml
@@ -3,6 +3,9 @@ inherit: [make, patch]
 depends:
     - kernel::linux-libc-headers
     -
+        name: utils::gawk
+        use: [tools]
+    -
         name: devel::gcc-cross-bare
         use: [tools]

@@ -20,7 +23,7 @@ checkoutScript: |
     patchApplySeries $<<glibc/*.diff>>

 buildVars: [AUTOCONF_TARGET]
-buildTools: [gcc-cross-bare, target-toolchain, bison]
+buildTools: [gcc-cross-bare, target-toolchain, bison, gawk]
 buildScript: |
     EXTRA=
     [ -e $1/usr/include/selinux/selinux.h ] || EXTRA+=" --without-selinux"
diff --git a/recipes/utils/gawk.yaml b/recipes/utils/gawk.yaml
index 966cb51..6c79189 100644
--- a/recipes/utils/gawk.yaml
+++ b/recipes/utils/gawk.yaml
@@ -22,3 +22,5 @@ packageScript: |
     autotoolsPackageTgt

 provideDeps: [ "*-tgt" ]
+provideTools:
+    gawk: "usr/bin"

Did you have gawk installed on your host?

shouldn't that be independent to my host system?

diff --git a/recipes/libs/glibc.yaml b/recipes/libs/glibc.yaml
index 674cb09..b1a0139 100644
--- a/recipes/libs/glibc.yaml
+++ b/recipes/libs/glibc.yaml
@@ -3,6 +3,9 @@ inherit: [make, patch]
 depends:
     - kernel::linux-libc-headers
     -
+        name: utils::gawk
+        use: [tools]
+    -
         name: devel::gcc-cross-bare
         use: [tools]

or should we add this here: https://github.com/BobBuildTool/basement/blob/master/classes/basement/rootrecipe.yaml

Currently gawk is one of the tools that need to be installed on the host when building the project from scratch. It's not really documented and others like gcc, perl, make, sed, patch might be more obvious.

These tools are ubiquitous and mature so I saw no point yet in defining then in the recipes. On the other hand we should at least document what tools need to be installed on the host...

okay. https://bob-build-tool.readthedocs.io/en/latest/installation.html currently awk isn't listed.

on the other hand, what could be the problem to use the awk, we have a recipe for? so we are a bit more independent.

so this failed:

./config.status: line 1144: awk: command not found
config.status: error: could not create Makefile
++ bob_handle_error 1
++ set +x
Step failed with return status 1; Command: $1/configure ${AUTOCONF_BUILD:+--build=${AUTOCONF_BUILD}} ${AUTOCONF_HOST:+--host=${AUTOCONF_HOST}} ${AUTOCONF_TARGET:+--target=${AUTOCONF_TARGET}} --prefix="/usr" --sysconfdir="/etc" --localstatedir="/var" --libdir=/usr/lib ${SHARED_STATIC:+"${SHARED_STATIC[@]}"} "${@:2}"
Call stack (most recent call first)
    #0: Class  autotools, layer basement, line 50, in autotoolsBuild
    #1: Recipe utils::gawk, layer basement, line 1, in main
Build error: Build script ./dev/build/utils/gawk/x86_64-wendy-linux-gnu/1/build.sh returned with 1
Failed package: x86_64::linux/devel::sandbox/utils::gawk

We need gawk to build gawk. So to keep this simple, we should define gawk as a system requirement.