BobBuildTool/basement

libs::ncurses-dev build fails

Closed this issue · 4 comments

DESTDIR=/home/superq/ws/new/dev/build/libs/ncurses-dev/x86_64-wendy-linux-gnu/1/workspace/build/../install \
prefix=/usr \
exec_prefix=/usr \
bindir=/usr/bin \
top_srcdir=/home/superq/ws/new/dev/src/libs/ncurses/1/workspace \
srcdir=/home/superq/ws/new/dev/src/libs/ncurses/1/workspace/misc \
datadir=/usr/share \
ticdir=/usr/share/terminfo \
source=terminfo.tmp \
cross_compiling=yes \
/bin/sh ./run_tic.sh
** Building terminfo database, please wait...
Running tic to install /home/superq/ws/new/dev/build/libs/ncurses-dev/x86_64-wendy-linux-gnu/1/workspace/build/../install/usr/share/terminfo ...

        You may see messages regarding extended capabilities, e.g., AX.
        These are extended terminal capabilities which are compiled
        using
                tic -x
        If you have ncurses 4.2 applications, you should read the INSTALL
        document, and install the terminfo without the -x option.

"terminfo.tmp", line 4790, terminal 'xterm-16color': error writing /home/superq/ws/new/dev/build/libs/ncurses-dev/x86_64-wendy-linux-gnu/1/workspace/install/usr/share/terminfo/x/xterm-16color
? tic could not build /home/superq/ws/new/dev/build/libs/ncurses-dev/x86_64-wendy-linux-gnu/1/workspace/build/../install/usr/share/terminfo
Makefile:93: recipe for target 'install.data' failed
make[1]: Leaving directory '/home/superq/ws/new/dev/build/libs/ncurses-dev/x86_64-wendy-linux-gnu/1/workspace/build/misc'
make[1]: *** [install.data] Error 1
Makefile:118: recipe for target 'install' failed
make: *** [install] Error 2
++ bob_handle_error 2
++ set +x
Step failed with return status 2; Command: make $INSTALL_TAGET DESTDIR=${PWD}/../install ${INSTALL_OPTIONS:+"${INSTALL_OPTIONS[@]}"}
Call stack (most recent call first)
    #0: Class  autotools, layer basement, line 62, in autotoolsBuild
    #1: Recipe libs::ncurses#1, layer basement, line 1, in main

Do you have tic installed on your host? Looks like ncurses needs this tool to cross compile... 🙈

tic -V
ncurses 6.0.20160213

but here i do nothing special, this issue should happen for u, also?
i use a native linux ubuntu16 machine and try to build a still working project, but in sandbox?!

edit: i guess this is happen because of using depend: devel::cross-toolchain-x86_64-linux-gnu as target toolchain and basement::rootrecipe to get host-toolchain. so i do cross-compile from x86_64 to x86_64 :)

Yeah, the basement project is steered to cross compile by default, even on the same architecture. The basement::rootrecipe class will even bring its own host compiler (devel::host-compat-toolchain, currently gcc 5.4.0 + glibc 2.23) that is statically linked and guaranteed to run on the oldest supported Ubuntu LTS version. If you depend on any of the toolchains then they are always cross-compiling toolchains. Even on the same architecture because the result cannot be guaranteed to run on the host.

I'm using Debian 10 which uses ncurses 6.1.20181013. Maybe the Ubuntu version is too old. 🤔 The fix should be to compile a statically linked native host-tic first and use that during the cross-compile.

The fix should be to compile a statically linked native host-tic first and use that during the cross-compile.

correct, this is also described here: http://www.linuxfromscratch.org/lfs/view/development/chapter06/ncurses.html

Then, run the following commands to build the “tic” program on the build host:
mkdir build
pushd build
  ../configure
  make -C include
  make -C progs tic
popd

TIC_PATH=$(pwd)/build/progs/tic
    We need to pass the path of the just built tic able to run on the building machine, so that the terminal database can be created without errors.

so we just have to run this lines in the recipe..?!

diff --git a/recipes/libs/ncurses.yaml b/recipes/libs/ncurses.yaml
index 99c4a31..3286566 100644
--- a/recipes/libs/ncurses.yaml
+++ b/recipes/libs/ncurses.yaml
@@ -11,6 +11,17 @@ checkoutSCM:

 buildTools: [host-toolchain]
 buildScript: |
+    # We need to pass the path of the just built tic
+    # able to run on the building machine, so that the
+    # terminal database can be created without errors.
+    mkdir tic
+    pushd tic
+    $1/configure
+    make -C include
+    make -C progs tic
+    export TIC_PATH=$(pwd)/progs/tic
+    popd
+
     autotoolsBuild $1 \
             --with-shared           \
             --without-debug         \

currently gcc 5.4.0 + glibc 2.23

really, not normal gcc recipe with 9.2.0 and normal glibc recipe with 2.30?
where comes this packages from?