EMQ X 可以根据https://github.com/emqx/emqx-rel#build-with-elixir-plugins使用基于 Elixir 的插件进行构建。但是,它没有编译并抛出以下错误
➜ make
ln -snf _build/emqx/lib ./_checkouts
EMQX_DESC="EMQ X Broker" /Users/XXXXX/Programs/emqx-rel/rebar3 as emqx release
===> Compiling rebar_mix
===> Compiling _build/default/plugins/rebar_mix/src/rebar_mix_builder.erl failed
_build/default/plugins/rebar_mix/src/rebar_mix_builder.erl:none: undefined parse transform 'mod_vsn'
===> Plugin rebar_mix not available. It will not be used.
===> Compiling rebar3_elixir_compile
===> Compiling _build/default/plugins/rebar_mix/src/rebar_mix_hook.erl failed
_build/default/plugins/rebar_mix/src/rebar_mix_hook.erl:none: undefined parse transform 'mod_vsn'
===> Plugin {rebar3_elixir_compile,
{git,
"https://github.com/barrel-db/rebar3_elixir_compile.git",
{branch,"master"}}} not available. It will not be used.
===> Compiling relup_helper
===> Compiling _build/default/plugins/rebar_mix/src/rebar_mix_elixir_finder_hook.erl failed
_build/default/plugins/rebar_mix/src/rebar_mix_elixir_finder_hook.erl:none: undefined parse transform 'mod_vsn'
===> Plugin {relup_helper,{git,"https://github.com/emqx/relup_helper",
{branch,"master"}}} not available. It will not be used.
===> Compiling pc
===> Compiling _build/default/plugins/rebar_mix/src/rebar_mix.erl failed
_build/default/plugins/rebar_mix/src/rebar_mix.erl:none: undefined parse transform 'mod_vsn'
===> Plugin {pc,{git,"https://github.com/emqx/port_compiler.git",
{tag,"v1.11.1"}}} not available. It will not be used.
===> Compiling rebar3_run
===> Plugin {rebar3_run,{git,"https://github.com/emqx/rebar3_run",
{tag,"0.2.3"}}} not available. It will not be used.
and rebar.config diff from the latest emqx-rel's master
diff --git a/rebar.config b/rebar.config
index 81fd886..571b07b 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,5 +1,7 @@
%% NOTE: Order of the deps matters!
-{elixir_deps, []}.
+{elixir_deps, [
+ {emq_elixir_plugin, {git, "git@github.com:emqx/emqx-elixir-plugin.git", {branch, "master"}}}
+]}.
{deps,
[emqx,
@@ -113,11 +115,14 @@
{template,"{{output_dir}}/../../lib/emqx/etc/{{vm_args_file}}","etc/vm.args"},
{copy, "{{output_dir}}/../../lib/emqx/etc/certs","etc/"},
{copy, "{{output_dir}}/../../lib/cuttlefish/cuttlefish","bin/"},
- {copy, "{{output_dir}}/../../lib/cuttlefish/cuttlefish","bin/cuttlefish-{{rel_vsn}}"}
+ {copy, "{{output_dir}}/../../lib/cuttlefish/cuttlefish","bin/cuttlefish-{{rel_vsn}}",
+ {copy, "{{base_dir}}/consolidated", "releases/{{rel_vsn}}/consolidated"}}
]}
]}.
-{elixir_relx_apps, []}.
+{elixir_relx_apps, [
+ {emq_elixir_plugin, load}
+]}.
{edge_relx_apps, []}.
和rebar.config
最新emqx-rel
的不同master
diff --git a/rebar.config b/rebar.config
index 81fd886..571b07b 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,5 +1,7 @@
%% NOTE: Order of the deps matters!
-{elixir_deps, []}.
+{elixir_deps, [
+ {emq_elixir_plugin, {git, "git@github.com:emqx/emqx-elixir-plugin.git", {branch, "master"}}}
+]}.
{deps,
[emqx,
@@ -113,11 +115,14 @@
{template,"{{output_dir}}/../../lib/emqx/etc/{{vm_args_file}}","etc/vm.args"},
{copy, "{{output_dir}}/../../lib/emqx/etc/certs","etc/"},
{copy, "{{output_dir}}/../../lib/cuttlefish/cuttlefish","bin/"},
- {copy, "{{output_dir}}/../../lib/cuttlefish/cuttlefish","bin/cuttlefish-{{rel_vsn}}"}
+ {copy, "{{output_dir}}/../../lib/cuttlefish/cuttlefish","bin/cuttlefish-{{rel_vsn}}",
+ {copy, "{{base_dir}}/consolidated", "releases/{{rel_vsn}}/consolidated"}}
]}
]}.
-{elixir_relx_apps, []}.
+{elixir_relx_apps, [
+ {emq_elixir_plugin, load}
+]}.
{edge_relx_apps, []}.
➜ erl
Erlang/OTP 23 [erts-11.1.7] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe] [dtrace]
Eshell V11.1.7 (abort with ^G)
1>
➜ rebar3 -v
rebar 3.14.3 on Erlang/OTP 23 Erts 11.1.7
➜ iex -v
Erlang/OTP 23 [erts-11.1.7] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe] [dtrace]
IEx 1.11.3 (compiled with Erlang/OTP 23)