Closed saleyn closed 8 years ago
Can you upgrade to the latest rebar3 (3.1.1) and rebar3_hex plugin (2.5.1) and try again? This should be fixed.
How do you determine the version of a local rebar3_hex
? The path ~/.cache/rebar3/plugins/rebar3_hex
doesn't seem to have git history.
Right, it isn't a git repo. I see that rebar3 plugins list
does not include the versions... that is something we need to change in rebar3
. For now you have to look in ~/.cache/rebar3/plugins/rebar3_hex/ebin/rebar3_hex.app
Yes, that was a version issue. Removed ~/.cache/rebar3/plugins/
, rebuilt rebar3
, and the issue went away.
You can also upgrade global plugins without removing them by doing rebar3 as global plugins upgrade
Thanks for the tip.
I'm seeing the same type of error, using OTP 19.0, rebar3 vs 3.2.0 and rebar3_hex_plugin vsn 2.5.1:
uwpro:plain_fsm uwiger$ rebar3 hex publish
===> Fetching rebar3_hex ({pkg,<<"rebar3_hex">>,<<"2.5.1">>})
===> Downloaded package, caching at /Users/uwiger/.cache/rebar3/hex/default/packages/rebar3_hex-2.5.1.tar
===> Compiling rebar3_hex
===> Verifying dependencies...
Publishing plain_fsm 1.1
Description: Plain_fsm library
Dependencies:
Included files:
/Users/uwiger/uw/me/plain_fsm/LICENSE
/Users/uwiger/uw/me/plain_fsm/NOTICE
/Users/uwiger/uw/me/plain_fsm/README.md
/Users/uwiger/uw/me/plain_fsm/include/plain_fsm.hrl
/Users/uwiger/uw/me/plain_fsm/rebar.config
/Users/uwiger/uw/me/plain_fsm/rebar.lock
/Users/uwiger/uw/me/plain_fsm/src/fsm_example.erl
/Users/uwiger/uw/me/plain_fsm/src/plain_fsm.app.src
/Users/uwiger/uw/me/plain_fsm/src/plain_fsm.erl
/Users/uwiger/uw/me/plain_fsm/src/plain_fsm_xform.erl
Maintainers:
Ulf Wiger
Licenses: Apache 2.0
Links:
Github: https://github.com/uwiger/plain_fsm
Build tools: rebar3
Before publishing, please read Hex CoC: https://hex.pm/docs/codeofconduct
Proceed? ("Y")> Y
escript: exception error: no function clause matching
rebar3_hex_pkg:errors_to_string(#{<<"version">> => <<"expected type Elixir.HexWeb.Version">>}) (/Users/uwiger/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_pkg.erl, line 220)
in function rebar3_hex_pkg:format_error/1 (/Users/uwiger/.cache/rebar3/plugins/rebar3_hex/src/rebar3_hex_pkg.erl, line 59)
in call from rebar3:handle_error/1 (/Users/uwiger/git/rebar3/_build/default/lib/rebar/src/rebar3.erl, line 280)
in call from escript:run/2 (escript.erl, line 757)
in call from escript:start/1 (escript.erl, line 277)
in call from init:start_em/1
in call from init:do_boot/3
uwpro:plain_fsm uwiger$ rebar3 version
rebar 3.2.0 on Erlang/OTP 19 Erts 8.0
@uwiger that is a different error, i've not seen that issue before. Seems the Hex backend can't parse the version.
@ericmj ?
The version is "1.1". It should follow semver and be "1.1.0".
Ouch! That's harsh! ;-) The error indication from the plugin could perhaps be improved, but I'll be sure to fix the version. Thanks.
Yea, I need it to handle that error and print a proper error message to the user. Thanks
Another problem (didn't think of it at first): 1.1 wasn't the latest version!
uwpro:plain_fsm uwiger$ git describe --abbrev
1.4
How is the version determined?
Hmm, n.m., I think I may have messed up there...
Aargh! The confusing part was:
uwpro:plain_fsm uwiger$ rm -rf _build
uwpro:plain_fsm uwiger$ rebar3 compile
===> Verifying dependencies...
===> Compiling plain_fsm
uwpro:plain_fsm uwiger$ grep vsn _build/default/lib/plain_fsm/ebin/plain_fsm.app
{vsn,"1.4.0"},
uwpro:plain_fsm uwiger$ rebar3 hex publish
===> Verifying dependencies...
Publishing plain_fsm 1.1
Description: Plain_fsm library
...
uwpro:plain_fsm uwiger$ git log --oneline --no-walk --tags --decorate
972e8ab (HEAD, tag: 1.4.0, tag: 1.4, origin/uw-appsrc-vsn, uw-appsrc-vsn) change hard-coded vsn in .app.src
7777f30 (tag: 1.3) Merge pull request #11 from uwiger/uw-doc-profile
d2d0c30 (tag: 1.2) Merge pull request #10 from uwiger/uw-hex-attributes
57cd15a (tag: 1.1, origin/uw-cleanup-and-copyright, uw-cleanup-and-copyright) ws cleanup + copyright fix
7c1d0bc (tag: 1.0) added virtual function, plain_fsm:current_function()
So where did the "1.1" version come from?
It was (wrongly) hard-coded in the old .app.src, and there happened to be an old plain_fsm/ebin/plain_fsm.app
on the local disk, built using rebar 2 earlier. Apparently, the hex publish picked that up, even though rebar3 compile
managed to sort it out. I recall the warnings about unpredictable consequences of having a top level ebin when using rebar3...
Removing the local ebin/ fixed the problem and (using semver versioning) publish worked.
I am getting the following error when trying to publish a hex package:
What is the cause of it? The "requirements" clause doesn't seem to be well documented here. Could you make this error report more "user-friendly"?