ghcup-hs icon indicating copy to clipboard operation
ghcup-hs copied to clipboard

Termux/Android platform support.

Open dhuux opened this issue 2 years ago • 13 comments

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 avatar Nov 21 '23 19:11 dhuux

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

dhuux avatar Nov 21 '23 22:11 dhuux

platform-override:
  arch: A_ARM64
  platform:
    contents: Ubuntu
    tag: Linux
  version: '18.04'

hasufell avatar Nov 22 '23 01:11 hasufell

@hasufell thanks. it worked!

dhuux avatar Nov 22 '23 01:11 dhuux

Omg, ghcup is amazing!

hasufell avatar Nov 22 '23 01:11 hasufell

@hasufell of course it's 🥰

dhuux avatar Nov 22 '23 02:11 dhuux

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

dhuux avatar Nov 22 '23 08:11 dhuux

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

hasufell avatar Nov 22 '23 08:11 hasufell

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

dhuux avatar Nov 22 '23 08:11 dhuux

I need the full logs

hasufell avatar Nov 22 '23 08:11 hasufell

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

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

dhuux avatar Nov 22 '23 09:11 dhuux

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

hasufell avatar Nov 22 '23 09:11 hasufell

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?

dhuux avatar Nov 22 '23 09:11 dhuux

@bgamari ideas on how to make installation work?

hasufell avatar Nov 22 '23 09:11 hasufell