Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container build script fails to compile GCC #39

Closed
John-Goff opened this issue May 13, 2024 · 10 comments
Closed

Container build script fails to compile GCC #39

John-Goff opened this issue May 13, 2024 · 10 comments

Comments

@John-Goff
Copy link

John-Goff commented May 13, 2024

Hello! When running ./buildah-koxtoolchain.sh kobo, it fails at the step [INFO ] Installing C library with the following error logs:

[INFO ]  =================================================================
[INFO ]  Installing C library                                                                           
[INFO ]    =================================================================
[INFO ]    Building for multilib 1/1: ''                                                                                                                                                                        
[EXTRA]      Cleaning up start files      
[EXTRA]      Configuring C library                                                                      
[EXTRA]      Building C library                                                                         
[EXTRA]      Installing C library                                                                                                                                                                               
[ERROR]      make[3]: *** [Makefile:200: /home/kox/x-tools/arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/sysroot/usr/share/info/libc.info] Error 1                                                         
[ERROR]      make[2]: *** [Makefile:221: manual/subdir_install] Error 2
[ERROR]      make[1]: *** [Makefile:10: install] Error 2
[ERROR]   
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Building for multilib 1/1: '''
[ERROR]  >>        called in step 'Installing C library'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@376]
[ERROR]  >>        called from: glibc_backend_once[scripts/build/libc/glibc.sh@466]
[ERROR]  >>        called from: CT_IterateMultilibs[scripts/functions@1608]
[ERROR]  >>        called from: glibc_backend[scripts/build/libc/glibc.sh@122]
[ERROR]  >>        called from: glibc_main[scripts/build/libc/glibc.sh@92]
[ERROR]  >>        called from: do_libc_main[scripts/build/libc.sh@33]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@707]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      https://crosstool-ng.github.io/docs/known-issues/
[ERROR]  >>
[ERROR]  >> NOTE: Your configuration includes features marked EXPERIMENTAL.
[ERROR]  >> Before submitting a bug report, try to reproduce it without enabling
[ERROR]  >> any experimental features. Otherwise, you'll need to debug it
[ERROR]  >> and present an explanation why it is a bug in crosstool-NG - or
[ERROR]  >> preferably, a fix.
[ERROR]  >>
[ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
[ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR]  >>
[ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
[ERROR]  >>  Read the bug reporting guidelines here:
[ERROR]  >>      http://crosstool-ng.github.io/support/
[ERROR]   
[ERROR]  (elapsed: 21:37.63)
[21:39] / gmake: *** [/home/kox/koxtoolchain/build/CT_NG_BUILD/bin/ct-ng:261: build] Error 2

After this, the container is built and can be ran with the command podman run --rm -it -v .:/home/kox/build koxtoolchain:kobo-latest, however gcc and some of the other tools are missing. The contents of the /home/kox/x-tools/ directory is as follows:

arm-kobo-linux-gnueabihf/
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/ar
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/as
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/ld
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/ld.bfd
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/ld.gold
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/nm
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/objcopy
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/objdump
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/ranlib
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/readelf
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/bin/strip
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/debug-root/
arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/sysroot/
arm-kobo-linux-gnueabihf/bin/
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-addr2line
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-ar
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-as
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-c++filt
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-ct-ng.config
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-dwp
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-elfedit
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-gprof
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-ld
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-ld.bfd
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-ld.gold
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-nm
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-objcopy
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-objdump
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-ranlib
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-readelf
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-size
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-strings
arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf-strip
arm-kobo-linux-gnueabihf/lib/
arm-kobo-linux-gnueabihf/lib/bfd-plugins/
arm-kobo-linux-gnueabihf/lib/bfd-plugins/libdep.so
arm-kobo-linux-gnueabihf/lib/ldscripts/
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.x
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xbn
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xc
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xce
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xd
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xdc
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xdce
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xde
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xdw
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xdwe
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xe
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xn
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xr
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xs
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xsc
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xsce
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xse
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xsw
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xswe
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xu
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xw
arm-kobo-linux-gnueabihf/lib/ldscripts/armelf_linux_eabi.xwe
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.x
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xbn
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xc
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xce
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xd
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xdc
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xdce
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xde
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xdw
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xdwe
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xe
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xn
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xr
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xs
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xsc
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xsce
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xse
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xsw
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xswe
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xu
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xw
arm-kobo-linux-gnueabihf/lib/ldscripts/armelfb_linux_eabi.xwe
arm-kobo-linux-gnueabihf/share/

I am building on Arch Linux, with buildah version 1.35.3 (image-spec 1.1.0, runtime-spec 1.1.0) and podman version 5.0.1. I installed the dependencies listed in the readme even though this is building inside a container, not sure if it makes a difference or not.

@matthargett
Copy link
Collaborator

Can you supply the error contents of the build.log file that the output mentions? The command line that failed, and the error output that followed, will be super helpful! 😀

@Frenzie
Copy link
Member

Frenzie commented May 14, 2024

Pinging @cam-rod (see #38). I forgot about it, but I believe we landed on reverting and not supporting that. I'd still expect it to work though, given that nothing changed since.

@John-Goff
Copy link
Author

John-Goff commented May 14, 2024

@matthargett I did look for it but I couldn't find it inside the container, do you happen to know the directory and whether or not to look in the container or the host? Unless I'm blind, it didn't say where to look.

@Frenzie thanks for linking that PR again, I did scan it briefly but last time I missed the mention of https://github.com/koreader/virdevenv, that may make this issue redundant for me :) May I suggest linking to there from https://github.com/koreader/koxtoolchain?tab=readme-ov-file#container-image ? I was under the impression that koreader/koxtoolchain only supported podman, not docker images. I can submit a PR for that change, if desired.

@Frenzie
Copy link
Member

Frenzie commented May 14, 2024

that may make this issue redundant for me :)

Not quite unfortunately, the images there have been optimized in the meantime since it's built here anyway, which strikes me as a bit of a Catch 22 but in any case you can just quickly run sudo apt-get install build-essential autoconf automake bison flex gawk libtool libtool-bin libncurses-dev curl file git gperf help2man texinfo unzip wget in any image, probably better to just pull generic Debian/Ubuntu, which is no different than what the buildah script does. But I don't have the bandwidth to debug some special tool I've never used.

@John-Goff
Copy link
Author

Yeah I was wondering about that, I may end up making my own docker image... For context, I'm attempting to compile the Erlang/Elixir VM for my Kobo 😄 So the virdevenv images might contain either too much or not enough, so a bespoke image might not be a bad idea... Anyway, figured it was better to start with letting you folks know about the podman image first 🙂 Since this is not going to be supported with #40, I'll go ahead and close this issue.

@Frenzie
Copy link
Member

Frenzie commented May 14, 2024

Generally speaking wouldn't it be easier to simply download and use https://github.com/koreader/koxtoolchain/releases/tag/2021.12?

@John-Goff
Copy link
Author

Generally speaking probably, but I'd prefer to have a container that has the toolchain installed so I can keep my environment isolated. I generally prefer to not add stuff that's only required for one project to my $PATH if at all avoidable, using stuff like asdf or docker when available. Documenting the requirements of your project is good, specifying them in a lockfile or Docker image is better 😉

@Frenzie
Copy link
Member

Frenzie commented May 14, 2024

Note that's what source refs/x-compile.sh kobo env is intended for. Add to PATH doesn't mean anything permanent unless you want it to. ;-)

@John-Goff
Copy link
Author

Hmm you're right, the first time I skimmed through that file I think I missed the early return inside the if [[ "${2}" == "env" ]] and thought it was doing a bunch more than I wanted it to do. Regardless, adding to $PATH still implies that the software has to be compiled or installed first. The ideal situation is for a new contributor to my project to be able to clone the repo, run a single command, and have a file they can install on their Kobo. I could probably write a script which downloads the precompiled toolchain and runs source refs/x-compile.sh kobo env, but then you're either left with a ~/x-tools toolchain that I'm personally probably going to forget what it's used for in 6 months, or you delete the folder and redownload every time you compile, or you do some trickery with moving the folders to and fro. But in the latter case you still have to deal with different linux distros, not to mention macos. I'd personally prefer to have a Docker image that I can give a name to, that way I'll remember what it's for even if it does end up taking up a few MBs extra. You're definitely right that it'd be easier to ignore all this and just put in the readme "Install these dependencies", but it's a personal preference thing 🙂 I'll have some time to play with this tonight, thanks for your help and guidance so far!

@Frenzie
Copy link
Member

Frenzie commented May 14, 2024

I can confirm the problem anyway. I might look into why some other day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants