nerves-project / nerves_system_x86_64

Apache License 2.0
20 stars 16 forks source link

Custom system based on x86_64 fails to build ncurses #214

Open claysampson opened 1 year ago

claysampson commented 1 year ago

Environment

Elixir 1.14.5 (compiled with Erlang/OTP 24)


I am making a custom nerves system for the OnLogic DA-1000 based on `nerves_system_x86_64 v1.24.0`. This is running on a M1 Mac inside a up-to-date Ubuntu 22.04 arm64 VM, and is currently unmodified from the upstream.

The problem seems to be some wrong configuration deep in buildroot for ncurses. The tail end of the build output is looking for `ansi` terminfo in `(...)sysroot/usr/share/terminfo/a/ansi` but it does not exist. This is because there is some sort of numeric system in place for the various terminals:

```shell
nerves_system_da_1000$ ls -l /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/host/x86_64-buildroot-linux-musl/sysroot/usr/share/terminfo
total 0
drwxr-xr-x   4 tech tech   128 Oct  2 16:18 31
drwxr-xr-x   5 tech tech   160 Oct  2 16:18 32
# much more output

Current behavior

nerves_system_da_1000$ mix compile
==> nerves
==> nerves_system_da_1000
Generated nerves_system_da_1000 app
make: Entering directory '/mnt/nerves_system_da_1000/deps/nerves_system_br/buildroot-2023.05.2'
  GEN     /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/Makefile

WARNING: unmet direct dependencies detected for BR2_PACKAGE_ERLANG
  Depends on [n]: BR2_USE_MMU [=y] && !BR2_STATIC_LIBS [=n] && BR2_TOOLCHAIN_HAS_THREADS [=y] && BR2_PACKAGE_ERLANG_ARCH_SUPPORTS [=n]
  Selected by [y]:
  - BR2_PACKAGE_NERVES_CONFIG [=y]

WARNING: unmet direct dependencies detected for BR2_PACKAGE_ERLANG
  Depends on [n]: BR2_USE_MMU [=y] && !BR2_STATIC_LIBS [=n] && BR2_TOOLCHAIN_HAS_THREADS [=y] && BR2_PACKAGE_ERLANG_ARCH_SUPPORTS [=n]
  Selected by [y]:
  - BR2_PACKAGE_NERVES_CONFIG [=y]

# ...
# Lots of output here
# ...

/bin/bash ./run_tic.sh
** Building terminfo database, please wait...
Running tic to install /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/target/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.

ncurses 6.4.20230429
"terminfo.tmp", line 1232, col 36, terminal 'fbterm': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 5341, col 36, terminal 'xterm+256color': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 5373, col 36, terminal 'xterm+256setaf': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 5420, col 25, terminal 'xterm+direct2': limiting value of `colors' from 0x1000000 to 0x7fff
"terminfo.tmp", line 5420, col 40, terminal 'xterm+direct2': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 5435, col 25, terminal 'xterm+direct': limiting value of `colors' from 0x1000000 to 0x7fff
"terminfo.tmp", line 5435, col 40, terminal 'xterm+direct': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 5457, col 25, terminal 'xterm+indirect': limiting value of `colors' from 0x1000000 to 0x7fff
"terminfo.tmp", line 5457, col 40, terminal 'xterm+indirect': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 8634, col 36, terminal 'dvtm-256color': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 5331, terminal 'xterm-16color': entry is larger than 4096 bytes
1815 entries written to /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/target/usr/share/terminfo
** built new /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/target/usr/share/terminfo
** sym-linked /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/target/usr/lib/terminfo for compatibility
installing std
installing stdcrt
installing vt100
installing vt300
finished install.data
/usr/bin/install -c ncurses-config /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/target/usr/bin/ncurses6-config
installing ncurses.pc
installing ncurses.pc
installing panel.pc
installing menu.pc
installing form.pc
rm -f -rf /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/target/usr/share/terminfo /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/target/usr/share/tabset
/usr/bin/install -D -m 0644 /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/host/x86_64-buildroot-linux-musl/sysroot/usr/share/terminfo/a/ansi /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/target/usr/share/terminfo/a/ansi
/usr/bin/install: cannot stat '/mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/host/x86_64-buildroot-linux-musl/sysroot/usr/share/terminfo/a/ansi': No such file or directory
make[1]: *** [package/pkg-generic.mk:388: /mnt/nerves_system_da_1000/.nerves/artifacts/nerves_system_da_1000-portable-1.24.0/build/ncurses-6.4-20230429/.stamp_target_installed] Error 1
make: *** [Makefile:23: _all] Error 2

Expected behavior

It builds :)