rebar3



Build better Erlang.

Ask A Question

Questions

4

Failing to publish an hex package thanks to rebar3

Hi, I have an Erlang/OTP library application / release (namely myriad, i.e. https://github.com/Olivier-Boudeville/Ceylan-Myriad) that I try to integrate as an hex package thanks to rebar3. I tried to follow the guidelines in https://www.rebar3.org/docs/publishing-packages and https://www.rebar3.org/docs/hex-package-management but with not much luck. I have an account at hex.pm and tried to set up everything properly (outputs edited so that real info are replaced with MY_* placeholders): $ rebar3 hex user whoami hexpm : MY_HEX_LOGIN (MY_EMAIL_ADDRESS) (looks ok) $ rebar3 hex key list ===> Fetching rebar3_hex v6.7.0 ===> Version cached at /home/MY_USER/.cache/rebar3/hex/hexpm/packages/rebar3_hex-6.7.0.tar is up to date, reusing it ===> Fetching hex_core v0.5.0 ===> Version cached at /home/MY_USER/.cache/rebar3/hex/hexpm/packages/hex_core-0.5.0.tar is up to date, reusing it ===> Fetching verl v1.0.1 ===> Version cached at /home/MY_USER/.cache/rebar3/hex/hexpm/packages/verl-1.0.1.tar is up to date, reusing it ===> Compiling verl ===> Compiling hex_core ===> Compiling rebar3_hex Name Created MY_COMPUTER 2019-07-14T14:39:40Z MY_COMPUTER-api-read 2019-07-14T14:39:40Z MY_COMPUTER-repositories 2019-07-14T14:39:40Z (looks ok) $ rebar3 hex owner list myriad $ rebar3 hex owner add myriad MY_EMAIL_ADDRESS Local Password: $ rebar3 hex owner list myriad (so: still nothing) $ rebar3 hex publish ===> Verifying dependencies... Select application(s): ------------ A) All [1-0] or (A)ll ("A")> (no clear what to enter; I tried nothing, A, "A", etc.), it just stops just after I hit Enter (no output, no error, return code is 0). If I enter 0 or 1 instead: $ rebar3 hex publish ===> Verifying dependencies... Select application(s): ------------ A) All [1-0] or (A)ll ("A")> 0 ===> 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"` With more details: $ DEBUG=1 rebar3 hex publish ===> Load global config file /home/MY_USER/.config/rebar3/rebar.config ===> 22.0 satisfies the requirement for MY_COMPUTERmum OTP version 18 ===> 22.0 satisfies the requirement for MY_COMPUTERmum OTP version 18 ===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user ===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut ===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key ===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner ===> Not adding provider hex repo from module rebar3_hex_repo because it already exists from module rebar3_hex_repo ===> Not adding provider hex docs from module rebar3_hex_docs because it already exists from module rebar3_hex_docs ===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search ===> Not adding provider hex revert from module rebar3_hex_revert because it already exists from module rebar3_hex_revert ===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire ===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish ===> Expanded command sequence to be run: [] ===> Provider: {default,do} ===> Expanded command sequence to be run: [{default,app_discovery}, {default,install_deps}, {default,lock}, {hex,publish}] ===> Provider: {default,app_discovery} ===> Provider: {default,install_deps} ===> Verifying dependencies... ===> Provider: {default,lock} ===> Provider: {hex,publish} Select application(s): ------------ A) All [1-0] or (A)ll ("A")> A So: $ rebar3 report hex publish Rebar3 report version 3.11.1+build.4421.ref76935555 generated at 2019-07-19T06:40:53+00:00 ================= Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any) ----------------- Task: hexpublish Entered as: hexpublish ----------------- Operating System: x86_64-unknown-linux-gnu ERTS: Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] Root Directory: /home/MY_USER/Software/Erlang/Erlang-22.0/lib/erlang Library directory: /home/MY_USER/Software/Erlang/Erlang-22.0/lib/erlang/lib ----------------- Loaded Applications: bbmustache: 1.6.1 certifi: 2.5.1 cf: 0.2.2 common_test: 1.17.3 compiler: 7.4 crypto: 4.5 cth_readable: 1.4.5 dialyzer: 4.0 edoc: 0.11 erlware_commons: 1.3.1 eunit: 2.3.7 eunit_formatters: 0.5.0 getopt: 1.0.1 hipe: 3.19 inets: 7.0.8 kernel: 6.4 providers: 1.8.1 public_key: 1.6.7 relx: 3.32.1 sasl: 3.4 snmp: 5.3 ssl_verify_fun: 1.1.5 stdlib: 3.9 syntax_tools: 2.2 tools: 3.2 ----------------- Escript path: /usr/local/bin/rebar3 Providers: app_discovery as clean compile compile cover ct cut deps dialyzer do docs edoc escriptize eunit get-deps help install install_deps key list lock new owner path pkgs publish release relup repo report repos retire revert search shell state tar tree unlock update upgrade upgrade upgrade user version xref Any help appreciated! Thanks in advance, Best regards, Olivier. PS: By the way, the 'info' command (mentioned in https://www.rebar3.org/docs/hex-package-management) does not seem to exist: $ rebar3 hex info ===> Fetching rebar3_hex v6.7.0 ===> Version cached at /home/MY_USER/.cache/rebar3/hex/hexpm/packages/rebar3_hex-6.7.0.tar is up to date, reusing it ===> Fetching hex_core v0.5.0 ===> Version cached at /home/MY_USER/.cache/rebar3/hex/hexpm/packages/hex_core-0.5.0.tar is up to date, reusing it ===> Fetching verl v1.0.1 ===> Version cached at /home/MY_USER/.cache/rebar3/hex/hexpm/packages/verl-1.0.1.tar is up to date, reusing it ===> Compiling verl ===> Compiling hex_core ===> Compiling rebar3_hex ===> Command info not found in namespace hex

Posted by Olivier Boudeville 2 months ago

2

rebar3 run crashes, why is that?

### ./src/helloerlang_app.erl ``` %%%------------------------------------------------------------------- %% @doc helloerlang public API %% @end %%%------------------------------------------------------------------- -module(helloerlang_app). -behaviour(application). %% Application callbacks -export([start/2, stop/1, routes/0]). %%==================================================================== %% API %%==================================================================== start(_StartType, _StartArgs) -> Dispatch = cowboy_router:compile([&#123;'_', routes() &#125;]), ok = case cowboy:start_http( helloerlang_http_listener, 100, [&#123;port, 4000&#125;], [&#123;env, [&#123;dispatch, Dispatch&#125;]&#125;]) of &#123;ok, _&#125; -> ok; &#123;error, &#123;already_started, _&#125;&#125; -> ok; &#123;error, _&#125; = Error -> Error end, helloerlang_sup:start_link(). %% helloerlang_sup:start_link(). %%-------------------------------------------------------------------- stop(_State) -> ok. %%==================================================================== %% Internal functions %%==================================================================== routes() -> [ &#123;"/", cowboy_static, &#123;priv_file, helloerlang, "index.html"&#125;&#125; ]. ``` ### ./rebar.config: ``` &#123;erl_opts, [debug_info]&#125;. &#123;deps, [ cowboy ]&#125;. &#123;shell, [ % &#123;config, "config/sys.config"&#125; &#123;apps, [helloerlang]&#125; ]&#125;. &#123;relx, [&#123;release, &#123; local, "0.1.0" &#125;, [helloerlang]&#125;, &#123;dev_mode, true&#125;, &#123;extended_start_script, true&#125;] &#125;. &#123;plugins, [ rebar3_run ]&#125;. ``` ### ./priv_file/index.html ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <p>Test rebar page </p> </body> </html> ``` $ rebar3 compile ===> Verifying dependencies... ===> Compiling helloerlang then $ rebar3 run ===> Verifying dependencies... ===> Compiling helloerlang ===> Starting relx build process ... ===> Resolving OTP Applications from directories: /Users/mincheung/idea_projects/helloerlang/_build/default/lib /usr/local/Cellar/erlang/21.2.2/lib/erlang/lib /Users/mincheung/idea_projects/helloerlang/_build/default/rel ===> Resolved local-0.1.0 ===> Dev mode enabled, release will be symlinked ===> Including Erts from /usr/local/Cellar/erlang/21.2.2/lib/erlang ===> release successfully created! Exec: /Users/mincheung/idea_projects/helloerlang/_build/default/rel/local/erts-10.2.1/bin/erlexec -boot /Users/mincheung/idea_projects/helloerlang/_build/default/rel/local/releases/0.1.0/local -mode embedded -boot_var ERTS_LIB_DIR /Users/mincheung/idea_projects/helloerlang/_build/default/rel/local/lib -config /Users/mincheung/idea_projects/helloerlang/_build/default/rel/local/releases/0.1.0/sys.config -args_file /Users/mincheung/idea_projects/helloerlang/_build/default/rel/local/releases/0.1.0/vm.args -pa -- console Root: /Users/mincheung/idea_projects/helloerlang/_build/default/rel/local /Users/mincheung/idea_projects/helloerlang/_build/default/rel/local Erlang/OTP 21 [erts-10.2.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace] =CRASH REPORT==== 12-Jan-2019::05:42:21.587864 === crasher: initial call: application_master:init/4 pid: <0.229.0> registered_name: [] exception exit: &#123;bad_return, &#123;&#123;helloerlang_app,start,[normal,[]]&#125;, &#123;'EXIT', &#123;undef, [&#123;cowboy_router,compile, [[&#123;'_', [&#123;"/",cowboy_static, &#123;priv_file,helloerlang,"index.html"&#125;&#125;]&#125;]], []&#125;, &#123;helloerlang_app,start,2, [&#123;file, "/Users/mincheung/idea_projects/helloerlang/src/helloerlang_app.erl"&#125;, &#123;line,18&#125;]&#125;, &#123;application_master,start_it_old,4, [&#123;file,"application_master.erl"&#125;,&#123;line,277&#125;]&#125;]&#125;&#125;&#125;&#125; in function application_master:init/4 (application_master.erl, line 138) ancestors: [<0.228.0>] message_queue_len: 1 messages: [&#123;'EXIT',<0.230.0>,normal&#125;] links: [<0.228.0>,<0.190.0>] dictionary: [] trap_exit: true status: running heap_size: 610 stack_size: 27 reductions: 234 neighbours: =INFO REPORT==== 12-Jan-2019::05:42:21.590625 === application: helloerlang exited: &#123;bad_return, &#123;&#123;helloerlang_app,start,[normal,[]]&#125;, &#123;'EXIT', &#123;undef, [&#123;cowboy_router,compile, [[&#123;'_', [&#123;"/",cowboy_static, &#123;priv_file,helloerlang,"index.html"&#125;&#125;]&#125;]], []&#125;, &#123;helloerlang_app,start,2, [&#123;file, "/Users/mincheung/idea_projects/helloerlang/src/helloerlang_app.erl"&#125;, &#123;line,18&#125;]&#125;, &#123;application_master,start_it_old,4, [&#123;file,"application_master.erl"&#125;,&#123;line,277&#125;]&#125;]&#125;&#125;&#125;&#125; type: permanent Eshell V10.2.1 (abort with ^G) (local@Mins-MBP)1> &#123;"Kernel pid terminated",application_controller,"&#123;application_start_failure,helloerlang,&#123;bad_return,&#123;&#123;helloerlang_app,start,[normal,[]]&#125;,&#123;'EXIT',&#123;undef,[&#123;cowboy_router,compile,[[&#123;'_',[&#123;\"/\",cowboy_static,&#123;priv_file,helloerlang,\"index.html\"&#125;&#125;]&#125;]],[]&#125;,&#123;helloerlang_app,start,2,[&#123;file,\"/Users/mincheung/idea_projects/helloerlang/src/helloerlang_app.erl\"&#125;,&#123;line,18&#125;]&#125;,&#123;application_master,start_it_old,4,[&#123;file,\"application_master.erl\"&#125;,&#123;line,277&#125;]&#125;]&#125;&#125;&#125;&#125;&#125;"&#125; Kernel pid terminated (application_controller) (&#123;application_start_failure,helloerlang,&#123;bad_return,&#123;&#123;helloerlang_app,start,[normal,[]]&#125;,&#123;'EXIT',&#123;undef,[&#123;cowboy_router,compile,[[&#123;'_',[&#123;"/",cowboy_stati Crash dump is being written to: erl_crash.dump...done

Posted by Sebastian Cheung 9 months ago