Dependency Hell - SQLite clashing with Elixir 1.8

I wanted to use an SQLite database for a new project (I have my reasons) but quickly abandoned that idea when I was adding sqlitex 1.7.0 to my mix.exs file.

There were just too many dependency clashes with Elixir 1.8. The library versions that Elixir was using were ahead of the versions that sqlitex was looking for and I didn’t want to downgrade Elixir and make my dependency chain cleanup worse than just dealing with the conflicts caused by trying to use sqlitex.

How does everyone deal with this sort of problem? Any advice? (I still want to use SQLite for a project but I’m stuck until I can solve this dependency problem.)

Thanks for your time…
Steve

Elixir does not depend on any library by itself, therefore I’m not sure what clashes you are talking about.

Perhaps you can elaborate on the clashes?

Anyway, often you can use override: true to manipulate the dependency graph and it will just work, but sometimes it will break because of incompatible changes.

In any case I’d file bug reports in the dependencies having the issues to fix it and update their dependencies.

If even this won’t work, I’d search for a dependency that is under more active development.

2 Likes

By dependencies in Elixir, I meant the dependencies in Phoenix within the mix.exs file (sorry - its a habit of mine to refer to anything ‘Phoenix’ as ‘Elixir’ otherwise Google searches return tons of Arizona references).

Example:

  defp deps do
    [
      {:phoenix, "~> 1.4.1"},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 4.0"},
      {:ecto_sql, "~> 3.0"},
      {:mariaex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.0"},
      {:myxql, "~> 0.2.6"},
      {:httpoison, "~> 1.5"}
    ]
  end

I can’t give you an example because I deleted the attempted project - just create a quick and dirty Phoenix project then add sqlitex to the mix.exs deps[] list and you’ll see what I’m talking about.

Hi,

I have tried to reproduce the issue you describe and have not been able to do it. I tried with the following list of dependencies and it resolves successfully:

defp deps do
    [
      {:phoenix, "~> 1.4.1"},
      {:phoenix_pubsub, "~> 1.1"},
      {:phoenix_ecto, "~> 4.0"},
      {:ecto_sql, "~> 3.0"},
      {:mariaex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.0"},
      {:myxql, "~> 0.2.6"},
      {:httpoison, "~> 1.5"},
      {:sqlitex, ">= 0.0.0"}
    ]
  end

When asking for help try to provide as much information you can, including the code that doesn’t work and the error messages you are seeing. It makes it easier for us to give you help quicker.

1 Like

That’s interesting… I’ll give it another try and if I get the same results I had before, I’ll include the mix deps.get results.

I did notice that you used {:sqlitex, ">= 0.0.0"} whereas I was using {:sqlitex, "~> 1.7"}.
Also, at the time, I was using {:ecto_sql, "~> 3.1"} and {:mariaex, ">= 0.0.0"} and not {:myxql, "~> 0.2.6"} so maybe these made a difference?

Thanks for your time.

1 Like