From 18e27c73b6464581042ed0b78cc84a814fa16038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Thu, 2 Aug 2018 18:04:03 +0200 Subject: [PATCH 1/2] mix.exs: Require Elixir >= 1.6.6 and < 1.8.0 Elixir 1.6.6 is the first version to support Erlang 21.0. Bumping the minimum to this version eases packaging: packagers don't have to think about Erlang/Elixir combinations which work. The upper limit is set to 1.8.0 (not included) because 1.7.x should work fine. However, 1.8.0 will probably drop Erlang 19.x support, at which point we should review this version pinning. [#159500280] --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 7e1154fb..27d9b9ee 100644 --- a/mix.exs +++ b/mix.exs @@ -20,7 +20,7 @@ defmodule RabbitMQCtl.MixfileBase do [ app: :rabbitmqctl, version: "3.8.0-dev", - elixir: "~> 1.6.0", + elixir: ">= 1.6.6 and < 1.8.0", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, escript: [main_module: RabbitMQCtl, From b6daa83befd0188dc04afab9154dab519eb67553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Fri, 3 Aug 2018 13:17:09 +0200 Subject: [PATCH 2/2] RabbitMQ.CLI.Core.Parser: Set `allow_nonexistent_atoms` in OptionParser There is a change of behavior in OptionParser between Elixir 1.6.x and 1.7.x. It's probably the deprecation documented in Elixir 1.7.0 release notes: [OptionParser] Deprecate dynamic option parser mode that depended on atoms to be previously loaded and therefore behaved inconsistently Setting the `allow_nonexistent_atoms` to true allows to restore the behavior from Elixir 1.6.x, thus giving a consistent parsing with both versions of Elixir. [#159500280] --- lib/rabbitmq/cli/core/parser.ex | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/rabbitmq/cli/core/parser.ex b/lib/rabbitmq/cli/core/parser.ex index e50920b3..2a693ddd 100644 --- a/lib/rabbitmq/cli/core/parser.ex +++ b/lib/rabbitmq/cli/core/parser.ex @@ -141,7 +141,12 @@ defmodule RabbitMQ.CLI.Core.Parser do switches = default_switches() aliases = default_aliases() {options, tail, invalid} = - OptionParser.parse_head(input, strict: switches, aliases: aliases) + OptionParser.parse_head( + input, + strict: switches, + aliases: aliases, + allow_nonexistent_atoms: true, + ) norm_options = normalize_options(options, switches) |> Map.new {norm_options, tail, invalid} end @@ -156,7 +161,8 @@ defmodule RabbitMQ.CLI.Core.Parser do {options, args, invalid} = OptionParser.parse( input, strict: switches, - aliases: aliases + aliases: aliases, + allow_nonexistent_atoms: true, ) norm_options = normalize_options(options, switches) |> Map.new {args, norm_options, invalid}