eliver icon indicating copy to clipboard operation
eliver copied to clipboard

Enquirer version referenced in mix.lock breaks with Elixir 1.15.0

Open Ivor opened this issue 1 year ago • 0 comments

Hi, firstly, thanks for the great library!

I updated to use Elixir 1.15.0 and discovered that my project cannot compile. I traced the issue to this change in the changelog:

[Kernel] Raise instead of warning on undefined variables. Previously, an undefined variable would attempt to invoke a function of the same name, which led to confusing error messages, especially to newcomers. To enable the previous behaviour, invoke Code.compiler_options(on_undefined_variable: :warn) at the top of your mix.exs

The problem is in the version of enquirer that was pushed up to hex and that is referenced by Eliver. The compile errors are shown below.

~/code/eliver master !1 ?1 ❯ mix compile                                                                                                              х INT elixir 1.15.0-otp-25
warning: use Mix.Config is deprecated. Use the Config module instead
  config/config.exs:3

==> enquirer
Compiling 1 file (.ex)
error: undefined variable "red"
  lib/enquirer.ex:14: Enquirer.say/2

error: undefined variable "green"
  lib/enquirer.ex:15: Enquirer.say/2

error: undefined variable "yellow"
  lib/enquirer.ex:16: Enquirer.say/2

error: undefined variable "default_color"
  lib/enquirer.ex:19: Enquirer.say/2

error: undefined variable "do_get_list"
  lib/enquirer.ex:109: Enquirer.get_list/1

error: undefined variable "do_get_list"
  lib/enquirer.ex:114: Enquirer.do_get_list/0

warning: function do_get_list/0 is unused
  lib/enquirer.ex:112: Enquirer (module)


== Compilation error in file lib/enquirer.ex ==
** (CompileError) lib/enquirer.ex: cannot compile module Enquirer (errors have been logged)

It is possible to get around this problem by adding Code.compiler_options(on_undefined_variable: :warn) to the top of a project's mix file.

I had a look at the enquirer repo and saw that the latest commit does compile fine with the parenthesis for red, green etc having been added. It seems that the latest commit simply has not been pushed up to hex and so eliver is still referencing the older version.

I have verified that using this in my mix file solves the problem:

{:enquirer, ref: "22ad2a8a91f896d2ae197d4fab1bd8ef84ebd6bc", github: "glasnoster/enquirer", only: local_envs(), override: true},

I suspect publishing the latest commit for Enquirer will solve this problem. Thanks!

Ivor avatar Jun 19 '23 15:06 Ivor