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

Dep poison has invalid version ~> 2.2 or ~> 3.0 #54

Closed
francescm opened this issue Dec 12, 2018 · 2 comments
Closed

Dep poison has invalid version ~> 2.2 or ~> 3.0 #54

francescm opened this issue Dec 12, 2018 · 2 comments

Comments

@francescm
Copy link

Erlang/OTP 21 [erts-10.1.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

$ rebar3 new app welcome_jambd_oracle
$ cd welcome_jambd_oracle
$ vim rebar3.config
$ cat rebar3.config
{erl_opts, [debug_info]}.
{deps, [{jamdb_oracle, "0.3.0"}]}.

{shell, [
% {config, "config/sys.config"},
{apps, [welcome_jambd_oracle]}
]}.
$ rebar3 compile
===> Verifying dependencies...
===> Fetching jamdb_oracle ({pkg,<<"jamdb_oracle">>,<<"0.3.0">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/jamdb_oracle-0.3.0.tar is up to date, reusing it
===> Fetching ecto_sql ({pkg,<<"ecto_sql">>,<<"3.0.3">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/ecto_sql-3.0.3.tar is up to date, reusing it
===> Fetching jose ({pkg,<<"jose">>,<<"1.8.4">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/jose-1.8.4.tar is up to date, reusing it
===> Fetching base64url ({pkg,<<"base64url">>,<<"0.0.1">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/base64url-0.0.1.tar is up to date, reusing it
===> Fetching db_connection ({pkg,<<"db_connection">>,<<"2.0.3">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/db_connection-2.0.3.tar is up to date, reusing it
===> Fetching ecto ({pkg,<<"ecto">>,<<"3.0.5">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/ecto-3.0.5.tar is up to date, reusing it
===> Fetching mariaex ({pkg,<<"mariaex">>,<<"0.9.1">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/mariaex-0.9.1.tar is up to date, reusing it
===> Fetching postgrex ({pkg,<<"postgrex">>,<<"0.14.1">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/postgrex-0.14.1.tar is up to date, reusing it
===> Fetching telemetry ({pkg,<<"telemetry">>,<<"0.2.0">>})
===> Version cached at /Users/francesco/.cache/rebar3/hex/hexpm/packages/telemetry-0.2.0.tar is up to date, reusing it
===> Dep poison has invalid version ~> 2.2 or ~> 3.0

welcome_jambd_oracle
edit welcome_jambd_oracle/rebar.config to add:

@vstavskyi
Copy link
Member

vstavskyi commented Dec 13, 2018

The mix.exs file from ecto package contains this complex condition
{:poison, "~> 2.2 or ~> 3.0", optional: true},

For mix projects elixir Version module is used to check deps

iex(1)> Version.parse_requirement("~> 2.2 or ~> 3.0")
{:ok, #Version.Requirement<~> 2.2 or ~> 3.0>}
iex(2)> Version.parse_requirement("~> 2.2")          
{:ok, #Version.Requirement<~> 2.2>}

But, for rebar3 projects in rebar_packages.erl valid_vsn function is used

valid_vsn(Vsn) ->
    %% Regepx from https://github.com/sindresorhus/semver-regex/blob/master/index.js
    SemVerRegExp = "v?(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*))?"
        "(-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9a-z-]+(\\.[0-9a-z-]+)*)?",
    SupportedVersions = "^(>=?|<=?|~>|==)?\\s*" ++ SemVerRegExp ++ "$",
    re:run(Vsn, SupportedVersions, [unicode]) =/= nomatch.
>valid_vsn("~> 2.2").
true
>valid_vsn("~> 2.2 or ~> 3.0").
false

So,for now, complex conditions in mix.exs are not compatible with rebar3.
Use the mix
$mix new welcome_jambd_oracle --sup

@francescm
Copy link
Author

Good, fine with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants