koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.26k stars 162 forks source link

Installation on Termux #242

Closed xigoi closed 2 years ago

xigoi commented 2 years ago

This is probably more of a Termux issue than a Koka issue, but I'm putting it here in case someone knows the solution.

I'd like to install Koka in Termux so I can play around with it on my phone. The build script worked after I did the following modifications:

However, I can't execute the produced executable. It's giving the "No such file or directory" error.

CaramelFur commented 2 years ago

Hi, cool that you got it to even build. May I ask what build system you used? (stack, cabal or minbuild). And could you post the complete error output of the produced executable?

xigoi commented 2 years ago

I used the install.sh script. Unfortunately, I didn't manage to install Stack, so I can't build from source.

❯ koka
bash: /data/data/com.termux/files/usr/bin/koka: No such file or directory

❯ readelf -l /data/data/com.termux/files/usr/bin/koka | grep interpreter
      [Requesting program interpreter: /lib/ld-linux-aarch64.so.1]
CaramelFur commented 2 years ago

I looks like it cant find find the program interpreter, as android doesn't store its ld in /lib. Maybe there is a way to redirect this location, but im pretty sure it wil only hit more problems after that.

You could otherwise try building koka from scratch using the ./util/minbuild.sh script, as ghc is available for termux. You could even try and build cabal inside termux and use that build koka.