rebar3



Build better Erlang.

Ask A Question

Questions

2
ANSWERED

options for custom plugin from rebar3

Hi, I am writing a rebar3 plugin which will use WIX library to package a OTP release into MSI my application rebar.config (using erlpkg as plugin): ```erlang {profiles, [ {prod, [ {erlpkg_opts, [{company, "Some Company"}, {upgradecode, "ABCDEFGHIJKL1234567890"}]}, {plugins, [{erlpkg, {git, "https://github.com/.../erlpkg.git", {branch, "rebar3"}}}]}, {relx, [{dev_mode, false}]} ]} ]}. ``` erlpkg interface is like: ```sh $ DEBUG=1 rebar3 as prod help erlpkg ===> Expanded command sequence to be run: [{default,as}] ===> Expanded command sequence to be run: [{default,help}] Windows MSI and Linux RPM installer packager for erlang Usage: rebar3 erlpkg [-c <company>] [-u <upgradecode>] -c, --company Name of the company -u, --upgradecode UUID of the product ``` `rebar_state:command_parsed_args(State)` isn't getting the args from rebar.config: $ DEBUG=1 rebar3 as prod erlpkg I could, however, pass them through command line: ```sh $ DEBUG=1 rebar3 as prod erlpkg -c "SomeCompany" -u "ABCDEFGH123456" ===> Expanded command sequence to be run: [{default,as}] ===> Expanded command sequence to be run: [{default,app_discovery}, {default,erlpkg}] ===> Not adding provider default erlpkg from module erlpkg_prv because it already exists from module erlpkg_prv ===> Not adding provider default erlpkg from module erlpkg_prv because it already exists from module erlpkg_prv ===> [erlpkg_prv:50] OTP "19.3", ARCH "win32", WORD "64" profile prod Root "C:/projects/git/dderl" ReleaseDir "c:/proj/_build/prod/rel" Args {[{company,"SomeCompany"},{upgradecode,"ABCDEFGH123456"}],[]} rebar_api:console() ===> rebar_api:info() ===> rebar_api:warn() ===> rebar_api:error() ===> [erlpkg_prv:56] debug ``` What am I doing wrong?

Posted by Bikram Chatterjee 2 years ago

6

Systemd service unable to start erlang service and doesn't say anything

My systemd service is - [Unit] Description=ccs-core Wants=ccs-media [Service] Type=forking TimeoutStartSec=0 User=ccsapp Group=users Environment=CCS_HOME=/opt/ccs ExecStart=/opt/ccs/core/bin/core start ExecStop= /opt/ccs/core/bin/core stop [Install] WantedBy=multi-user.target Starting and stopping from command line works fine - ccsapp@parrot:~> core start ccsapp@parrot:~> core ping pong ccsapp@parrot:~> core stop ok ccsapp@parrot:~> core ping Node core@parrot not responding to pings. However, when I try to start and stop using systemd - ccsapp@parrot:~> sudo service ccs-core start root's password: ccsapp@parrot:~> sudo service ccs-core status ccs-core.service - ccs-core Loaded: loaded (/etc/systemd/system/ccs-core.service; enabled) Active: failed (Result: exit-code) since Sun 2017-02-19 18:22:12 IST; 3s ago Process: 6734 ExecStop=/opt/ccs/core/bin/core stop (code=exited, status=1/FAILURE) Process: 6707 ExecStart=/opt/ccs/core/bin/core start (code=exited, status=0/SUCCESS) Main PID: 6732 (code=exited, status=0/SUCCESS) Feb 19 18:22:12 parrot core[6780]: Starting up ccsapp@parrot:~> core ping Node core@parrot not responding to pings. And the log says nothing - run_erl [6736] Sun Feb 19 18:22:12 2017 Args before exec of shell: run_erl [6736] Sun Feb 19 18:22:12 2017 argv[0] = sh run_erl [6736] Sun Feb 19 18:22:12 2017 argv[1] = -c run_erl [6736] Sun Feb 19 18:22:12 2017 argv[2] = exec "/opt/ccs/core/bin/core" "console" and ===== ===== LOGGING STARTED Sun Feb 19 17:48:30 IST 2017 ===== Exec: /opt/ccs/core/erts-8.2/bin/erlexec -boot /opt/ccs/core/releases/6.0.0/start -mode embedded -boot_var ERTS_LIB_DIR /opt/ccs/core/erts-8.2/../lib -config /opt/ccs/core/releases/6.0.0/sys.config -args_file /opt/ccs/core/releases/6.0.0/vm.args -- console^M Root: /opt/ccs/core^M /opt/ccs/core

Posted by Chaitanya Chalasani 2 years ago

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