elixir-geolix / geolix

IP information lookup provider
Apache License 2.0
190 stars 18 forks source link

geolix does'nt work with elixir 1.9 release #24

Closed sunboshan closed 5 years ago

sunboshan commented 5 years ago

In elixir 1.9, it added mix release task to build a release without using distillery.

However it doesn't work with geolix lib, since in the mix.exs,

  def application do
    [
      applications: [:logger, :poolboy],
      included_applications: [:mmdb2_decoder],
      mod: {Geolix, []}
    ]
  end

The included_application part will make mix release complain.

➜ MIX_ENV=prod mix release
===> Compiling poolboy
==> mmdb2_decoder
Compiling 5 files (.ex)
Generated mmdb2_decoder app
==> geolix
Compiling 38 files (.ex)
Generated geolix app
==> a
Compiling 1 file (.ex)
Generated a app
Release a-0.1.0 already exists. Overwrite? [Yn]
* assembling a-0.1.0 on MIX_ENV=prod
* skipping runtime configuration (config/releases.exs not found)
** (Mix) Undefined applications: [mmdb2_decoder]

The solution is to move the mmdb2_decoder to applications would work.

  def application do
    [
      applications: [:logger, :poolboy, :mmdb2_decoder],
      included_applications: [],
      mod: {Geolix, []}
    ]
  end
mneudert commented 5 years ago

Sorry for the late reply!

As your issue for Elixir itself has been classified as a real bug (as far as I can see it should have even received a fix by now?) it might be best to slightly circumvent this problem for now.

With a new application it looked like adding :mmdb2_decoder to either :extra_applications or :applications in your own mix.exs seems to build a working release. Once Elixir has received a 1.9.1 release it should work as expected :thinking:

mneudert commented 5 years ago

The recently released Elixir 1.9.1 seems to completely fix this problem :heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart: