erlef / rebar3_hex

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

Dependencies aren't being published #59

Closed waisbrot closed 7 years ago

waisbrot commented 7 years ago

I'm not sure when this broke, but I just noticed that rebar3 hex publish isn't collecting any of the dependencies that are listed in rebar.config and rebar.lock. They are Hex-published dependencies, and it's able to give me an error when I have a non-Hex dependency present.

I haven't had a chance to debug further, yet.

tsloughter commented 7 years ago

Try upgrading your rebar3 hex plugin and rebar3 itself. This is likely the bug that came up when the rebar3 lock file format changed.

waisbrot commented 7 years ago
$ rebar3 plugins upgrade rebar3_hex 
===> Fetching rebar3_hex ({pkg,<<"rebar3_hex">>,<<"3.0.0">>})
===> Downloaded package, caching at /Users/waisbrot/.cache/rebar3/hex/default/packages/rebar3_hex-3.0.0.tar
===> Compiling rebar3_hex
$
$ rebar3 version
rebar 3.3.1 on Erlang/OTP 19 Erts 8.1

If I try to publish https://github.com/WhoopInc/dogstatsde (for example):

$ rebar3 hex publish
===> Verifying dependencies...
Publishing dogstatsde 0.7.1+build.48.ref2b9d338
  Description: Send StatsD metrics to Datadog
  Dependencies:

  Included files:
    /Users/waisbrot/git/dogstatsde/LICENSE
    /Users/waisbrot/git/dogstatsde/README.md
    /Users/waisbrot/git/dogstatsde/mix.exs
    /Users/waisbrot/git/dogstatsde/rebar.config
    /Users/waisbrot/git/dogstatsde/rebar.config.script
    /Users/waisbrot/git/dogstatsde/rebar.lock
    /Users/waisbrot/git/dogstatsde/src/dogstatsd.app.src
    /Users/waisbrot/git/dogstatsde/src/dogstatsd.erl
    /Users/waisbrot/git/dogstatsde/src/dogstatsd_app.erl
    /Users/waisbrot/git/dogstatsde/src/dogstatsd_sup.erl
    /Users/waisbrot/git/dogstatsde/src/dogstatsd_vm_stats.erl
    /Users/waisbrot/git/dogstatsde/src/dogstatsd_worker.erl
  Maintainers:
    Nathaniel Waisbrot <waisbrot@whoop.com>
  Licenses: LAGPL
  Links:
    GitHub: https://github.com/WhoopInc/dogstatsde
  Build tools: rebar3, mix
Before publishing, please read Hex CoC: https://hex.pm/docs/codeofconduct
Proceed? ("Y")> n

But the rebar.config lists as deps

{deps, [
        {worker_pool,   "2.1.0"}
       ,{stillir, "1.0.0"}
       ]}.

I've got a rebar.config.script. Maybe that's a problem? Rebar is fetching the dependencies from Hex for compilation.

tsloughter commented 7 years ago

And to be sure, you don't have the rebar3 hex plugin installed globally? rebar3 plugins list will tell you if you have it twice and it could be using an old version in global.

waisbrot commented 7 years ago

OK, I see that rebar3 plugins upgrade rebar3_hex should have been telling me "No upgrade needed". I had a ~/.cache/rebar3/hex/default/packages/rebar3_hex-3.0.0.tar, but I think Rebar must not have been able to see it or use it.

I deleted my ~/.cache/rebar3 directory and things now work, but that also destroyed all the evidence.

Seeing your update: I tried to configure the Hex plugin to be installed only globally. It's only mentioned in my global rebar.config.

I'm going to close this because I don't think I can give any useful debugging info with the directory wiped.

tsloughter commented 7 years ago

thanks. Sounds like there is a bug that lets global plugins slip into the default profile. To upgrade global plugins you have to do rebar3 as global plugins upgrade rebar3_hex, it should have said 'no such plugin' when doing it without as global.