You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey 👋
as always, thanks for all the great work, that's a pleasure working in Elixir.
That's really a minor issue, but I spent few minutes on it, and therefore I wanted to share it.
First. When a dependency is not found in hex.pm, maybe because misspelled, mix deps.get returns an error with an hint. For example:
❯ mix deps.get
Failed to fetch record for plugxxxxx from registry (using cache instead)
This could be because the package does not exist, it was spelled incorrectly or you don't have permissions to it
** (Mix) No package with name plugxxxxx (from: mix.exs) in registry
While, the same does not happen when a local dependency specified with the option path is not found.
For instance, if this is my mix.exs
defmoduleHello.MixProjectdouseMix.Projectdefprojectdo[app: :hello,version: "0.1.0",elixir: "~> 1.17",start_permanent: Mix.env()==:prod,deps: deps()]end# Run "mix help compile.app" to learn about applications.defapplicationdo[extra_applications: [:logger]]end# Run "mix help deps" to learn about dependencies.defpdepsdo[# Refer to a local dependency that is missing{:other_package,path: "other_package"}]endend
Running mix deps.get just succeed without any error or warning, actually without printing anything in this case that it is the only dep.
Expected behavior
I'd expect a consistent behaviour across the different way to install a dependency.
mix deps.get should error when the specified path is not pointing to any folder in the local file system, or to a folder that is not an elixir library.
Maybe here, it would be enough to check if there is a mix.exs file within the specified path, otherwise raise an error. If you think it is a good idea, I'm happy to open a PR.
Elixir and Erlang/OTP versions
Elixir v 1.17.2
Erlang/OTP 27
Operating system
Mac OS 15.0.1
Current behavior
Hey 👋
as always, thanks for all the great work, that's a pleasure working in Elixir.
That's really a minor issue, but I spent few minutes on it, and therefore I wanted to share it.
First. When a dependency is not found in hex.pm, maybe because misspelled,
mix deps.get
returns an error with an hint. For example:While, the same does not happen when a local dependency specified with the option
path
is not found.For instance, if this is my
mix.exs
Running
mix deps.get
just succeed without any error or warning, actually without printing anything in this case that it is the only dep.Expected behavior
I'd expect a consistent behaviour across the different way to install a dependency.
mix deps.get
should error when the specifiedpath
is not pointing to any folder in the local file system, or to a folder that is not an elixir library.Maybe here, it would be enough to check if there is a
mix.exs
file within the specified path, otherwise raise an error. If you think it is a good idea, I'm happy to open a PR.elixir/lib/mix/lib/mix/scm/path.ex
Line 24 in 860f485
Thank you 😊
The text was updated successfully, but these errors were encountered: