Coder Social home page Coder Social logo

Hex publish issue about rebar3_hex HOT 14 CLOSED

erlef avatar erlef commented on August 15, 2024
Hex publish issue

from rebar3_hex.

Comments (14)

tsloughter avatar tsloughter commented on August 15, 2024 1

You can also upgrade global plugins without removing them by doing rebar3 as global plugins upgrade

from rebar3_hex.

tsloughter avatar tsloughter commented on August 15, 2024

Can you upgrade to the latest rebar3 (3.1.1) and rebar3_hex plugin (2.5.1) and try again? This should be fixed.

from rebar3_hex.

saleyn avatar saleyn commented on August 15, 2024

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.

from rebar3_hex.

tsloughter avatar tsloughter commented on August 15, 2024

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

from rebar3_hex.

saleyn avatar saleyn commented on August 15, 2024

Yes, that was a version issue. Removed ~/.cache/rebar3/plugins/, rebuilt rebar3, and the issue went away.

from rebar3_hex.

saleyn avatar saleyn commented on August 15, 2024

Thanks for the tip.

from rebar3_hex.

uwiger avatar uwiger commented on August 15, 2024

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

from rebar3_hex.

tsloughter avatar tsloughter commented on August 15, 2024

@uwiger that is a different error, i've not seen that issue before. Seems the Hex backend can't parse the version.

@ericmj ?

from rebar3_hex.

ericmj avatar ericmj commented on August 15, 2024

The version is "1.1". It should follow semver and be "1.1.0".

from rebar3_hex.

uwiger avatar uwiger commented on August 15, 2024

Ouch! That's harsh! ;-)
The error indication from the plugin could perhaps be improved, but I'll be sure to fix the version. Thanks.

from rebar3_hex.

tsloughter avatar tsloughter commented on August 15, 2024

Yea, I need it to handle that error and print a proper error message to the user. Thanks

from rebar3_hex.

uwiger avatar uwiger commented on August 15, 2024

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?

from rebar3_hex.

uwiger avatar uwiger commented on August 15, 2024

Hmm, n.m., I think I may have messed up there...

from rebar3_hex.

uwiger avatar uwiger commented on August 15, 2024

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.

from rebar3_hex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.