maintainer-feedback requested: [Bug 264046] lang/elixir-devel: doesn't produce self-contained mix releases

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 17 May 2022 16:01:43 UTC
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-erlang (Nobody)
<erlang@FreeBSD.org> for maintainer-feedback:
Bug 264046: lang/elixir-devel: doesn't produce self-contained mix releases
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264046



--- Description ---
Problem: lang/elixir-devel produces mix releases that require an Erlang runtime
to be installed. This occurs because it patches the `elixir` startup script to
replace ERTS_BIN. It specifies a path that's hard-coded to a file in the
lang/erlang-runtime* that was used to build elixir, as described in
https://lists.freebsd.org/archives/freebsd-erlang/2022-May/000629.html

---

Goal: Build a mix release, and then run it on a FreeBSD system with no Erlang
or Elixir runtime.

From mix release docs:
https://hexdocs.pm/mix/Mix.Tasks.Release.html#module-why-releases

> Self-contained. A release does not require the source code to be included in
your production artifacts. All of the code is precompiled and packaged.
Releases do not even require Erlang or Elixir in your servers, as it includes
the Erlang VM and its runtime by default. Furthermore, both Erlang and Elixir
standard libraries are stripped to bring only the parts you are actually using.

In other words, you should be able to:

pkg install -y elixir-devel
mix new my_app
cd my_app && mix release
pkg remove -y elixir-devel
pkg autoremove -y
./_build/dev/rel/my_app/bin/my_app start_iex

---

What happens: `exec: /usr/local/lib/erlang24/bin/erl: not found`

What should happen: an IEX console