erlang / rebar3

Erlang build tool that makes it easy to compile and test Erlang applications and releases.
http://www.rebar3.org
Apache License 2.0
1.69k stars 516 forks source link

Improve error message when sub-dependencies are broken #1161

Open waisbrot opened 8 years ago

waisbrot commented 8 years ago

Katana 0.2.18 depends on inaka_mixer 0.1.4, which was removed from Hex (or maybe never existed).

If you build a project and depend on {katana, "0.2.18"}, then you get an error saying that inaka_mixer can't be found. But you don't get informed about who is trying to include inaka_mixer so it's a frustrating problem to debug.

I'd really like it if I got an error along the lines of "inaka_mixer can't be found. It is required by katana, which is required by other_package, which is required by your_application."

Another way of solving this frustration could be to have rebar3 tree work even when dependencies can't be fetched:

└─your_application (project app)
      ├─ some_dep-1.0.0 (hex package)
      └─ other_package-1.0.0 (hex package)
         └─ katana-0.2.18 (hex package)
            └─ inaka_mixer-0.1.4 (MISSING PACKAGE)
ferd commented 8 years ago

To represent the dependency tree, the tree command looks at fetched dependencies (which all link to their parent) in order to know which one took precedence -- this is what allows to figure out, if 5 projects included mylib, which one actually included it.

As such, if a dependency cannot be found, it cannot be part of the tree, since we use the fetched dependencies to build it.

I would instead recommend that people who published the katana package ensure they're publishing working packages in the first place if possible.