erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

Conditional mix.exs deps are invalid #307

Closed mpope9 closed 2 years ago

mpope9 commented 2 years ago

I'm attempting to add the latest version of Jason to an application. I'm seeing the following error message:

===> Dep decimal has invalid version ~> 1.0 or ~> 2.0

I believe it is due to this line in the mix.exs file:

defp deps() do
    [
      {:decimal, "~> 1.0 or ~> 2.0", optional: true},
...

Here is a repro:

% rebar.config
{plugins, [
    {rebar3_elixir, ".*", {git, "https://github.com/Supersonido/rebar3_elixir.git", {branch, "master"}}},
    rebar3_hex}]}.

{deps, [
    {jason, "1.3.0"}]}.

I didn't realized deps could be conditional until I saw this.

tsloughter commented 2 years ago

Yea, rebar3 does not (yet) support conditional constraints. It is an issue with rebar3 itself, not rebar3_hex which is not responsible for package resolving or fetching.

mpope9 commented 2 years ago

Ah I see. Will close, thank you!