Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 May 2022 14:16:53 +0000
From:      "Dave Cottlehuber" <dch@skunkwerks.at>
To:        "Pat Maddox" <pat@patmaddox.com>, erlang <freebsd-erlang@FreeBSD.org>
Subject:   Re: package mix release works, port doesn't? (and neither is self-contained)
Message-ID:  <d2915f8a-2280-4c23-a251-645f1efd0185@www.fastmail.com>
In-Reply-To: <A20A5B06-676E-4AF8-940A-3992194B1E80@patmaddox.com>
References:  <42EA9771-2440-49D3-BEFA-05A888F8D90A@patmaddox.com> <A20A5B06-676E-4AF8-940A-3992194B1E80@patmaddox.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 4 May 2022, at 11:16, Pat Maddox wrote:
> On 4 May 2022, at 4:06, Pat Maddox wrote:
>
>> So my questions are:
>>
>> 1. What is going on with poudriere that=E2=80=99s different, where th=
e=20
>> package runs fine but the built port crashes?

probably PATH yielding different erlang/elixir versions; these will
have *slightly* different version numbers of OTP libraries, and
the system then can't start up as the located ERTS has differing
versions of the expected libraries. Hard to tell from those errors.

>> 2. How do I fix it?

- ensure your path is clean ;-)
- do your prod release with erts included
- prepend /usr/local/lib/$APP/erts-$VERSION/bin

>> 3. Why do the package and port require an erlang runtime to run, if=20
>> I=E2=80=99m using mix release?
>
> Of course after being stuck on this for a couple hours, I answered the=20
> first two questions just a few minutes after posting: the=20
> erlang-runtime24 dependency was getting installed via normal FreeBSD=20
> package source, rather than my poudriere built version. So it was a=20
> version mismatch between the build dependency and run dependency.
>
> I still don=E2=80=99t understand why I need an erlang runtime at all t=
hough,=20
> after the mix release has been built.
>
> Pat

you don't; whether erts is bundled in the release is defined in your
mix release config. I'm assuming your ExAmple app picks up whatever
the default is, see the hello app for an appropriate example.

https://hexdocs.pm/mix/Mix.Tasks.Release.html
&=20
https://github.com/skunkwerks/hello/blob/master/rel/config.exs#L33

I've tried both approaches in the past, and now I always bundle
erts within the application.

You do need to run the epmd daemon somewhere, this is easily
enough done via including lang/erlang as a package dependency,
or via your CI/CD deployment tools, and starting the epmd service
that is provided on FreeBSD.

I suggest taking a close look through build.sh, app.sh and the rc.d
wrapper in the hello app above, each of the lines there deals
with all these nasty little issues.

A+
Dave



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d2915f8a-2280-4c23-a251-645f1efd0185>