Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving Hex dependencies... Failed to use X because Y dependency requires specific version ... 🤦‍♂️ #182

Open
nelsonic opened this issue Oct 17, 2022 · 6 comments
Assignees
Labels
BLOCKED :fire: Core team's HIGHEST priority, blocking critical work chore a tedious but necessary task often paying technical debt T1d Time Estimate 1 Day tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

We recently had this happen in dwyl/auth_plug#76 and it's happened in the past too. ⏳

It's happening to me in the auth project while I try to update Fields:

mix deps.get
Resolving Hex dependencies...

Failed to use "ecto" (versions 3.3.0 to 3.9.1) because
  ecto_sql (version 3.7.2) requires ~> 3.7.0
  phoenix_ecto (version 4.4.0) requires ~> 3.3


Failed to use "ecto" (versions 3.7.0 to 3.7.2) because
  ecto_sql (version 3.7.2) requires ~> 3.7.0
  fields (version 2.9.1) requires ~> 3.8
  phoenix_ecto (version 4.4.0) requires ~> 3.3


Failed to use "jason" (version 1.4.0) because
  auth_plug (version 1.4.11) requires ~> 1.2
  elixir_auth_github (version 1.6.2) requires ~> 1.2
  elixir_auth_google (version 1.6.3) requires ~> 1.2
  phoenix (version 1.6.6) requires ~> 1.0
  phoenix_live_view (version 0.17.7) requires ~> 1.0
  postgrex (version 0.16.2) requires ~> 1.0
  rbac (version 0.7.1) requires ~> 1.3.0
  mix.exs specifies ~> 1.3

** (Mix) Hex dependency resolution failed, change the version requirements of your dependencies 
or unlock them (by using mix deps.update or mix deps.unlock). 
If you are unable to resolve the conflicts you can try overriding with {:dependency, "~> 1.0", override: true}

As noted in dwyl/auth_plug#76 (comment) this is one of my biggest frustrations with Hex. 😢
By upgrading to a later version of a dependency e.g. jason or plug in one of the packages we "control",
we are no longer able to use the package in a project where a different dependency relies on on an older version!
So we are forced to conform to the lowest common denominator in terms of updates.
Which is really bad for both security and performance. 🤦‍♂️
When a newer version of a package is released, provided all tests continue passing, everyone should use it!

@nelsonic nelsonic added chore a tedious but necessary task often paying technical debt technical A technical issue that requires understanding of the code, infrastructure or dependencies labels Oct 17, 2022
@nelsonic
Copy link
Member Author

nelsonic commented Oct 17, 2022

Ran:

mix deps.unlock --all

Followed by:

mix deps.get

Got:

Resolving Hex dependencies...
The dependency resolver is taking more than 30 seconds. This typically happens when Hex cannot find a suitable set of dependencies that match your requirements. Here are some suggestions:

  1. Do not delete mix.lock. If you want to update some dependencies, do mix deps.update dep1 dep2 dep3

  2. Tighten up your dependency requirements to the latest version. Instead of {:my_dep, ">= 1.0.0"}, try {:my_dep, "~> 3.6"}

Took a break to refill my water bottle and when I returned to my desk I spent a few mins checking my GH Notifications ... ⏳
It's been 10 mins and the fans on my Mac are running like jet engines and zero progress on downloading the deps! 🤷‍♂️

@nelsonic
Copy link
Member Author

Had to kill the mix deps.get as it seemed like it hung my terminal. 💀
Downgrade my version of Fields from 2.9.1 to 2.8.2 and then re-installed everything mix deps.get. 🙃
This is annoying ... 🤦‍♂️

@nelsonic
Copy link
Member Author

Need a permanent solution to this. 💭 Parking for now but will return to it ASAP.

@nelsonic
Copy link
Member Author

Happening again ...

auth % mix deps.get
Resolving Hex dependencies...

Failed to use "ecto" (versions 3.3.0 to 3.9.1) because
  ecto_sql (version 3.7.2) requires ~> 3.7.0
  phoenix_ecto (version 4.4.0) requires ~> 3.3


Failed to use "ecto" (versions 3.7.0 to 3.7.2) because
  ecto_sql (version 3.7.2) requires ~> 3.7.0
  fields (version 2.10.0) requires ~> 3.8
  phoenix_ecto (version 4.4.0) requires ~> 3.3


Failed to use "jason" (version 1.4.0) because
  auth_plug (version 1.4.11) requires ~> 1.2
  elixir_auth_github (version 1.6.2) requires ~> 1.2
  elixir_auth_google (version 1.6.3) requires ~> 1.2
  phoenix (version 1.6.14) requires ~> 1.0
  phoenix_live_view (version 0.18.2) requires ~> 1.0
  postgrex (version 0.16.2) requires ~> 1.0
  rbac (version 0.7.2) requires ~> 1.3.0
  mix.exs specifies ~> 1.3

** (Mix) Hex dependency resolution failed, change the version requirements 
of your dependencies or unlock them (by using mix deps.update or mix deps.unlock). 
If you are unable to resolve the conflicts you can 
try overriding with {:dependency, "~> 1.0", override: true}

Lame. 🤦‍♂️
Unpicking now. ⏳

@nelsonic
Copy link
Member Author

Downgrading the required version of ecto in the fields project from:

{:ecto, "~> 3.8"},

To:

{:ecto, "~> 3.3"},

To match: https://github.com/phoenixframework/phoenix_ecto/blob/2cf35cf2e441416bfb82b72aafc1659a12873cd2/mix.exs#L55

And thus avoid compatibility issues! 🤞

@nelsonic
Copy link
Member Author

nelsonic commented Oct 18, 2022

From bad to much worse! 🤦‍♂️
Looks like it's going to be a looooong evening! ⏳

n@MBP auth % mix deps.unlock --all
n@MBP auth % mix deps.get
Resolving Hex dependencies...
The dependency resolver is taking more than 30 seconds. This typically happens when Hex cannot find a suitable set of dependencies that match your requirements. Here are some suggestions:

  1. Do not delete mix.lock. If you want to update some dependencies, do mix deps.update dep1 dep2 dep3

  2. Tighten up your dependency requirements to the latest version. Instead of {:my_dep, ">= 1.0.0"}, try {:my_dep, "~> 3.6"}


Failed to use "ecto" (versions 3.8.0 to 3.9.1) because
  ecto_sql (versions 3.7.1 and 3.7.2) requires ~> 3.7.0
  phoenix_ecto (version 4.4.0) requires ~> 3.3


Failed to use "jason" (version 1.4.0) because
  auth_plug (versions 1.4.14 to 1.4.16) requires ~> 1.3
  elixir_auth_github (versions 1.6.1 and 1.6.2) requires ~> 1.2
  elixir_auth_google (versions 1.6.2 and 1.6.3) requires ~> 1.2
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 1.0
  phoenix_live_view (versions 0.18.0 to 0.18.2) requires ~> 1.0
  postgrex (versions 0.15.13 to 0.16.5) requires ~> 1.0
  rbac (version 0.7.0) requires ~> 1.2.2
  mix.exs specifies ~> 1.3


Failed to use "jason" (version 1.4.0) because
  auth_plug (versions 1.4.14 to 1.4.16) requires ~> 1.3
  elixir_auth_github (versions 1.6.1 and 1.6.2) requires ~> 1.2
  elixir_auth_google (versions 1.6.2 and 1.6.3) requires ~> 1.2
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 1.0
  phoenix_live_view (versions 0.18.0 to 0.18.2) requires ~> 1.0
  postgrex (versions 0.15.13 to 0.16.5) requires ~> 1.0
  rbac (versions 0.7.1 and 0.7.2) requires ~> 1.3.0
  mix.exs specifies ~> 1.3


Failed to use "plug" (versions 1.10.2 to 1.13.1) because
  auth_plug (version 1.4.16) requires ~> 1.13.2
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 1.10
  phoenix_ecto (version 4.4.0) requires ~> 1.9
  phoenix_html (version 3.2.0) requires ~> 1.5
  plug_cowboy (version 2.5.2) requires ~> 1.7


Failed to use "plug" (versions 1.10.2 to 1.13.2) because
  auth_plug (version 1.4.15) requires ~> 1.13.3
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 1.10
  phoenix_ecto (version 4.4.0) requires ~> 1.9
  phoenix_html (version 3.2.0) requires ~> 1.5
  plug_cowboy (version 2.5.2) requires ~> 1.7


Failed to use "plug" (versions 1.10.2 to 1.13.3) because
  auth_plug (version 1.4.14) requires ~> 1.13.4
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 1.10
  phoenix_ecto (version 4.4.0) requires ~> 1.9
  phoenix_html (version 3.2.0) requires ~> 1.5
  plug_cowboy (version 2.5.2) requires ~> 1.7


Failed to use "plug" (versions 1.13.2 to 1.13.6) because
  auth_plug (version 1.4.16) requires ~> 1.13.2
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 1.10
  phoenix_ecto (version 4.4.0) requires ~> 1.9
  phoenix_html (version 3.2.0) requires ~> 1.5
  ping (version 1.1.0) requires ~> 1.12.1
  plug_cowboy (version 2.5.2) requires ~> 1.7


Failed to use "plug" (versions 1.13.3 to 1.13.6) because
  auth_plug (version 1.4.15) requires ~> 1.13.3
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 1.10
  phoenix_ecto (version 4.4.0) requires ~> 1.9
  phoenix_html (version 3.2.0) requires ~> 1.5
  ping (version 1.1.0) requires ~> 1.12.1
  plug_cowboy (version 2.5.2) requires ~> 1.7


Failed to use "plug" (versions 1.13.4 to 1.13.6) because
  auth_plug (version 1.4.14) requires ~> 1.13.4
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 1.10
  phoenix_ecto (version 4.4.0) requires ~> 1.9
  phoenix_html (version 3.2.0) requires ~> 1.5
  ping (version 1.1.0) requires ~> 1.12.1
  plug_cowboy (version 2.5.2) requires ~> 1.7


Failed to use "telemetry" (versions 0.4.0 and 0.4.1) because
  ecto_sql (versions 3.7.1 and 3.7.2) requires ~> 0.4.0 or ~> 1.0
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 0.4 or ~> 1.0
  phoenix_live_view (versions 0.18.0 to 0.18.2) requires ~> 0.4.2 or ~> 1.0
  plug (versions 1.10.0 and 1.10.1) requires ~> 0.4
  telemetry_metrics (version 0.6.1) requires ~> 0.4 or ~> 1.0


Failed to use "telemetry" (versions 0.4.2 and 0.4.3) because
  ecto_sql (versions 3.7.1 and 3.7.2) requires ~> 0.4.0 or ~> 1.0
  phoenix (versions 1.6.5 to 1.6.14) requires ~> 0.4 or ~> 1.0
  phoenix_live_view (versions 0.18.0 to 0.18.2) requires ~> 0.4.2 or ~> 1.0
  plug (versions 1.10.0 and 1.10.1) requires ~> 0.4
  telemetry_metrics (version 0.6.1) requires ~> 0.4 or ~> 1.0
  telemetry_poller (version 1.0.0) requires ~> 1.0

nelsonic added a commit to dwyl/auth_plug that referenced this issue Oct 18, 2022
@nelsonic nelsonic self-assigned this Oct 19, 2022
@nelsonic nelsonic added T1d Time Estimate 1 Day tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written BLOCKED :fire: Core team's HIGHEST priority, blocking critical work labels Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKED :fire: Core team's HIGHEST priority, blocking critical work chore a tedious but necessary task often paying technical debt T1d Time Estimate 1 Day tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
None yet
Development

No branches or pull requests

1 participant