Termux-packages: ncurses build: terminal 'xterm-16color' issue

Created on 2 Nov 2019  路  9Comments  路  Source: termux/termux-packages

Problem description
Got error while building on ubuntu 18:04 box single package ncurses for arm .

Steps to reproduce
Prepared build environment on ubuntu 18:04 box with:

./scripts/setup-ubuntu.sh

Exported environment:

export TERMUX_PREFIX=/home/ubuntu/usr
export TERMUX_ANDROID_HOME=/home/ubuntu

Tried to build ncurses with:

./build-package.sh -a arm ncurses

Got this error:

...
"terminfo.tmp", line 4775, terminal 'xterm-16color': error writing /home/ubuntu/usr/share/terminfo/x/xterm-16color
? tic could not build /home/ubuntu/usr/share/terminfo
Makefile:92: recipe for target 'install.data' failed
make[1]: *** [install.data] Error 1
make[1]: Leaving directory '/home/ubuntu/.termux-build/ncurses/build/misc'
Makefile:117: recipe for target 'install' failed
make: *** [install] Error 2

Expected behavior
Build successful.

Additional information
None

Depending on problem, additional information may be requested:

  1. Android warning/error log: logcat -d "*:W".
  2. Output of strace: strace -fv -s 2048 -o strace.log {program name}.
  3. If program write it's own log files, you may need to attach them.

Most helpful comment

@Harshiv-Patel Not necessary. Official build environment is provided by Docker image, not just setup-ubuntu.sh script. We recently switched to Ubuntu 20.04, so any previous versions are "deprecated" and builds are not guaranteed here to be reproducible. No need to leave any messages or even try to patch the host.

Use the compatible host OS version, otherwise use Docker.

All 9 comments

Does /home/ubuntu/usr/share exist?

The output of tree /home/ubuntu/usr is here

Weird, your tree contains /home/ubuntu/usr/share/terminfo so not sure what's happening.

Unreproducible. Make sure that /home/ubuntu is owned by user running build-package.sh. Components of prefix path must be writable by current user.

arm-linux-androideabi-clang -L/home/ubuntu/usr/lib -march=armv7-a -Wl,-rpath=/home/ubuntu/usr/lib,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now   -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb -fstack-protector-strong -Oz -Qunused-arguments -shared -Wl,-soname,`basename /home/ubuntu/usr/lib/libformw.so.6.1 .6.1`.6,-stats,-lc -o /home/ubuntu/usr/lib/libformw.so.6.1 ../obj_s/fld_arg.o ../obj_s/fld_attr.o ../obj_s/fld_current.o ../obj_s/fld_def.o ../obj_s/fld_dup.o ../obj_s/fld_ftchoice.o ../obj_s/fld_ftlink.o ../obj_s/fld_info.o ../obj_s/fld_just.o ../obj_s/fld_link.o ../obj_s/fld_max.o ../obj_s/fld_move.o ../obj_s/fld_newftyp.o ../obj_s/fld_opts.o ../obj_s/fld_pad.o ../obj_s/fld_page.o ../obj_s/fld_stat.o ../obj_s/fld_type.o ../obj_s/fld_user.o ../obj_s/frm_cursor.o ../obj_s/frm_data.o ../obj_s/frm_def.o ../obj_s/frm_driver.o ../obj_s/frm_hook.o ../obj_s/frm_opts.o ../obj_s/frm_page.o ../obj_s/frm_post.o ../obj_s/frm_req_name.o ../obj_s/frm_scale.o ../obj_s/frm_sub.o ../obj_s/frm_user.o ../obj_s/frm_win.o ../obj_s/fty_alnum.o ../obj_s/fty_alpha.o ../obj_s/fty_enum.o ../obj_s/fty_generic.o ../obj_s/fty_int.o ../obj_s/fty_ipv4.o ../obj_s/fty_num.o ../obj_s/fty_regex.o -L../lib -lncursesw 
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: initial tasks run time: (user: 0.000000 sys: 0.000000 wall: 0.000000)
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: middle tasks run time: (user: 0.000000 sys: 0.000000 wall: 0.000000)
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: final tasks run time: (user: 0.000000 sys: 0.000000 wall: 0.000000)
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: total run time: (user: 0.000000 sys: 0.000000 wall: 0.000000)
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: total space allocated by malloc: 1990656 bytes
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: total bytes mapped for read: 13359140
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: maximum bytes mapped for read at one time: 13359140
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: archive libraries: 6
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: total archive members: 2274
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: loaded archive members: 6
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: lib groups: 0
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: total lib groups members: 0
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: loaded lib groups members: 0
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: output file size: 88244 bytes
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: symbol table entries: 3514; buckets: 53201
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: symbol table stringpool entries: 2255; buckets: 53201
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: symbol table stringpool Stringdata structures: 27
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: section name pool entries: 34; buckets: 47
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: section name pool Stringdata structures: 1
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: output symbol name pool entries: 492; buckets: 709
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: output symbol name pool Stringdata structures: 4
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: dynamic name pool entries: 194; buckets: 337
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: dynamic name pool Stringdata structures: 1
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .comment merged strings input bytes: 10945
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .comment merged strings input strings: 43
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .comment merged strings entries: 3; buckets: 11
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .comment merged strings Stringdata structures: 1
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .rodata merged strings input bytes: 25
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .rodata merged strings input strings: 3
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .rodata merged strings entries: 3; buckets: 11
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .rodata merged strings Stringdata structures: 1
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .debug_str merged strings input bytes: 4663
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .debug_str merged strings input strings: 282
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .debug_str merged strings entries: 211; buckets: 409
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: .debug_str merged strings Stringdata structures: 4
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: total free lists: 0
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: total free list nodes: 0
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: calls to Free_list::remove: 0
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: nodes visited: 0
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: calls to Free_list::allocate: 0
/home/builder/.termux-build/_cache/android-r20-api-24-v2/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.real: nodes visited: 0
cd /home/ubuntu/usr/lib && (ln -s -f libformw.so.6.1 libformw.so.6; ln -s -f libformw.so.6 libformw.so; )
installing ../lib/libformw.a as /home/ubuntu/usr/lib/libformw.a
/usr/bin/install -c -m 644 ../lib/libformw.a /home/ubuntu/usr/lib/libformw.a
arm-linux-androideabi-ranlib /home/ubuntu/usr/lib/libformw.a
installing /home/builder/.termux-build/ncurses/src/form/form.h in /home/ubuntu/usr/include
make[1]: Leaving directory '/home/builder/.termux-build/ncurses/build/form'
cd misc && make DESTDIR="" RPATH_LIST="/home/ubuntu/usr/lib" install
make[1]: Entering directory '/home/builder/.termux-build/ncurses/build/misc'
mkdir -p /home/ubuntu/usr/share/tabset
DESTDIR= \
prefix=/home/ubuntu/usr \
exec_prefix=/home/ubuntu/usr \
bindir=/home/ubuntu/usr/bin \
top_srcdir=/home/builder/.termux-build/ncurses/src \
srcdir=/home/builder/.termux-build/ncurses/src/misc \
datadir=/home/ubuntu/usr/share \
ticdir=/home/ubuntu/usr/share/terminfo \
source=terminfo.tmp \
cross_compiling=yes \
/bin/sh ./run_tic.sh
** Building terminfo database, please wait...
Running tic to install /home/ubuntu/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.

1748 entries written to /home/ubuntu/usr/share/terminfo
** built new /home/ubuntu/usr/share/terminfo
** sym-linked /home/ubuntu/usr/lib/terminfo for compatibility
installing std
installing stdcrt
installing vt100
installing vt300
finished install.data
/usr/bin/install -c ncurses-config /home/ubuntu/usr/bin/ncursesw6-config
installing ncursesw.pc
installing ncursesw.pc
installing panelw.pc
installing menuw.pc
installing formw.pc
make[1]: Leaving directory '/home/builder/.termux-build/ncurses/build/misc'
termux - build of 'ncurses' done

You skipped lines before

"terminfo.tmp", line 4775, terminal 'xterm-16color': error writing /home/ubuntu/usr/share/terminfo/x/xterm-16color
? tic could not build /home/ubuntu/usr/share/terminfo

so it is not possible to know what is happening in your case (though I guess most likely either permission or missing host tool issue).

In my case I'm building on WSL 1; the prefix path was unchanged
Error was :
"terminfo.tmp", line 4797, terminal 'xterm-16color': error writing /data/data/com.termux/files/usr/share/terminfo/x/xterm-16color ? tic could not build /data/data/com.termux/files/usr/share/terminfo
...makefile failure logs continue

This was running the script as sudo, also manually invoking the Makefile for tic resulted same. Without sudo, the error changed to "permission denied, but for a different term type called dumb term or something"
Interestingly, commenting out the concerned xterm-16color entry from terminfo.tmp[the source file for database] resolved the issue and the terminfo database was built successfully.

It seems that this "%user%/.termux-build/ncurses/build/misc/terminfo.tmp" file had the relevant entry corrupted.[Edit-- the line given in error is exactly same as source, so are xterm-16 related other lines; so error lies somewhere else]. As hundreds of other files in same dir tree are written successfully each time, it may not be permission issue(though sudo ing may hide any existing permission issues)
For runtime situation, absence of "xterm-16color" would simply cause "xterm" default to be used I guess?

@Harshiv-Patel Building in WSL is not supported. Use Docker or VirtualBox instead, with Ubuntu not lower than 19.10 and all necessary build tools installed (./scripts/setup-ubuntu.sh).

@consultit , any success so far? I am on Ubuntu 18.04 and it still can't build xterm-16color, though commenting the xterm-16color source allows the make install to finish correctly.

I've skipped installing required build tools for packges "unstable" and "x11" repos but that should not interfere here as I am not building those. I'm building for arm.

Edit: a bug used to exist in old tic compilers that would prevent newer versions of database compilation, reference, this suggests using a newer "on-system" tic. Mine was from 2018, I'll try to update that and see if that works.
Edit.2 that indeed seems to be the case; I temporarily replaced /usr/bin/tic with the most recent version I could compile ( ncurses 6.2.20200212 , find out yours by tic -V) and the ncurses build completed normally.
I therefore conclude that the older version of "/usr/bin/tic" on the host systems seems to cause this issue, the solution to this is to download and compile the latest available ncurses repo and build it; and use(if not replace) the newly built tic to build all the packages.
The Ubuntu 18.04 system appears to host quite old version which can't build the new terminfo database.
@consultit can you try that and verify if the above indeed resolves this ?
@xeffyr I think it's best to leave it to you to automate any of above,if necessary, or leave a message to the user to get the latest ncurses build for "host builds", or list that as dependency ?

Edit.3 : Just to inform that I just managed to build ncurses on WSL1 with above mentioned patch, so it's not recommended but entirely possible on WSL as well.

@Harshiv-Patel Not necessary. Official build environment is provided by Docker image, not just setup-ubuntu.sh script. We recently switched to Ubuntu 20.04, so any previous versions are "deprecated" and builds are not guaranteed here to be reproducible. No need to leave any messages or even try to patch the host.

Use the compatible host OS version, otherwise use Docker.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Wetitpig picture Wetitpig  路  3Comments

Zuccace picture Zuccace  路  3Comments

am11 picture am11  路  3Comments

thurask picture thurask  路  3Comments

jackbrycesmith picture jackbrycesmith  路  3Comments