EMQ X Broker 可以使用 Elixir 插件吗?

问题描述

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,"https://github.com/emqx/relup_helper","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,"https://github.com/emqx/port_compiler.git",{tag,"v1.11.1"}}} not available. It will not be used.
===> Compiling rebar3_run
===> Plugin {rebar3_run,"https://github.com/emqx/rebar3_run","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@github.com:emqx/emqx-elixir-plugin.git","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/"},"{{output_dir}}/../../lib/cuttlefish/cuttlefish","bin/"},-    {copy,"bin/cuttlefish-{{rel_vsn}}"}
+    {copy,"bin/cuttlefish-{{rel_vsn}}",+       {copy,"{{base_dir}}/consolidated","releases/{{rel_vsn}}/consolidated"}}
    ]}
  ]}.
 
-{elixir_relx_apps,[]}.
+{elixir_relx_apps,load}
+]}.
 
 {edge_relx_apps,[]}.

rebar.config 与最新的 emqx-relmaster

不同
diff --git a/rebar.config b/rebar.config
index 81fd886..571b07b 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,[]}.
 
➜ 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)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)