Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package elixir for openSUSE:Factory checked in at 2021-03-20 21:26:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/elixir (Old) and /work/SRC/openSUSE:Factory/.elixir.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "elixir" Sat Mar 20 21:26:11 2021 rev:15 rq:880236 version:1.11.4 Changes: -------- --- /work/SRC/openSUSE:Factory/elixir/elixir.changes 2021-01-13 18:36:18.666337808 +0100 +++ /work/SRC/openSUSE:Factory/.elixir.new.2401/elixir.changes 2021-03-20 21:26:33.829217987 +0100 @@ -1,0 +2,12 @@ +Fri Mar 19 22:01:35 UTC 2021 - Sven Marquardt <[email protected]> + +- Elixir 1.11.4 + * Enhancements + Elixir + [Kernel] Update formatting when printing warnings and errors from Erlang/OTP 24+ + [Kernel] Support float-16 on bitstrings + + Mix + [mix local.rebar] This task will now install rebar3 version 3.14.4, compiled with Erlang/OTP 21 + +------------------------------------------------------------------- Old: ---- elixir-1.11.3.tar.gz New: ---- elixir-1.11.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ elixir-doc.spec ++++++ --- /var/tmp/diff_new_pack.hAM7xY/_old 2021-03-20 21:26:34.425218684 +0100 +++ /var/tmp/diff_new_pack.hAM7xY/_new 2021-03-20 21:26:34.425218684 +0100 @@ -17,7 +17,7 @@ Name: elixir-doc -Version: 1.11.3 +Version: 1.11.4 Release: 0 Summary: Documentation for elixir License: Apache-2.0 elixir.spec: same change ++++++ elixir-1.11.3.tar.gz -> elixir-1.11.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/CHANGELOG.md new/elixir-1.11.4/CHANGELOG.md --- old/elixir-1.11.3/CHANGELOG.md 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/CHANGELOG.md 2021-03-16 12:25:59.000000000 +0100 @@ -243,6 +243,21 @@ Mix also includes two new tasks: `mix app.config`, for application runtime configuration, and `mix test.coverage`, which generates aggregated coverage reports for umbrella projects and for test suites partitioned across processes. +## v1.11.4 (2021-03-16) + +This release introduces fixes for better support of Erlang/OTP 24+. + +### 1. Enhancements + +#### Elixir + + * [Kernel] Update formatting when printing warnings and errors from Erlang/OTP 24+ + * [Kernel] Support float-16 on bitstrings + +#### Mix + + * [mix local.rebar] This task will now install rebar3 version 3.14.4, compiled with Erlang/OTP 21 + ## v1.11.3 (2021-01-04) ### 1. Enhancements diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/VERSION new/elixir-1.11.4/VERSION --- old/elixir-1.11.3/VERSION 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/VERSION 2021-03-16 12:25:59.000000000 +0100 @@ -1 +1 @@ -1.11.3 \ No newline at end of file +1.11.4 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/elixir/lib/kernel/special_forms.ex new/elixir-1.11.4/lib/elixir/lib/kernel/special_forms.ex --- old/elixir-1.11.3/lib/elixir/lib/kernel/special_forms.ex 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/elixir/lib/kernel/special_forms.ex 2021-03-16 12:25:59.000000000 +0100 @@ -233,9 +233,9 @@ Sizes for types are a bit more nuanced. The default size for integers is 8. - For floats, it is 64. For floats, `size * unit` must result in 32 or 64, + For floats, it is 64. For floats, `size * unit` must result in 16, 32, or 64, corresponding to [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point) - binary32 and binary64, respectively. + binary16, binary32, and binary64, respectively. For binaries, the default is the size of the binary. Only the last binary in a match can use the default size. All others must have their size specified diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/elixir/src/elixir_bitstring.erl new/elixir-1.11.4/lib/elixir/src/elixir_bitstring.erl --- old/elixir-1.11.3/lib/elixir/src/elixir_bitstring.erl 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/elixir/src/elixir_bitstring.erl 2021-03-16 12:25:59.000000000 +0100 @@ -319,8 +319,13 @@ build_spec(Meta, Size, Unit, Type, Endianness, Sign, Spec, E) when Type == integer; Type == float -> NumberSize = number_size(Size, Unit), if - Type == float, is_integer(NumberSize), NumberSize /= 32, NumberSize /= 64 -> - form_error(Meta, E, ?MODULE, {bittype_float_size, NumberSize}); + Type == float, is_integer(NumberSize) -> + case valid_float_size(NumberSize) of + true -> + add_spec(Type, add_spec(Endianness, add_spec(Sign, Spec))); + false -> + form_error(Meta, E, ?MODULE, {bittype_float_size, NumberSize}) + end; Size == default, Unit /= default -> form_error(Meta, E, ?MODULE, bittype_unit); true -> @@ -331,6 +336,12 @@ number_size(Size, Unit) when is_integer(Size) -> Size * Unit; number_size(Size, _) -> Size. +%% TODO: Simplify when we require OTP 24 +valid_float_size(16) -> erlang:system_info(otp_release) >= "24"; +valid_float_size(32) -> true; +valid_float_size(64) -> true; +valid_float_size(_) -> false. + add_spec(default, Spec) -> Spec; add_spec(Key, Spec) -> [{Key, [], []} | Spec]. @@ -372,7 +383,12 @@ format_error(bittype_unit) -> "integer and float types require a size specifier if the unit specifier is given"; format_error({bittype_float_size, Other}) -> - io_lib:format("float requires size*unit to be 32 or 64 (default), got: ~p", [Other]); + Message = + case erlang:system_info(otp_release) >= "24" of + true -> "16, 32, or 64"; + false -> "32 or 64" + end, + io_lib:format("float requires size*unit to be ~s (default), got: ~p", [Message, Other]); format_error({invalid_literal, Literal}) -> io_lib:format("invalid literal ~ts in <<>>", ['Elixir.Macro':to_string(Literal)]); format_error({undefined_bittype, Expr}) -> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/elixir/src/elixir_erl_compiler.erl new/elixir-1.11.4/lib/elixir/src/elixir_erl_compiler.erl --- old/elixir-1.11.3/lib/elixir/src/elixir_erl_compiler.erl 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/elixir/src/elixir_erl_compiler.erl 2021-03-16 12:25:59.000000000 +0100 @@ -132,6 +132,17 @@ "this check/guard will always yield the same result"; %% Handle literal eval failures +custom_format(sys_core_fold, {eval_failure, {Mod, Name, Arity}, Error}) -> + #{'__struct__' := Struct} = 'Elixir.Exception':normalize(error, Error), + {ExMod, ExName, ExArgs} = elixir_rewrite:erl_to_ex(Mod, Name, lists:duplicate(Arity, nil)), + Call = 'Elixir.Exception':format_mfa(ExMod, ExName, length(ExArgs)), + Trimmed = case Call of + <<"Kernel.", Rest/binary>> -> Rest; + _ -> Call + end, + ["the call to ", Trimmed, " will fail with ", elixir_aliases:inspect(Struct)]; + +%% TODO: remove when we require OTP 24 custom_format(sys_core_fold, {eval_failure, Error}) -> #{'__struct__' := Struct} = 'Elixir.Exception':normalize(error, Error), ["this expression will fail with ", elixir_aliases:inspect(Struct)]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/elixir/test/elixir/kernel/expansion_test.exs new/elixir-1.11.4/lib/elixir/test/elixir/kernel/expansion_test.exs --- old/elixir-1.11.3/lib/elixir/test/elixir/kernel/expansion_test.exs 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/elixir/test/elixir/kernel/expansion_test.exs 2021-03-16 12:25:59.000000000 +0100 @@ -2387,17 +2387,49 @@ end end - test "raises for invalid size * unit for floats" do - message = ~r"float requires size\*unit to be 32 or 64 \(default\), got: 128" + # TODO: Simplify when we require OTP 24 + if System.otp_release() >= "24" do + test "16-bit floats" do + import Kernel, except: [-: 2] - assert_raise CompileError, message, fn -> - expand(quote(do: <<12.3::32*4>>)) + assert expand(quote(do: <<12.3::float-16>>)) |> clean_meta([:alignment]) == + quote(do: <<12.3::float()-size(16)>>) end - message = ~r"float requires size\*unit to be 32 or 64 \(default\), got: 256" + test "raises for invalid size * unit for floats" do + message = ~r"float requires size\*unit to be 16, 32, or 64 \(default\), got: 128" - assert_raise CompileError, message, fn -> - expand(quote(do: <<12.3::256>>)) + assert_raise CompileError, message, fn -> + expand(quote(do: <<12.3::32*4>>)) + end + + message = ~r"float requires size\*unit to be 16, 32, or 64 \(default\), got: 256" + + assert_raise CompileError, message, fn -> + expand(quote(do: <<12.3::256>>)) + end + end + else + test "16-bit floats" do + message = ~r"float requires size\*unit to be 32 or 64 \(default\), got: 16" + + assert_raise CompileError, message, fn -> + expand(quote(do: <<12.3::16>>)) + end + end + + test "raises for invalid size * unit for floats" do + message = ~r"float requires size\*unit to be 32 or 64 \(default\), got: 128" + + assert_raise CompileError, message, fn -> + expand(quote(do: <<12.3::32*4>>)) + end + + message = ~r"float requires size\*unit to be 32 or 64 \(default\), got: 256" + + assert_raise CompileError, message, fn -> + expand(quote(do: <<12.3::256>>)) + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/elixir/test/elixir/kernel/warning_test.exs new/elixir-1.11.4/lib/elixir/test/elixir/kernel/warning_test.exs --- old/elixir-1.11.3/lib/elixir/test/elixir/kernel/warning_test.exs 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/elixir/test/elixir/kernel/warning_test.exs 2021-03-16 12:25:59.000000000 +0100 @@ -931,6 +931,15 @@ purge(Sample) end + # TODO: Simplify when we require OTP 24 + if System.otp_release() >= "24" do + @argument_error_message "the call to :erlang.atom_to_binary/2" + @arithmetic_error_message "the call to +/2" + else + @argument_error_message "this expression" + @arithmetic_error_message "this expression" + end + test "eval failure warning" do assert capture_err(fn -> Code.eval_string(""" @@ -938,7 +947,7 @@ def foo, do: Atom.to_string "abc" end """) - end) =~ ~r"this expression will fail with ArgumentError\n.*nofile:2" + end) =~ "#{@argument_error_message} will fail with ArgumentError\n nofile:2" assert capture_err(fn -> Code.eval_string(""" @@ -946,7 +955,7 @@ def foo, do: 1 + nil end """) - end) =~ ~r"this expression will fail with ArithmeticError\n.*nofile:2" + end) =~ "#{@arithmetic_error_message} will fail with ArithmeticError\n nofile:2" after purge([Sample1, Sample2]) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/mix/lib/mix/compilers/erlang.ex new/elixir-1.11.4/lib/mix/lib/mix/compilers/erlang.ex --- old/elixir-1.11.3/lib/mix/lib/mix/compilers/erlang.ex 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/mix/lib/mix/compilers/erlang.ex 2021-03-16 12:25:59.000000000 +0100 @@ -271,7 +271,7 @@ defp to_diagnostics(warnings_or_errors, severity) do for {file, issues} <- warnings_or_errors, {line, module, data} <- issues do - position = if is_integer(line) and line >= 1, do: line + position = line(line) %Mix.Task.Compiler.Diagnostic{ file: Path.absname(file), @@ -288,7 +288,12 @@ for {_, warnings} <- entries, {file, issues} <- warnings, {line, module, message} <- issues do - IO.puts("#{file}:#{line}: Warning: #{module.format_error(message)}") + IO.puts("#{file}:#{line(line)}: Warning: #{module.format_error(message)}") end end + + defp line({line, _column}) when is_integer(line) and line >= 1, do: line + # TODO: remove when we require OTP 24 + defp line(line) when is_integer(line) and line >= 1, do: line + defp line(_), do: nil end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/mix/lib/mix/config.ex new/elixir-1.11.4/lib/mix/lib/mix/config.ex --- old/elixir-1.11.3/lib/mix/lib/mix/config.ex 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/mix/lib/mix/config.ex 2021-03-16 12:25:59.000000000 +0100 @@ -176,7 +176,11 @@ """ @doc deprecated: "Use Config.Reader.read_imports!/2 instead" def eval!(file, imported_paths \\ []) do - Config.Reader.read_imports!(file, imports: imported_paths) + Config.Reader.read_imports!(file, + imports: imported_paths, + env: Mix.env(), + target: Mix.target() + ) end @doc """ @@ -195,7 +199,7 @@ @doc deprecated: "Use Config.Reader.read!/2 instead" @spec read!(Path.t(), [Path.t()]) :: keyword def read!(file, imported_paths \\ []) do - Config.Reader.read!(file, imports: imported_paths) + Config.Reader.read!(file, imports: imported_paths, env: Mix.env(), target: Mix.target()) end @doc """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/mix/lib/mix/tasks/compile.erlang.ex new/elixir-1.11.4/lib/mix/lib/mix/tasks/compile.erlang.ex --- old/elixir-1.11.3/lib/mix/lib/mix/tasks/compile.erlang.ex 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/mix/lib/mix/tasks/compile.erlang.ex 2021-03-16 12:25:59.000000000 +0100 @@ -100,9 +100,10 @@ file = Erlang.to_erl_file(Path.rootname(input, ".erl")) case :compile.file(file, erlc_options) do - {:error, :badarg} -> + # TODO: Don't handle {:error, :badarg} when we require OTP 24 + error when error == :error or error == {:error, :badarg} -> message = - "Compiling Erlang #{inspect(file)} failed with ArgumentError, probably because of invalid :erlc_options" + "Compiling Erlang file #{inspect(file)} failed, probably because of invalid :erlc_options" Mix.raise(message) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/mix/test/mix/tasks/compile.erlang_test.exs new/elixir-1.11.4/lib/mix/test/mix/tasks/compile.erlang_test.exs --- old/elixir-1.11.3/lib/mix/test/mix/tasks/compile.erlang_test.exs 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/mix/test/mix/tasks/compile.erlang_test.exs 2021-03-16 12:25:59.000000000 +0100 @@ -14,7 +14,7 @@ @tag erlc_options: [{:d, 'foo', 'bar'}] test "raises on invalid erlc_options" do in_fixture("compile_erlang", fn -> - assert_raise Mix.Error, ~r"failed with ArgumentError", fn -> + assert_raise Mix.Error, ~r"Compiling Erlang file '.*' failed", fn -> capture_io(fn -> Mix.Tasks.Compile.Erlang.run([]) end) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/elixir-1.11.3/lib/mix/test/mix/tasks/compile.yecc_test.exs new/elixir-1.11.4/lib/mix/test/mix/tasks/compile.yecc_test.exs --- old/elixir-1.11.3/lib/mix/test/mix/tasks/compile.yecc_test.exs 2021-01-04 16:47:18.000000000 +0100 +++ new/elixir-1.11.4/lib/mix/test/mix/tasks/compile.yecc_test.exs 2021-03-16 12:25:59.000000000 +0100 @@ -23,10 +23,12 @@ assert %Mix.Task.Compiler.Diagnostic{ compiler_name: "yecc", file: ^file, - message: "syntax error before: '.'", + message: message, position: 1, severity: :error } = diagnostic + + assert message =~ "syntax error before: " end) assert File.regular?("src/test_ok.erl")
