Open meppu opened 1 year ago
Yep, this error is coming from https://github.com/erlang/rebar3/blob/cc0c1a944b08f94e735673d6a386e263a89171e1/apps/rebar/src/rebar3.erl#L399-L416 where we have an explicit check to know if your install contains all the required and visible apps for rebar3 to run.
This means that whatever install you have with the apps either isn't configuring the lib to be in the path, or isn't containing them.
Did this ever work before or is this a first time thing?
"It works on my machine" 😂
But as i said it also works on container when i use podman/docker exec
. The problem is it doesn't work when i use it with erlang:open_port
while it is running on container.
And i useElixir container, based on official Erlang container. So there should be no issues (since i can compile my project with it) but i also made a containerfile based on debian sid (unstable) repositories but it still gives same error.
FROM docker.io/elixir:1.14 AS builder
WORKDIR /app
COPY . .
RUN rebar3 get-deps
RUN rebar3 compile
RUN rebar3 as prod release
FROM docker.io/debian:unstable
# Install Deps
RUN apt-get update && apt-get install -y wget
RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
RUN dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
RUN apt-get install -y libodbc1 libsctp1
# Install Elixir + Erlang
RUN apt-get install -y elixir erlang rebar3 erlang-inets
# Prepare Mix
RUN mix local.hex --force
RUN mix local.rebar --force
# Copy Release
COPY --from=builder /app/_build/prod/rel/erland /release/erland
ENTRYPOINT [ "/release/erland/bin/erland" ]
The issue is when i run it with erlang:open_port
while it is running in container, rebar3 is failing for any command.
Also setting DEBUG=1
environments doesn't give any information about it.
The issue is likely the use of the debian erlang
package. Better to use an Erlang docker image, asdf/kerl or the Erlang Solutions debian repos.
The issue is likely the use of the debian
erlang
package. Better to use an Erlang docker image, asdf/kerl or the Erlang Solutions debian repos.
Erlang docker image is also not working.
Ill publish an example rebar3 app to show issue now.
Well, for some reason when i add inets
to the applications, it worked. But i have no idea why it is working now. Can someone explain me what is related between inets
and erlang:open_port
?
Oh so if it's building fine that's one thing.
But when you build a release, Rebar3 makes sure to only include the apps you need and request. So if you were somehow:
then you would find yourself in a situation where you're using a minimal release's Erlang where inets was purposefully omitted by the tooling. So specifying inets to be there as well will make it work again, but you might still not be using the global install you thought you did?
Yeah it still gives erl_include error when i need to run renar3 release inside of erlang app via open_port
. But i also want to know why when i run rebar3
it doesn't uses the global installation.
Is there any way to just run shell command without these issues? I also need to get output information real-time.
I'm not quite sure. The escript rebar3 runs will use whatever Erlang is closest in path based on the priorities.
If the error you see with rebar3 also happens with the basic 'erl' command, you know that's the problem. If it does not happen with 'erl' then something quite odd is going on.
I was trying to setup Dockerfile for my application but this application also creates some Erlang scripts at runtime with Rebar3. The issue is when i execute
rebar3 new escript <name>
at runtime, it gives me following error:But the thing is I can use rebar3 in Docker:
But not in application:
This is the current part of the Dockerfile (Elixir image is based on Erlang image):
I tried installing
erlang-dev
,erlang-inets
etc... And they didn't work.