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

Binaries compiled for glibc fail with "not found" #355

Open
iamrecursion opened this issue Apr 1, 2019 · 15 comments
Open

Binaries compiled for glibc fail with "not found" #355

iamrecursion opened this issue Apr 1, 2019 · 15 comments

Comments

@iamrecursion
Copy link
Contributor

When attempting to make install the GHC bindist, the install process fails saying that a file (utils/ghc-cabal/dist-install/build/tmp/ghc-cabal) is not found. The file definitely exists. It's quite a confusing one, as I don't see why it would happen.

You can reproduce as follows, assuming a fresh installation of iSH:

  1. apk add coreutils findutils binutils bash gcc sed tar curl
  2. curl -sSL https://downloads.haskell.org/~ghc/8.6.4/ghc-8.6.4-i386-deb9-linux.tar.xz > ghc-8.6.4.tar.xz
  3. tar -xvf ghc-8.6.4.tar.xz
  4. cd ghc-8.6.4
  5. ./configure (this will fail if you have gawk installed with an error about not being able to open a file - for writing)
  6. make install

The only output in dmesg from a running make install alone is 51 (dmesg | wc -l) repetitions of unknown ioctl 5413.

I know that this isn't a lot to go on so far, so I'm mainly opening this PR in order to potentially get some pointers for how to investigate further.

@tbodt tbodt changed the title Cannot Install GHC Bindist Binaries compiled with glibc fail with "not found" Apr 1, 2019
@tbodt
Copy link
Member

tbodt commented Apr 1, 2019

This is the same as the issue with rust. I'll turn this into a tracking issue.

@tbodt tbodt changed the title Binaries compiled with glibc fail with "not found" Binaries compiled for glibc fail with "not found" Apr 1, 2019
@iamrecursion
Copy link
Contributor Author

Oh, that's a brilliant pointer. I'll try and get it working in a glibc chroot and report back (if I can get the chroot process to work with this update).

@tbodt
Copy link
Member

tbodt commented Apr 1, 2019

The solution is to either find a way to build glibc for 32-bit musl, or switch to ubuntu. Neither is really easy.

@iamrecursion
Copy link
Contributor Author

iamrecursion commented Apr 1, 2019

To update this issue with chroot progress, I followed this guide to create a chroot, but it currently fails with a missing syscall 191 at the stage of starting the chroot, which is entirely understandable. Issue has been filed separately for that.

@fprimex
Copy link

fprimex commented Oct 10, 2019

Try compiling this for 32 bit perhaps.

@econcz
Copy link

econcz commented Dec 16, 2020

This is a working solution: https://hub.docker.com/r/econcz/x86-alpine-glibc
I managed to install Miniconda3 and Stata 15 IC (32-bit) on this image in Docker, both are working.

@MasonProtter
Copy link

MasonProtter commented Mar 19, 2021

@econcz how did you get docker working? Or do you mean that you got this glibc container running on another machine?

@econcz
Copy link

econcz commented Mar 19, 2021

@econcz how did you get docker working? Or do you mean that you got this glibc container running on another machine?

I built a glibc-based Alpine filesystem in Docker.

Actually the mentioned apps are not working in iSH, they return illegal instructions (but it’s a problem inside the iSH App from what I understand since everything works in Docker).
Please check the iSH-project wiki on Github, there are two entries on how to create a iSH-compatible glibc-based filesystem container in Docker and transfer it to the iSH App. Good luck!

@MasonProtter
Copy link

MasonProtter commented Mar 19, 2021

Okay, so the docker image was on running on an iOS device in iSH? I read the wiki pages, but they were not very illuminating.

My understanding from #63 was that docker was not yet functional on iSH

@econcz
Copy link

econcz commented Mar 20, 2021

Okay, so the docker image was on running on an iOS device in iSH? I read the wiki pages, but they were not very illuminating.

My understanding from #63 was that docker was not yet functional on iSH

No-no, everything is much simpler: 1) you need to install Docker on your PC/Mac/Linux machine, 2) pull the image with glibc that I created from the Docker Hub, 3) create a container (preferably with privileged access) from it and install the software that you require into this container, 4) export the container as a filesystem, 5) import the filesystem into iSH.

The whole process including the commands is described here:
https://github.com/ish-app/ish/wiki/Transferring-filesystems-between-iSH-and-Docker

The Docker daemon indeed does not start on iSH, hence the workaround.

PS The glibc works but the iSH App may not support all software, for example, Calibre and Stata produce illegal instructions, see the list of issues (but both work well on a non-iOS device inside a Docker container). Illegal instructions are tbodt's domain :-)

PSS Builds in Docker are faster than builds in the iSH App. For example, if you wish to say rebuild ffmpeg, I recommend the former.

@grassjelly
Copy link

grassjelly commented Sep 27, 2021

This is a working solution: https://hub.docker.com/r/econcz/x86-alpine-glibc
I managed to install Miniconda3 and Stata 15 IC (32-bit) on this image in Docker, both are working.

Hey @econcz Thanks for sharing the docker file. I'm trying to install miniconda following this instruction on the README https://github.com/ish-app/ish/wiki/Transferring-filesystems-between-iSH-and-Docker and this docker file https://github.com/Docker-Hub-frolvlad/docker-alpine-miniconda3/blob/master/Dockerfile but I'm getting an error miniconda.sh: line 353: /home/conda/conda.exe: No such file or directory .

Just wondering if you happen to have a docker file available on how to install miniconda ? Thank you!

@econcz
Copy link

econcz commented Oct 3, 2021

This is a working solution: https://hub.docker.com/r/econcz/x86-alpine-glibc
I managed to install Miniconda3 and Stata 15 IC (32-bit) on this image in Docker, both are working.

Hey @econcz Thanks for sharing the docker file. I'm trying to install miniconda following this instruction on the README https://github.com/ish-app/ish/wiki/Transferring-filesystems-between-iSH-and-Docker and this docker file https://github.com/Docker-Hub-frolvlad/docker-alpine-miniconda3/blob/master/Dockerfile but I'm getting an error miniconda.sh: line 353: /home/conda/conda.exe: No such file or directory .

Just wondering if you happen to have a docker file available on how to install miniconda ? Thank you!

Hi! You need to alter the miniconda.sh script somewhere in the beginning where it checks for the system type. Since the script doesn't recognize Alpine as a Linux system (only Debian, Ubuntu, Arch Linux etc. are supported), it thinks you're on Windows (I remember running into this problem as well).
Personally, I wasn't able to run Miniconda 3 on iSH: the conda command produced illegal instructions (I guess the iSH's i686 emulation is not the same as a physical i686, ergo not all software is supported). But Miniconda 3 will work in Docker on a physical machine if you wish to run it there.
There's a variety of iOS and possibly Android apps which support Jupyter with C-based modules (mostly, numpy, pandas, scikits etc.) that you can check out. I asked the Juno's developer to add R to his App, he promised to work on it.

@grassjelly
Copy link

Thanks @econcz . I managed to install miniconda by using an older version (4.5.12) but encountered similar Illegal Instruction errors. Guess gotta have to wait until this issue gets fixed. Thank you!

@econcz
Copy link

econcz commented Oct 3, 2021

I updated my post, please check the last sentence. Juno is a nice app. So is Carnets.

@econcz
Copy link

econcz commented Jun 27, 2022

Updated iSH glibc to 3.14
https://hub.docker.com/r/econcz/x86-alpine-glibc/tags

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

6 participants