Usage of escript to run rebar was added to Makefile.in
when support for rebar2 was added in 4d8f770 for ejabberd 13.10.
Nowadays this seems unnecessary, and configure.ac right now can
determine what binary to use: the sysmte installed or local one.
Previously, preparing translations required rebar3 and:
./configure --enable-tools
make
make translations
With this change it works with rebar3 and mix, just running:
./configure
make translations
This allows to use REBAR_PROFILE to add another profile.
Right now it doesn't seem specially useful, but it's possible:
REBAR_PROFILE=dev make prod
REBAR_PROFILE=translations make dev
https://rebar3.org/docs/configuration/profiles/
Rebar2 could create a release, so it made sense to call it "make rel".
Nowadays, Rebar3 and Mix support creating different types of releases:
production, development, ...
In this sense, our "make rel" target is more properly named "make prod"
For backwards compatibility, "make rel" redirects to "make prod"
The problem appeared when:
./configure --with-rebar=mix
make install
ejabberdctl live
=INFO REPORT==== 19-Dec-2023::21:28:36.006306 ===
application: ssl
exited: stopped
type: temporary
...
Since Erlang/OTP 26, Dialyzer by default reports unknown types.
ejabberd's type specs refer to the re:mp() type,
but that isn't exported in the OTP source code,
and cannot be used in any other modules.
This commit provides very dirty workarounds, and any cleaner
alternative is very welcomed.
Prepare with:
./autogen.sh && ./configure --with-rebar=./rebar3 && make
Or use this if you installed Elixir:
./autogen.sh && ./configure --with-rebar=mix && make
Start without installing (it recompiles when necessary):
make relive
It stores config, database and logs in _build/relive/
There's available the well-known script:
_build/relive/ejabberdctl
Please note this fails immediately:
r3:do(compile).
This crashes a few seconds later:
rebar3:run(["compile"]).
Workaround that works correctly:
ejabberd_admin:update().
Flock'ing /var/lock/ejabberdctl by ejabberdctl was removed with
f7d4aae64d ("Use UUID for ctl node name (#1021)"), however the
according recipies in the Makefile where never removed. This commit
does that.
Notice that Elixir 1.12.0 requires Erlang/OTP 21 or higher
BTW, this workaround works only with rebar2... unfortunately
rebar3 doesn't compile the elixir files from lib/