bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.97k stars 400 forks source link

Distillery with Elixir 1.7.1 and OTP-21 failing #438

Closed sztosz closed 6 years ago

sztosz commented 6 years ago

Steps to reproduce

mix release does not work when used with Elixir 1.7.1

Verbose Logs

╭─ sztosz@arch-ryzen  ~/tmp/el                                                                           ✔  12:14:02  192.168.1.156 IP  93.158.235.122 
╰─ asdf local elixir 1.7.1-otp-21 
╭─ sztosz@arch-ryzen  ~/tmp/el                                                                           ✔  12:14:12  192.168.1.156 IP  93.158.235.122 
╰─ asdf local erlang 21.0.3 
╭─ sztosz@arch-ryzen  ~/tmp/el                                                                           ✔  12:14:23  192.168.1.156 IP  93.158.235.122 
╰─ mix new test
* creating README.md
* creating .formatter.exs
* creating .gitignore
* creating mix.exs
* creating config
* creating config/config.exs
* creating lib
* creating lib/test.ex
* creating test
* creating test/test_helper.exs
* creating test/test_test.exs

Your Mix project was created successfully.
You can use "mix" to compile it, test it, and more:

    cd test
    mix test

Run "mix help" for more commands.
╭─ sztosz@arch-ryzen  ~/tmp/el                                                                           ✔  12:14:29  192.168.1.156 IP  93.158.235.122 
╰─ cd test/
╭─ sztosz@arch-ryzen  ~/tmp/el/test                                                                      ✔  12:14:42  192.168.1.156 IP  93.158.235.122 
╰─ code .
╭─ sztosz@arch-ryzen  ~/tmp/el/test                                                                      ✔  12:14:45  192.168.1.156 IP  93.158.235.122 
╰─ # Add [{:distillery, "~> 1.5", runtime: false}] to mix.exs deps
╭─ sztosz@arch-ryzen  ~/tmp/el/test                                                                    1 ↵  12:15:31  192.168.1.156 IP  93.158.235.122 
╰─ mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
New:
  distillery 1.5.3
* Getting distillery (Hex package)
╭─ sztosz@arch-ryzen  ~/tmp/el/test                                                                      ✔  12:15:44  192.168.1.156 IP  93.158.235.122 
╰─ mix compile
==> distillery
Compiling 19 files (.ex)
warning: "not expr1 in expr2" is deprecated. Instead use "expr1 not in expr2" if you require Elixir v1.5+, or "not(expr1 in expr2)" if you have to support earlier Elixir versions
  lib/mix/lib/releases/appups.ex:207

warning: found quoted atom "insecure_cookie_in_distillery_config" but the quotes are not required. Quotes should only be used to introduce atoms with foreign characters in them
  lib/distillery/lib/cookies.ex:22

warning: "not expr1 in expr2" is deprecated. Instead use "expr1 not in expr2" if you require Elixir v1.5+, or "not(expr1 in expr2)" if you have to support earlier Elixir versions
  lib/mix/lib/releases/appups.ex:208

warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
  lib/mix/lib/releases/errors.ex:68

warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
  lib/mix/lib/releases/errors.ex:190

warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
  lib/mix/lib/releases/errors.ex:246

warning: Mix.Config.read!/1 is deprecated. Use eval!/2 instead
  lib/mix/lib/releases/assembler.ex:601

warning: Mix.Dep.loaded/1 is deprecated. Mix.Dep.loaded/1 was private API and you should not use it
  lib/mix/lib/releases/models/app.ex:37

warning: function Mix.Dep.loaded_by_name/2 is undefined or private. Did you mean one of:

      * filter_by_name/2
      * filter_by_name/3
      * loaded/1

  lib/mix/lib/releases/models/app.ex:83

warning: function Mix.Config.Agent.get/1 is undefined (module Mix.Config.Agent is not available)
  lib/mix/lib/releases/config/config.ex:447

warning: function Mix.Config.Agent.stop/1 is undefined (module Mix.Config.Agent is not available)
  lib/mix/lib/releases/config/config.ex:448

Generated distillery app
==> test
Compiling 1 file (.ex)
Generated test app
╭─ sztosz@arch-ryzen  ~/tmp/el/test                                                                  ✔  12:16:14  192.168.1.156 IP  93.158.235.122 
╰─ mix release.init

An example config file has been placed in rel/config.exs, review it,
make edits as needed/desired, and then run `mix release` to build the release
╭─ sztosz@arch-ryzen  ~/tmp/el/test                                                                      ✔  12:16:19  192.168.1.156 IP  93.158.235.122 
╰─ mix release     
** (Mix.Releases.Config.LoadError) could not load release config rel/config.exs
    ** (UndefinedFunctionError) function Mix.Config.Agent.start_link/0 is undefined (module Mix.Config.Agent is not available)
    Mix.Config.Agent.start_link()
    (stdlib) erl_eval.erl:677: :erl_eval.do_apply/6
    (stdlib) erl_eval.erl:446: :erl_eval.expr/5
    (stdlib) erl_eval.erl:126: :erl_eval.exprs/5
    (elixir) lib/code.ex:232: Code.eval_string/3
    (distillery) lib/mix/lib/releases/config/config.ex:281: Mix.Releases.Config.read_string!/1
    (distillery) lib/mix/lib/releases/config/config.ex:302: Mix.Releases.Config.read!/1

Description of issue

Distillery is using private elixir (mix?) api's and need to be probably rewritten to work with 1.7.x

tcoopman commented 6 years ago

See https://github.com/bitwalker/distillery/issues/431, fixed but no new release yet

sztosz commented 6 years ago

Since it's fixed in master, no point in keeping this open :)