Skip to content

Issue with 0.6.3 aarch64-linux precompiled nif #109

@whitedr

Description

@whitedr

I'm hitting an issue in which the symptom is very similar to what is described here. Namely that after building a docker image for my app and trying to run it with {:adbc, "0.6.3"} as a dependency, the app seems to "hang" at startup. If I Ctrl-C it and look at the proc info, I see this:

0x0000fffebc794ff0 Return addr 0x0000ffff66db5004 (io:put_chars/2 + 188)
y(0)     []
y(1)     [standard_io,[<<"Failed to load nif: {:load_failed, ~c\"Failed to load NIF library: '/app/lib/adbc-0.6.3/priv/adbc_nif.so: cannot open shared object file: No such file or directory'\"}">>,10]]
y(2)     #Ref<0.200537568.2251816962.111287>

More details on my local setup and docker environment...

As mentioned, the app is pulling in {:adbc, "0.6.3"}. This app is built in a docker image which is using hexpm/elixir:1.17.3-erlang-26.2.5.5-debian-bookworm-20241016-slim as the base/builder image and then using debian:bookworm-20241016-slim as the runtime image in a multi-stage Dockerfile. My local dev environment is an M3 mac. I also see the following when I build the docker image:

#32 47.78 ==> adbc
#32 47.78 Downloading precompiled NIF to /root/.cache/adbc-nif-2.16-aarch64-linux-gnu-0.6.3.tar.gz
#32 48.32 Compiling 9 files (.ex)
#32 48.35 Failed to load nif: {:load_failed, ~c"Failed to load NIF library: '/app/_build/prod/lib/adbc/priv/adbc_nif.so: cannot open shared object file: No such file or directory'"}

The build however continues after this and completes successfully. When I then run a container (bash into it) with this image, I see that the file does in fact exist at the path in question above. If I try to inspect the adbc_nif.so file with ldd I get this however:

nobody@852c36390f15:/app$ ldd -v /app/lib/adbc-0.6.3/priv/adbc_nif.so 
        not a dynamic executable

So it seems like the precompiled lib adbc-nif-2.16-aarch64-linux-gnu-0.6.3.tar.gz that was downloaded is the wrong arch (or something else is wrong with it).

If I revert the version of adbc to {:adbc, "0.6.2"} and build again, I see that it compiles the lib (which I believe is expected as there isn't a precompiled archive available for aarch64-linux prior to 0.6.3) and the app runs fine with the compiled 0.6.2 version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions