Closed SteffenDE closed 9 months ago
When compiling I noticed this message that's probably related:
Failed to load nif: {:load_failed, ~c"Failed to load NIF library: '/Users/steffen/my_app/_build/dev/lib/hnswlib/priv/hnswlib_nif.so: cannot open shared object file: No such file or directory'"}
Maybe also related: downloading the precompiled library for aarch64 from the releases page and running file on it:
~> file Downloads/hnswlib_nif.so
Downloads/hnswlib_nif.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=08ff4b3114562a1f769b48d52d78b4f77c5b3ae7, not stripped
It says x86-64
instead of something like aarch64
.
Is there a way to force local compilation?
Hi @SteffenDE, thank you very much for reporting this issue! There was a mistake in precompiling this library, and it should be addressed in #14.
However, we don't have a simple way to enforce a local build for this library at the moment. Yet it's possible to do it in a relatively complex way: download the source of this library, append -dev
to its version string, and use it as a path dependency in my_app
.
I still had this issue just now. Doing the -dev thing worked for me but what ninja-move do I need to do to get me back on a release or has the fix not been cut into a release quite yet? :)
It is in progress, v0.1.3 will be out soon!
v0.1.3 is out now. It should fix the issue 😀
Great!
So... This is a very weird issue I'm encountering, but I narrowed it down to this hnswlib library.
If I create a new empty elixir project using
mix new my_app
, then add a dockerfile:I build the app using
docker build -t test .
anddocker run --rm -it test start_iex
. This works.Next, I add hsnwlib to the deps:
{:hnswlib, "~> 0.1.2"}
, then build and run the image again using the same commands as above. The release does not start any more, the iex shell never appears.This issue does not occur on a linux host (amd64), I only encounter it on macOS (M1 Pro) using https://github.com/abiosoft/colima for running docker containers.