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:
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?
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
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???
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)?
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)?
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 ...
I'm able to reproduce on Termux. For your program I'm getting:
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:
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