{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/3664","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3664/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3664/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3664/events","html_url":"https://github.com/elixir-lang/elixir/issues/3664","id":104711951,"number":3664,"title":"Missing conflict resolution for subdependencies with :only option","user":{"login":"grundrauschen","id":1609845,"avatar_url":"https://avatars.githubusercontent.com/u/1609845?v=3","gravatar_id":"","url":"https://api.github.com/users/grundrauschen","html_url":"https://github.com/grundrauschen","followers_url":"https://api.github.com/users/grundrauschen/followers","following_url":"https://api.github.com/users/grundrauschen/following{/other_user}","gists_url":"https://api.github.com/users/grundrauschen/gists{/gist_id}","starred_url":"https://api.github.com/users/grundrauschen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grundrauschen/subscriptions","organizations_url":"https://api.github.com/users/grundrauschen/orgs","repos_url":"https://api.github.com/users/grundrauschen/repos","events_url":"https://api.github.com/users/grundrauschen/events{/privacy}","received_events_url":"https://api.github.com/users/grundrauschen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-03T14:44:08Z","updated_at":"2015-09-03T15:12:26Z","closed_at":null,"body":"When running `mix test` after downloading the dependencies for a package with the same dependencies in dependencies (two dependencies wanted to use hackage) but just one with the `only: :test` option set, I got the following output:\r\n\r\n```\r\nUnchecked dependencies for environment test:\r\n* hackney (Hex package)\r\n  the dependency hackney\r\n\r\n  > In deps/httpoison/mix.exs:\r\n    {:hackney, \"~> 1.0\", [only: :test, optional: false, hex: :hackney]}\r\n\r\n  does not match the environments calculated for\r\n\r\n  > In deps/hello/mix.exs:\r\n    {:hackney, \"~> 1.1.0\", [hex: :hackney]}\r\n\r\n  Remove the :only restriction from your dep\r\n** (Mix) Can't continue due to errors on dependencies\r\n```\r\n\r\nAs far as I understood the :only option, it means that a dependency should just be installed when a certain environment is set (:dev or :test) to minimize dependencies in production, but not harm if it is still installed.\r\nIn this case I would expect `mix` to resolve the problem to install hackney in any cases because it is required by the second library, but by the first one just in the test environment.\r\nWhen I override the dependency in the mix file of the library itself, I just get more dependencies that actually needed directly."},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/137480315","html_url":"https://github.com/elixir-lang/elixir/issues/3664#issuecomment-137480315","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3664","id":137480315,"user":{"login":"grundrauschen","id":1609845,"avatar_url":"https://avatars.githubusercontent.com/u/1609845?v=3","gravatar_id":"","url":"https://api.github.com/users/grundrauschen","html_url":"https://github.com/grundrauschen","followers_url":"https://api.github.com/users/grundrauschen/followers","following_url":"https://api.github.com/users/grundrauschen/following{/other_user}","gists_url":"https://api.github.com/users/grundrauschen/gists{/gist_id}","starred_url":"https://api.github.com/users/grundrauschen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grundrauschen/subscriptions","organizations_url":"https://api.github.com/users/grundrauschen/orgs","repos_url":"https://api.github.com/users/grundrauschen/repos","events_url":"https://api.github.com/users/grundrauschen/events{/privacy}","received_events_url":"https://api.github.com/users/grundrauschen/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T15:12:25Z","updated_at":"2015-09-03T15:12:25Z","body":"Hej José,\r\nThank you for the fast response.\r\nIt happened in the following project: https://github.com/travelping/hello_test_server\r\nThere you also find the mix.exs file and can clone the repo to reproduce it if necessary.\r\nI was just running `git pull ...`, `cd ..`, `mix deps.get` and `mix test`.\r\nThe same problem occurred when using `MIX_ENV=test mix deps.get` instead.\r\n"}}