erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

Uncaught error (badmatch) when using "rebar3 hex publish" #58

Closed ksallberg closed 4 years ago

ksallberg commented 7 years ago

Appears when using "rebar3 hex publish", when using a .app file in ebin, instead of a .app.src file in src.

kristian@signhild:~/Documents/erlang/brunhilde$ DEBUG=1 rebar3 hex publish
===> Expanded command sequence to be run: []
===> Expanded command sequence to be run: [{default,app_discovery},
{default,install_deps},
{default,lock},
{hex,publish}]
===> Evaluating config script "/home/kristian/Documents/erlang/brunhilde/_build/default/lib/erlydtl/src/erlydtl.app.src.script"
===> Evaluating config script "/home/kristian/Documents/erlang/brunhilde/_build/default/lib/erlydtl/rebar.config.script"
===> Evaluating config script "/home/kristian/Documents/erlang/brunhilde/_build/default/lib/jsx/rebar.config.script"
===> 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 config from module rebar3_hex_config because it already exists from module rebar3_hex_config
===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key
===> Not adding provider hex info from module rebar3_hex_info because it already exists from module rebar3_hex_info
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> 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 publish from module rebar3_hex_pkg because it already exists from module rebar3_hex_pkg
===> 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 config from module rebar3_hex_config because it already exists from module rebar3_hex_config
===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key
===> Not adding provider hex info from module rebar3_hex_info because it already exists from module rebar3_hex_info
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> 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 publish from module rebar3_hex_pkg because it already exists from module rebar3_hex_pkg
===> Verifying dependencies...
===> Evaluating config script "/home/kristian/Documents/erlang/brunhilde/_build/default/lib/erlydtl/src/erlydtl.app.src.script"
===> Evaluating config script "/home/kristian/Documents/erlang/brunhilde/_build/default/lib/erlydtl/src/erlydtl.app.src.script"
===> Upgrading erlydtl ({pkg,<<"erlydtl">>,<<"0.12.1">>})
===> Successfully downloaded https://repo.hex.pm:443/tarballs/erlydtl-0.12.1.tar?
===> Downloaded package, caching at /home/kristian/.cache/rebar3/hex/default/packages/erlydtl-0.12.1.tar
===> Writing {pkg,<<"erlydtl">>,<<"0.12.1">>} to cache at /home/kristian/.cache/rebar3/hex/default/packages/erlydtl-0.12.1.tar
===> Moving checkout "/tmp/.tmp_dir321294108200" to "/home/kristian/Documents/erlang/brunhilde/_build/default/lib/erlydtl"
===> sh info:
cwd: "/home/kristian/Documents/erlang/brunhilde"
cmd: mv /tmp/.tmp_dir321294108200 /home/kristian/Documents/erlang/brunhilde/_build/default/lib/erlydtl

===> opts: [{use_stdout,false},abort_on_error]

===> Port Cmd: mv /tmp/.tmp_dir321294108200 /home/kristian/Documents/erlang/brunhilde/_build/default/lib/erlydtl
Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof]

===> Evaluating config script "/home/kristian/Documents/erlang/brunhilde/build/default/lib/erlydtl/src/erlydtl.app.src.script"
===> Evaluating config script "/home/kristian/Documents/erlang/brunhilde/_build/default/lib/erlydtl/rebar.config.script"
===> Evaluating config script "/home/kristian/Documents/erlang/brunhilde/_build/default/lib/jsx/rebar.config.script"
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace
===> Uncaught error: {badmatch,[]}
===> Stack trace to the error location: [{rebar3_hex_utils,
update_app_src,2,
[{file,
"/home/kristian/Documents/erlang/brunhilde/_build/default/plugins/rebar3_hex/src/rebar3_hex_utils.erl"},
{line,14}]},
{rebar3_hex_pkg,publish,2,
[{file,
"/home/kristian/Documents/erlang/brunhilde/_build/default/plugins/rebar3_hex/src/rebar3_hex_pkg.erl"},
{line,104}]},
{rebar3_hex_pkg,do,2,
[{file,
"/home/kristian/Documents/erlang/brunhilde/_build/default/plugins/rebar3_hex/src/rebar3_hex_pkg.erl"},
{line,79}]},
{lists,foldl,3,
[{file,"lists.erl"},
{line,1263}]},
{rebar_core,do,2,
[{file,
"/home/kristian/Documents/erlang/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
{line,125}]},
{rebar_prv_do,do_tasks,2,
[{file,
"/home/kristian/Documents/erlang/rebar3/_build/default/lib/rebar/src/rebar_prv_do.erl"},
{line,68}]},
{rebar_core,do,2,
[{file,
"/home/kristian/Documents/erlang/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
{line,125}]},
{rebar3,main,1,
[{file,
"/home/kristian/Documents/erlang/rebar3/_build/default/lib/rebar/src/rebar3.erl"},
{line,56}]}]

kristian@signhild:~/Documents/erlang/brunhilde$ rebar3 hex publish
===> Verifying dependencies...
===> Upgrading erlydtl ({pkg,<<"erlydtl">>,<<"0.12.1">>})
===> Downloaded package, caching at /home/kristian/.cache/rebar3/hex/default/packages/erlydtl-0.12.1.tar
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
kristian@signhild:~/Documents/erlang/brunhilde$ rebar3 report hex publish                                                                    
Rebar3 report
 version 3.1.0+build.3402.refcb7c9a4
 generated at 2016-09-26T17:49:17+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 19 [erts-8.0.2] [source-9503fff] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
Root Directory: /usr/lib/erlang
Library directory: /usr/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.0.4
certifi: 0.4.0
cf: 0.2.1
common_test: 1.12.2
compiler: 7.0.1
crypto: 3.7
cth_readable: 1.2.2
dialyzer: 3.0.1
edoc: 0.7.19
erlware_commons: 0.20.0
eunit: 2.3
eunit_formatters: 0.3.1
getopt: 0.8.2
inets: 6.3.1
kernel: 5.0
providers: 1.6.0
public_key: 1.2
relx: 3.19.0
sasl: 3.0
snmp: 5.2.3
ssl_verify_hostname: 1.0.5
stdlib: 3.0.1
syntax_tools: 2.0
tools: 2.8.5

-----------------
Escript path: /home/kristian/Documents/erlang/rebar3/rebar3
Providers:
  app_discovery as clean compile compile config cover ct cut deps dialyzer do docs edoc escriptize eunit help info install install_deps key list lock 
new owner path pkgs publish release relup report search shell state tar tree unlock update upgrade upgrade upgrade user version xref
yurrriq commented 7 years ago

This might be addressed by #61.

starbelly commented 5 years ago

@tsloughter This should definitely be a non-issue now... maybe @ksallberg can confirm.

ksallberg commented 5 years ago

@starbelly I did the following:

1) moved src/application.app.src to ebin/application.src 2) DEBUG=1 rebar3 hex publish

I still get an internal error, but it is failing with a badmatch in other lines.

===> Provider: {default,lock}
===> Provider: {hex,publish}
===> Using deprecated rebar_utils:vcs_vsn/3. Please upgrade your plugins.
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,[]}
===> Stack trace to the error location:
[{rebar3_hex_utils,update_app_src,2,
                   [{file,"/Users/kristiansallberg/Documents/brunhilde/_build/default/plugins/rebar3_hex/src/rebar3_hex_utils.
erl"},
                    {line,111}]},
 {rebar3_hex_publish,publish,3,
                     [{file,"/Users/kristiansallberg/Documents/brunhilde/_build/default/plugins/rebar3_hex/src/rebar3_hex_publ
ish.erl"},
                      {line,122}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
 {rebar_core,do,2,
             [{file,"/private/tmp/rebar3-20190318-95158-1ic6xql/rebar3-3.9.1/src/rebar_core.erl"},
              {line,154}]},
 {rebar_prv_do,do_task,5,
               [{file,"/private/tmp/rebar3-20190318-95158-1ic6xql/rebar3-3.9.1/src/rebar_prv_do.erl"},
                {line,87}]},
 {rebar_core,do,2,
             [{file,"/private/tmp/rebar3-20190318-95158-1ic6xql/rebar3-3.9.1/src/rebar_core.erl"},
              {line,154}]},
 {rebar3,run_aux,2,
         [{file,"/private/tmp/rebar3-20190318-95158-1ic6xql/rebar3-3.9.1/src/rebar3.erl"},
          {line,178}]},
 {rebar3,main,1,
         [{file,"/private/tmp/rebar3-20190318-95158-1ic6xql/rebar3-3.9.1/src/rebar3.erl"},
          {line,66}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"

How can I be sure I have the latest version of rebar3_hex? Do I need a development version? Since I did "git clean -ffxd" in my repo, should the rebar3_hex plugin be downloaded again with a newer version?

starbelly commented 5 years ago

@ksallberg You do not need development. You do need rebar3_hex ver 6.5.0 and the latest version of rebar 3.9.1 I believe

starbelly commented 4 years ago

Closing this issue as I believe it's been resolved, please re-open if you find otherwise.