erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Order of dependency in appfile causes relx to fail #492

Closed ericbmerritt closed 7 years ago

ericbmerritt commented 8 years ago

Just for background, this seems to be related to: https://github.com/bitwalker/exrm/issues/339

If the app part of mix.exs looks like this. Things work.

  def application do
    [applications: [:elixir, :logger, :poison,
                    :ex_json_schema,
                    :hound,
                    :cucumberl, :httpotion],
     mod: {<REDACTED>, []}]
  end

If it looks like this:

  def application do
    [applications: [:logger, :cucumberl, :httpotion,
                    :poison,
                    :ex_json_schema,
                    :hound],
     mod: {<REDACTED>, []}]
  end

Interesting enough, the application list gets reordered. The failing application list given verbose output is:

===> Provider successfully run: app_discover
===> Running provider resolve_release
===> Solving Release sunlightapi_tests-0.0.1
===> Resolved sunlightapi_tests-0.0.1
===> release: sunlightapi_tests-0.0.1
           erts-7.2, realized = true
     goals: 
          <REDACTED>
     applications: 
          {hackney,"1.6.0"},
          {elixir,"1.2.2"},
          {stdlib,"2.7"},
          {kernel,"4.1.1"},
          {httpoison,"0.8.3"},
          {metrics,"1.0.1"},
          {ssl,"7.2"},
          {ssl_verify_fun,"1.1.0"},
          {certifi,"0.4.0"},
          {mimerl,"1.0.2"},
          {idna,"1.2.0"},
          {public_key,"1.1"},
          {asn1,"4.0.1"},
          {crypto,"3.6.2"},
          {logger,"1.2.2"},
          {hound,"1.0.0"},
          {ex_json_schema,"0.4.1"},
          {poison,"2.1.0"},
          {ibrowse,"4.2.2"},
          {httpotion,"3.0.0"},
          {cucumberl,"0.0.10"},
          {compiler,"6.0.2"},
          {<REDACTED>,"0.0.1"},

Notice the positioning of stdlib and kernel: I think that is telling but will try to verify.

===> release: sunlightapi_tests-0.0.1
           erts-7.2, realized = true
     goals: 
          <REDACTED>
     applications: 
          {stdlib,"2.7"},
          {kernel,"4.1.1"},
          {ibrowse,"4.2.2"},
          {ssl,"7.2"},
          {elixir,"1.2.2"},
          {httpotion,"3.0.0"},
          {cucumberl,"0.0.10"},
          {hackney,"1.6.0"},
          {httpoison,"0.8.3"},
          {metrics,"1.0.1"},
          {ssl_verify_fun,"1.1.0"},
          {certifi,"0.4.0"},
          {mimerl,"1.0.2"},
          {idna,"1.2.0"},
          {public_key,"1.1"},
          {crypto,"3.6.2"},
          {asn1,"4.0.1"},
          {logger,"1.2.2"},
          {hound,"1.0.0"},
          {ex_json_schema,"0.4.1"},
          {poison,"2.1.0"},
          {compiler,"6.0.2"},
          {<REDACTED>,"0.0.1"},
tsloughter commented 8 years ago

As I mentioned in #493 our sort isn't stable and systools is, this is an important difference. Either this PR needs to be a stable sort of systools needs to be fixed for the issue.

tsloughter commented 8 years ago

Do you have an Erlang example I could reproduce with? I'd like to play around in sasl to see what is going on.

ericbmerritt commented 8 years ago

I don't, but it should be pretty straight forward to reproduce. Both of the examples are in Elixir I wonder if there is some kind of specification problem that arises. Hmm, a lot of time applications don't specify a dependency on elixir, or stdlib and kernel.

ericbmerritt commented 8 years ago

just verified that that is not the problem :(

lrascao commented 7 years ago

530 should fix this, please re-open if issue still occurs