build: check mnesia compatibility when generating mria config

This commit is contained in:
Zaiming (Stone) Shi 2023-05-04 15:22:49 +02:00
parent c4da84f0be
commit ed0d0b9787
1 changed files with 14 additions and 3 deletions

17
dev
View File

@ -206,10 +206,21 @@ make_erlang_args() {
} }
call_hocon() { call_hocon() {
local args erl_code
args="$(make_erlang_args "$@")" args="$(make_erlang_args "$@")"
erl -noshell \ erl_code="
-eval "{ok, _} = application:ensure_all_started(hocon), \ {ok, _} = application:ensure_all_started(hocon), \
ok = hocon_cli:main([$args]), init:stop()." try
mnesia_hook:module_info()
catch _:_->
io:format(standard_error, \"Force setting DB backend to 'mnesia', and 'role' to 'core'~n\", []),
os:putenv(\"EMQX_NODE__DB_BACKEND\", \"mnesia\"),
os:putenv(\"EMQX_NODE__DB_ROLE\", \"core\")
end,
ok = hocon_cli:main([$args]),
init:stop().
"
erl -noshell -eval "$erl_code"
} }
# Function to generate app.config and vm.args # Function to generate app.config and vm.args