hexpm / hex

Package manager for the Erlang ecosystem.
https://hex.pm
961 stars 184 forks source link

Reject unknown keys when calling deps.get #1024

Closed srcrip closed 2 months ago

srcrip commented 2 months ago

Hello there,

I encountered a weird problem recently. I was trying to put together a demo for one of my hex packages, and in my demo package I referenced it like this:

{:my_package, dir: "../my_package"}

I just assumed that the right key I wanted was dir. Of course it was actually supposed to be path.

The problem is this appeared like it worked at first glance. It did actually copy that folder into my deps folder. But nothing worked quite right. I would change something in the other directory and it wouldn't reflect in the other project.

I've been told online that apparently dir is an unknown key, and mix is just falling back to some kind of fallback behavior. I think it'd probably be a good idea if an entry with no known key threw some kind of an error.

Hopefully this is the right place for this issue and not the Elixir repo, but I wasn't sure.

Also there's some context about this here: https://x.com/wojtekmach/status/1789360660263870680

wojtekmach commented 2 months ago

Closing in favour of PR.