rebar3



Build better Erlang.

Ask A Question

Questions

7

Error compiling dependency that can be compiled by itself

I'm trying to compile a module that uses the new xmpp library for ejabberd. I've a very simple `rebar.config` file: {deps, [ {xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.1.4"}}} ]}. When I try to run `rebar3 eunit` or `rebar3 compile` I get an error message: $ rebar3 compile ===> Verifying dependencies... ===> Fetching xmpp ({git,"https://github.com/processone/xmpp", {ref,"c010141487632db1666bcbf64f90f42c0fde50aa"}}) ===> Fetching rebar3_hex ({pkg,<<"rebar3_hex">>,<<"3.1.0">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/rebar3_hex-3.1.0.tar ===> Compiling rebar3_hex ===> Fetching fast_xml ({pkg,<<"fast_xml">>,<<"1.1.18">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/fast_xml-1.1.18.tar ===> Fetching pc ({pkg,<<"pc">>,<<"1.4.0">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/pc-1.4.0.tar ===> Compiling pc ===> Fetching stringprep ({pkg,<<"stringprep">>,<<"1.0.7">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/stringprep-1.0.7.tar ===> Fetching p1_utils ({pkg,<<"p1_utils">>,<<"1.0.6">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/p1_utils-1.0.6.tar ===> Compiling p1_utils ===> Compiling fast_xml ===> Compiling /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/fast_xml/c_src/fxml.c ===> Compiling /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/fast_xml/c_src/fxml_stream.c ===> Linking /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/fast_xml/priv/lib/fxml.so ===> Linking /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/fast_xml/priv/lib/fxml_stream.so ===> Compiling stringprep ===> Compiling /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/stringprep/c_src/stringprep.cpp ===> Linking /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/stringprep/priv/lib/stringprep.so ===> Compiling xmpp ===> Compiling _build/default/lib/xmpp/src/xmpp_util.erl failed _build/default/lib/xmpp/include/xmpp.hrl:29: can't find include file "fxml.hrl" However, when I compile this module separately, it works: $ cd _build/default/lib/xmpp $ rebar3 compile ===> Fetching rebar3_hex ({pkg,<<"rebar3_hex">>,<<"3.1.0">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/rebar3_hex-3.1.0.tar ===> Compiling rebar3_hex ===> Verifying dependencies... ===> Fetching fast_xml ({pkg,<<"fast_xml">>,<<"1.1.18">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/fast_xml-1.1.18.tar ===> Fetching pc ({pkg,<<"pc">>,<<"1.4.0">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/pc-1.4.0.tar ===> Compiling pc ===> Fetching stringprep ({pkg,<<"stringprep">>,<<"1.0.7">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/stringprep-1.0.7.tar ===> Fetching p1_utils ({pkg,<<"p1_utils">>,<<"1.0.6">>}) ===> Downloaded package, caching at /Users/marcp/.cache/rebar3/hex/default/packages/p1_utils-1.0.6.tar ===> Skipping p1_utils (from {pkg,<<"p1_utils">>,<<"1.0.6">>, <<"EF0951DDF38E92B7E479AF4B8DC950DF76AF8C1030432EF68B7FD7AD17C436FE">>}) as an app of the same name has already been fetched ===> Compiling p1_utils ===> Compiling fast_xml ===> Compiling /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/xmpp/_build/default/lib/fast_xml/c_src/fxml.c ===> Compiling /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/xmpp/_build/default/lib/fast_xml/c_src/fxml_stream.c ===> Linking /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/xmpp/_build/default/lib/fast_xml/priv/lib/fxml.so ===> Linking /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/xmpp/_build/default/lib/fast_xml/priv/lib/fxml_stream.so ===> Compiling stringprep ===> Compiling /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/xmpp/_build/default/lib/stringprep/c_src/stringprep.cpp ===> Linking /Users/marcp/Desktop/erlang-test/myapp/_build/default/lib/xmpp/_build/default/lib/stringprep/priv/lib/stringprep.so ===> Compiling xmpp How can I find out what's going on? Is the `rebar.config.script` of the xmpp library to blame?

Posted by Marc Philipp 2 years ago

3
ANSWERED

rebar3_erlydtl_plugin compile fails the second time

When I run './rebar3 compile' the command fails the second time with the following message: ``` ===> Verifying dependencies... ===> Compiling nifty ===> Running erlydtl... ===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump ===> When submitting a bug report, please include the output of `rebar3 report "your command"` ``` The first time everything seems to work as expected. If I remove the '_build' folder the compile command works again. The crashdump file contains: ``` Error: undef [{rebar_utils,find_files_by_ext, ["/home/thegeorge/projects/nifty/priv/templates",".tpl",false], []}, {rebar_base_compiler,run,8, [{file,"/home/thegeorge/projects/nifty/_build/default/lib/rebar/src/rebar_base_compiler.erl"}, {line,69}]}, {rebar3_erlydtl_plugin,'-do/1-lc$^0/1-0-',1, [{file,"/home/thegeorge/projects/nifty/_build/default/plugins/rebar3_erlydtl_plugin/src/rebar3_erlydtl_plugin.erl"}, {line,143}]}, {rebar3_erlydtl_plugin,do,1, [{file,"/home/thegeorge/projects/nifty/_build/default/plugins/rebar3_erlydtl_plugin/src/rebar3_erlydtl_plugin.erl"}, {line,131}]}, {rebar_core,do,2, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"}, {line,125}]}, {rebar_hooks,run_provider_hooks_,6, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_hooks.erl"}, {line,49}]}, {rebar_hooks,run_all_hooks,6, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_hooks.erl"}, {line,16}]}, {rebar_prv_compile,compile,3, [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_prv_compile.erl"}, {line,119}]}] ``` I use the rebar3_erlydtl_plugin to compile my templates. Best, Andreas

Posted by Andreas Löscher 2 years ago