wenyi0421 / turing-pi

Turing-pi BMC firmware
https://turingpi.com/
106 stars 28 forks source link

terminfo/a/ansi': No such file or directory #3

Open chrsoo opened 1 year ago

chrsoo commented 1 year ago

When building the project using a docker image, the build fails with the following error:

# make V=1
...
/usr/bin/install -c ncurses-config /src/buildroot/output/target/usr/bin/ncurses6-config
installing ncurses.pc
installing ncurses.pc
installing panel.pc
installing menu.pc
installing form.pc
make[2]: Leaving directory '/src/buildroot/output/build/ncurses-6.1/misc'
make[1]: Leaving directory '/src/buildroot/output/build/ncurses-6.1'
rm -f -rf /src/buildroot/output/target/usr/share/terminfo /src/buildroot/output/target/usr/share/tabset
/usr/bin/install -D -m 0644 /src/buildroot/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/share/terminfo/a/ansi /src/buildroot/output/target/usr/share/terminfo/a/ansi
/usr/bin/install: cannot stat '/src/buildroot/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/share/terminfo/a/ansi': No such file or directory
make: *** [package/pkg-generic.mk:387: /src/buildroot/output/build/ncurses-6.1/.stamp_target_installed] Error 1

Any idea on how to fix the build?

If I can make this work, I will create a PR with the Dockerfile and instructions on how to build the project on MacOS running on Apple Silicon.

Steps to Reproduce

  1. Add the following Dockerfile to the project root directory:
    
    FROM ubuntu:latest

ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential file wget cpio rsync bc subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev \ xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip libncurses-dev u-boot-tools \ lib32z1 lib32z1-dev lib32stdc++6 libstdc++6 && \ rm -rf /var/lib/apt/lists/*

2. Create the `turing-pi-build` image locally:

docker build --platform linux/amd64 -t turing-pi-build .

3. Run the `turing-pi-build` image interactively:

docker run -it --rm --name turing-pi --platform linux/amd64 \ --mount type=bind,source=${PWD},target=/src turing-pi-build bash

4. Change into the `/src` directory:

cd /src

5. Follow the build instructions in `readme.md`

# Additional Notes
The following apt packages are missing in the `readme.md`:

file wget cpio rsync bc

0xE282B0 commented 1 year ago

Same here, created a Dockerfile from ubuntu:22.04 (amd64) to build the firmware on Mac.

make[2]: Leaving directory '/data/buildroot/output/build/ncurses-6.1/misc'
make[1]: Leaving directory '/data/buildroot/output/build/ncurses-6.1'
rm -f -rf /data/buildroot/output/target/usr/share/terminfo /data/buildroot/output/target/usr/share/tabset
/usr/bin/install -D -m 0644 /data/buildroot/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/share/terminfo/a/ansi /data/buildroot/output/target/usr/share/terminfo/a/ansi
/usr/bin/install: cannot stat '/data/buildroot/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/share/terminfo/a/ansi': No such file or directory
make: *** [package/pkg-generic.mk:387: /data/buildroot/output/build/ncurses-6.1/.stamp_target_installed] Error 1
0xE282B0 commented 1 year ago

In the ncurses.mk is a list of terminfo files, however the filesystem looks different for me:

expected:

        a/ansi \
        d/dumb \
        l/linux \
        ...

existing path:

        61/ansi \
        64/dumb \
        6c/linux \
        ...

The folder names are not letters like a but the hex representation 61.

@chrsoo I just replaced the folder names to continue: ncurses.mk.patch

serpent213 commented 1 year ago

Same using BuildRoot within https://github.com/nerves-project/nerves_system_br within a VSCode DevContainer. Used your patch as a quick fix.