-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exit when compiling library build with RustlerPrecompiled on OTP 23 (NIF version 2.14) #23
Comments
@whatyouhide this is unfortunate :/ I think this might be a bug with this OTP version on systems with musl - I tested with a Debian container and it works fine. I will try to debug this later today. |
Ah @philss, that's great to know that this is not an isolated issue. Thanks for investigating 💟 |
@whatyouhide I made some progress in the debugging, but I couldn't find the root cause yet. What I found:
My hypothesis is that something in the build step of the Erlang image broke the load of NIFs for that OTP version. But I'm not sure if this is correct, because the build for version 24 is identical. I'm going to try building from source with that Dockerfile, but without stripping the binaries. |
Building from scratch does not help. It still have a segfault. But at least I could get more details about the error.
Perhaps the machine/container that is compiling the NIF (at GitHub Actions CI server) is generating an outdated structure, or something like that. Tomorrow I will try to test releasing the NIF with another container. |
That's awesome @philss, thank you so much for investigating. I will have a little bit more time over the weekend to dedicate to this, so let me know how things will be looking by then! 💟 |
@whatyouhide I found the problem! It was a missing configuration for I totally missed the section about passing down environment variables. We need the I'm going to update the docs and send PRs to the projects using |
This is important because `cross` don't have access by default to the env vars in the system. This is related to philss/rustler_precompiled#23
This is important because `cross` don't have access by default to the env vars in the system. This is related to philss/rustler_precompiled#23
This is important because `cross` don't have access by default to the env vars in the system. This is related to philss/rustler_precompiled#23
This is important because `cross` don't have access by default to the env vars in the system. This is related to philss/rustler_precompiled#23
This is important because `cross` don't have access by default to the env vars in the system. This is related to philss/rustler_precompiled#23
Aaaaah, that's fantastic! Great catch. And thanks for the PR to nimble_lz4 💟 |
This is important because `cross` don't have access by default to the env vars in the system. This is related to philss/rustler_precompiled#23
This is important because `cross` don't have access by default to the env vars in the system. This is related to philss/rustler_precompiled#23
This change is necessary in order to use the correct version of NIF for the target that is being built with `cross`. By default, `cross` won´t pass down the env vars from the host machine. See philss/rustler_precompiled#23 for further details.
This is important because `cross` don't have access by default to the env vars of the system. This is related to philss/rustler_precompiled#23
This is important because `cross` don't have access by default to the env vars of the system. This is related to philss/rustler_precompiled#23
It's me, again! After dealing with #21, I’m now left with a problem that seems a bit harder to debug.
I’m trying to use nimble_lz4 (the library I built with rustler_precompiled) as a dependency. I can't get it to compile in an Alpine container.
The smallest case I could reproduce is with this Dockerfile:
and this
reproduce_bug.exs
file:The Docker build exits with exit code 139, which is usually segmentation fault. The output of the Docker build is in the details below.
Output of the Docker build
Interestingly enough, this seems to work if I bump the OTP version (using the
hexpm/elixir:1.13.4-erlang-24.2-alpine-3.14.2
Docker image). Is this a bug in OTP, or is something going on with RustlerPrecompiled as far as you can tell?The text was updated successfully, but these errors were encountered: