haskell / ghcup-hs

https://www.haskell.org/ghcup/
GNU Lesser General Public License v3.0
288 stars 89 forks source link

Termux/Android platform support. #938

Open dhuux opened 11 months ago

dhuux commented 11 months ago

now with help of glibc for termux project we can run most of linux AArch64 binaries on Termux. no need for them to be linked against the bionic libc to work on Termux. i hope you to support termux as a distribution. i can still setup these tools manually but i would like to use ghcup for that.

Screenshot_20231121-221207_Termux

thanks.

dhuux commented 11 months ago

from the guide i found out that i can modify the distro detection with the config.yaml file. but how do i tell it to fetch the Linux aarch64 tarball instead of the x86_64 one?

Screenshot_20231122-011304_Termux

hasufell commented 11 months ago
platform-override:
  arch: A_ARM64
  platform:
    contents: Ubuntu
    tag: Linux
  version: '18.04'
dhuux commented 11 months ago

@hasufell thanks. it worked!

hasufell commented 11 months ago

Omg, ghcup is amazing!

dhuux commented 11 months ago

@hasufell of course it's 🥰

dhuux commented 11 months ago

hi @hasufell there is a new problem. Ghcup installs Stack and Cabal fine. but when Ghc is downloaded and installed, it tries to run Ghc-pkg check or something (before i point the binaries to the right rpath and linker) and deletes the whole thing when it can't run it because it marks the elf files as corrupted or maybe that is not what is happening. i don't know. i'm new to programmimg. i'm just tying to get used to the terminal and setting up tools before i start learning programming.

some screenshots

20231122_110438

Screenshot_20231122-093630_Termux

hasufell commented 11 months ago

The log is truncated. Pastebin the contents of ~/.ghcup/logs/ghc-make.log after running the failed command.

dhuux commented 11 months ago

The log is truncated. Pastebin the contents of ~/.ghcup/logs/ghc-make.log after running the failed command.

sorry! i messed with ghcup. the log files are gone. i will try to download it again though my internet (Somalia) is slow during the days. but wait! are there any hardcoded paths into the ghcup binary? what does that line mean? 20231122_112228

i'm not running in proot /bin/sh doesn't exist in termux. i'm running these tools natively on termux.

or maybe it exists. i didn't know that android's /bin/sh can be used. lol

hasufell commented 11 months ago

I need the full logs

dhuux commented 11 months ago

i don't know what Pastebin is but i googled and past it there

i don't know if this is the right place.

hasufell commented 11 months ago

Looks like a dynamic library is missing

/bin/sh: /data/data/com.termux/files/home/.ghcup/tmp/ghcup-a03ca67b8436bf86/data/data/com.termux/files/home/.ghcup/ghc/9.4.7/lib/ghc-9.4.7/bin/ghc-pkg: No such file or directory

Did you install the pre-requisites?

https://www.haskell.org/ghcup/install/#linux-ubuntu

dhuux commented 11 months ago

Looks like a dynamic library is missing

/bin/sh: /data/data/com.termux/files/home/.ghcup/tmp/ghcup-a03ca67b8436bf86/data/data/com.termux/files/home/.ghcup/ghc/9.4.7/lib/ghc-9.4.7/bin/ghc-pkg: No such file or directory

Did you install the pre-requisites?

https://www.haskell.org/ghcup/install/#linux-ubuntu

i think yes. because i already tested the linux aarch64 prebuilt binaries from here. i just didn't wanna do it manually.

look at my fist screenshot. it wouldn't work if its depencies were not satisfied. but the problem here is before the binaries work, i need to link them against the right dynamic linker/loader. and i think this: /bin/ghc-pkg: No such file or directory is an elf binary pointing to the wrong dynamic loader. ghcup tries to test it and when it fails it regards it as non-existent and deletes the whole thing. or what lib do you think is missing here?

hasufell commented 11 months ago

@bgamari ideas on how to make installation work?