# Help: \`make install\` fails on Termux

**URL:** https://racket.discourse.group/t/help-make-install-fails-on-termux/934
**Category:** Questions & Answers
**Tags:** question
**Created:** [April 28, 2022, 11:27am UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934 "2022-04-28T11:27:12Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![spore](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/spore/32/513_2.png) [@spore](https://racket.discourse.group/u/spore)
#### Post date: [April 28, 2022, 11:27am UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/1 "2022-04-28T11:27:12Z")

</div>

I'm trying to compile Racket 8.4(cs) on my Android phone with Termux, because the version provided in their repo is too old (7.4 bc).

I used `./configure --prefix=$PREFIX` and it seems good, `make` also succeeded with no errors.  
Everything went well until I reached `make install` part, where it fails:

```scheme
make[4]: Entering directory '/data/data/com.termux/files/home/downloads/racket-8.4/src/cs/c'
/data/data/com.termux/files/usr/bin/racket -Z ../../../../../build/config -X "/data/data/com.termux/files/usr/share/racket/collects" -G "/data/data/com.termux/files/usr/etc/racket" -Z ../../../../../build/config -N "raco" -l- setup --no-user
ffi-lib: could not load foreign library
  path: [all opened]
  system error: unknown error
  context...:
   /data/data/com.termux/files/usr/share/racket/collects/ffi/unsafe.rkt:249:2: get-ffi-obj*
   body of "/data/data/com.termux/files/usr/share/racket/collects/net/win32-ssl.rkt"
   body of "/data/data/com.termux/files/usr/share/racket/collects/setup/main.rkt"
make[4]: *** [Makefile:500: do-setup-install] Error 1

```

Both minimal and full packages fail at the same place with this confusing error.  
I also tried snapshot build, which errors even earlier at the beginning of `make` part.

Is there anything I can do in order to solve this?

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/spdegabrielle/32/95_2.png) [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)
#### Post date: [April 28, 2022, 11:07pm UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/2 "2022-04-28T23:07:06Z")

</div>

Hi @spore  
I’m sorry I don’t have an answer but have you tried a bc build? I’m just guessing from the text of your error message and the last time I saw this it was on bc.  
Let us know how you get on.  
Best regards  
Stephen

---

<div class="post-metadata">

### Author: ![spore](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/spore/32/513_2.png) [@spore](https://racket.discourse.group/u/spore)
#### Post date: [April 29, 2022, 2:56am UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/3 "2022-04-29T02:56:57Z")

</div>

I've tried BC and the only thing I can remember now is that it also failed...

Edit: Ok I will try it again and record the output.  
Commands:

```scheme
./configure --prefix=$PREFIX --enable-bconly
make
make install

```

And it failed at (roughly) the same place, giving output:

```scheme
make[2]: Entering directory '/data/data/com.termux/files/home/downloads/racket-8.4/src/bc'
./racket3m -X "/data/data/com.termux/files/usr/share/racket/collects" -G "/data/data/com.termux/files/usr/etc/racket" -Z ../../../../build/config --no-user-path -N "raco" -l- setup --no-user
ffi-lib: couldn't open #f (unknown error)
   context...:
    /data/data/com.termux/files/usr/share/racket/collects/ffi/unsafe.rkt:131:0: get-ffi-lib
make[2]: *** [Makefile:476: install-setup-3m] Error 1

```

Which is equally confusing and not giving any additional information...

---

<div class="post-metadata">

### Author: ![spdegabrielle](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/spdegabrielle/32/95_2.png) [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)
#### Post date: [April 29, 2022, 11:05am UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/4 "2022-04-29T11:05:47Z")

</div>

Sorry that wasn’t much help. I think someone on the discord was using tmux on Android but it was a year ago at least. Might be worth asking on there.

---

<div class="post-metadata">

### Author: ![SamB](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samb/32/692_2.png) [@SamB](https://racket.discourse.group/u/SamB)
#### Post date: [August 24, 2022, 5:02pm UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/5 "2022-08-24T17:02:17Z")

</div>

I've been getting basically that same error trying to build 8.6 minimal on android with the default configuration:

Same function, same modules on the stack, no clue why we're trying to use `win32-ssl.rkt` on Android because the stacktrace just blames module bodies for the calls???

---

<div class="post-metadata">

### Author: ![samth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samth/32/3_2.png) [@samth](https://racket.discourse.group/u/samth)
#### Post date: [August 24, 2022, 5:53pm UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/6 "2022-08-24T17:53:45Z")

</div>

`raco setup` loads various pieces of code, which includes `net/git-checkout` which eventually depends on `net/win32-ssl.rkt`. The relevant code isn't inside any functions so it wouldn't have anything more in the stack trace.

The most likely thing that could go wrong here is that `system-type` is producing the wrong value. Can you try running the racket binary on that command line and seeing what it produces for `(system-type)`?

---

<div class="post-metadata">

### Author: ![SamB](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samb/32/692_2.png) [@SamB](https://racket.discourse.group/u/SamB)
#### Post date: [August 25, 2022, 12:45am UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/7 "2022-08-25T00:45:09Z")

</div>

> `raco setup` loads various pieces of code, which includes `net/git-checkout` which eventually depends on `net/win32-ssl.rkt`. The relevant code isn't inside any functions so it wouldn't have anything more in the stack trace.

I mean, those frames might be sensible, but line numbers sure would be handy. (I suppose it would be a bit much to hope for a debugger at this point during startup, but I can dream ...)

> The most likely thing that could go wrong here is that `system-type` is producing the wrong value. Can you try running the racket binary on that command line and seeing what it produces for `(system-type)`?

```scheme
~/.../src/build $ /data/data/com.termux/files/home/racket-8.6/bin/racket -I racket/kernel/init
Welcome to Racket v8.6 [cs].
> (system-type)
'unix

```

If I understand correctly, in this particular context, get-ffi-obj\* is being asked to build functions that will (given that we don't have a secur32.dll) fail when they are called.

It really doesn't look like the function has been called yet ...

---

<div class="post-metadata">

### Author: ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)
#### Post date: [August 25, 2022, 9:05am UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/8 "2022-08-25T09:05:17Z")

</div>

Tangentially, does Termux provide a `/bin/sh`, or is the shell at `/system/bin/sh`?

---

<div class="post-metadata">

### Author: ![samth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samth/32/3_2.png) [@samth](https://racket.discourse.group/u/samth)
#### Post date: [August 25, 2022, 2:08pm UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/9 "2022-08-25T14:08:21Z")

</div>

Right, it looks like what's going on is that trying to define ffi bindings to symbols that are not found is erroring. Can you try this program?

```scheme
#lang racket/base

(require ffi/unsafe ffi/unsafe/define ffi/winapi)

(define-ffi-definer define-secur32 #f
  #:default-make-fail make-not-available)

(define-secur32 InitSecurityInterfaceW
  (_fun #:abi winapi -> _pointer))

```

---

<div class="post-metadata">

### Author: ![SamPhillips](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samphillips/32/15_2.png) [@SamPhillips](https://racket.discourse.group/u/SamPhillips)
#### Post date: [September 3, 2022, 3:04am UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934/10 "2022-09-03T03:04:56Z")

</div>

I'm able to reproduce on Termux. For your program I'm getting:

```scheme
ffi-lib: could not load foreign library
  path: [all opened]
  system error: unknown error
  context...:
   /data/data/com.termux/files/home/build/racket-8.6/collects/ffi/unsafe.rkt:249:2: get-ffi-obj*
   body of "/data/data/com.termux/files/home/build/racket-8.6/src/build/foo.rkt"

```

Also attempting to just load `malloc` I get the same:

```scheme
Welcome to Racket v8.6 [cs].
> (require ffi/unsafe ffi/unsafe/define)
> (define-ffi-definer define-libc #f)
> (define-libc malloc (_fun _uint -> _pointer))
ffi-lib: could not load foreign library
  path: [all opened]
  system error: unknown error
  context...:
   body of top-level
   /data/data/com.termux/files/home/build/racket-8.6/collects/ffi/unsafe.rkt:249:2: get-ffi-obj*
   /data/data/com.termux/files/home/build/racket-8.6/collects/racket/repl.rkt:11:26

```
