From a2ff5fbfdb5529aaf5e16a477bf8c1ec4bf6584c Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 8 Jan 2024 14:54:10 +0100 Subject: [PATCH] Add observer and runtime_tools in releases when --enable-tools When --enable-tools, include observer and runtime_tools in the OTP releases, as they are required by "ejabberdctl etop". With this fix, "ejabberdctl etop" works correctly when: * rebar3 + make rel * mix + make dev * mix + make rel --- .github/workflows/runtime.yml | 1 + configure.ac | 2 +- mix.exs | 4 +++- src/ejabberd.app.src.script | 6 +++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index cc0e20c54..0409bd2f6 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml @@ -68,6 +68,7 @@ jobs: --prefix=/tmp/ejabberd \ --enable-all \ --disable-elixir \ + --disable-tools \ --disable-odbc make update make diff --git a/configure.ac b/configure.ac index fcc0ee71d..e0ffc0e47 100644 --- a/configure.ac +++ b/configure.ac @@ -254,7 +254,7 @@ AC_ARG_ENABLE(system_deps, esac],[if test "x$system_deps" = "x"; then system_deps=false; fi]) AC_ARG_ENABLE(tools, -[AS_HELP_STRING([--enable-tools],[build development tools (default: no)])], +[AS_HELP_STRING([--enable-tools],[build development tools: ejabberd-po, etop (default: no)])], [case "${enableval}" in yes) tools=true ;; no) tools=false ;; diff --git a/mix.exs b/mix.exs index d11a6854a..8227791b9 100644 --- a/mix.exs +++ b/mix.exs @@ -145,7 +145,9 @@ defmodule Ejabberd.MixProject do end defp cond_apps do - for {:true, app} <- [{config(:stun), :stun}], do: + for {:true, app} <- [{config(:stun), :stun}, + {config(:tools), :observer}, + {config(:tools), :runtime_tools}], do: app end diff --git a/src/ejabberd.app.src.script b/src/ejabberd.app.src.script index 82048c4e0..83a639095 100644 --- a/src/ejabberd.app.src.script +++ b/src/ejabberd.app.src.script @@ -6,10 +6,14 @@ {elixir, true} -> [elixir, iex, logger, mix]; _ -> [] end, + Tools = case lists:keyfind(tools, 1, Terms) of + {tools, true} -> [observer, runtime_tools]; % for `ejabberdctl etop` + _ -> [] + end, {[lists:keyfind(description, 1, Terms), lists:keyfind(vsn, 1, Terms), {env, [{enabled_backends, EBs}]} - ], Elixirs}; + ], Elixirs ++ Tools}; _Err -> {[], []} end,