Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: elixir-lang/elixir
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.14.3
Choose a base ref
...
head repository: elixir-lang/elixir
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.14.4
Choose a head ref

Commits on Jan 28, 2023

  1. Optimize application tracer

    josevalim committed Jan 28, 2023
    Copy the full SHA
    c31d1b3 View commit details

Commits on Feb 2, 2023

  1. Copy the full SHA
    6a1c5a4 View commit details

Commits on Feb 6, 2023

  1. Copy the full SHA
    2ca0f1a View commit details

Commits on Feb 10, 2023

  1. Copy the full SHA
    9fd9bce View commit details

Commits on Feb 13, 2023

  1. Copy the full SHA
    7535c0c View commit details

Commits on Feb 16, 2023

  1. Copy the full SHA
    6c31a6c View commit details
  2. Copy the full SHA
    dc471cd View commit details

Commits on Feb 18, 2023

  1. Remove badfunc test on OTP26 (#12415)

    sabiwara authored and josevalim committed Feb 18, 2023
    Copy the full SHA
    e977f02 View commit details

Commits on Feb 19, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6eca976 View commit details

Commits on Feb 20, 2023

  1. Copy the full SHA
    3eb94a4 View commit details

Commits on Feb 21, 2023

  1. Copy the full SHA
    130ed60 View commit details

Commits on Feb 23, 2023

  1. Copy the full SHA
    12927b8 View commit details
  2. Use get_until in IEx.Server

    This change is necessary for forward compatibility
    with Erlang/OTP 26+.
    josevalim committed Feb 23, 2023

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    f596cf1 View commit details
  3. Update CHANGELOG

    josevalim committed Feb 23, 2023
    Copy the full SHA
    00e7245 View commit details

Commits on Feb 26, 2023

  1. Copy the full SHA
    32c929b View commit details

Commits on Feb 28, 2023

  1. Fix more map inspection tests (#12433)

    sabiwara authored and josevalim committed Feb 28, 2023
    Copy the full SHA
    1108a6c View commit details

Commits on Mar 2, 2023

  1. Make mix test reports deterministic in OTP26 (#12438)

    * Make mix test reports deterministic in OTP26
    
    The reports for the following were both relying on map keys ordering:
    - mix test
    - mix test.cover
    
    * Fix non-deterministic test
    sabiwara authored and josevalim committed Mar 2, 2023
    Copy the full SHA
    f9c053d View commit details
  2. Copy the full SHA
    2229ed7 View commit details
  3. Bump timeout to infinity

    josevalim committed Mar 2, 2023
    Copy the full SHA
    476b4fd View commit details

Commits on Mar 10, 2023

  1. Copy the full SHA
    a8824ba View commit details

Commits on Mar 15, 2023

  1. Copy the full SHA
    4687556 View commit details

Commits on Mar 23, 2023

  1. Copy the full SHA
    2b9d8b7 View commit details
  2. Copy the full SHA
    3d0273a View commit details
  3. Copy the full SHA
    c3e0908 View commit details
  4. Copy the full SHA
    22fa810 View commit details
  5. Copy the full SHA
    1a75456 View commit details

Commits on Mar 24, 2023

  1. Copy the full SHA
    237f3bc View commit details
  2. Copy the full SHA
    e9a6c9e View commit details

Commits on Mar 25, 2023

  1. Copy the full SHA
    73d58ec View commit details

Commits on Mar 30, 2023

  1. Copy the full SHA
    f026cb3 View commit details

Commits on Apr 3, 2023

  1. Fix dialyzer tests in OTP26 (#12486)

    sabiwara authored and josevalim committed Apr 3, 2023
    Copy the full SHA
    acb5832 View commit details
  2. Update CHANGELOG

    josevalim committed Apr 3, 2023
    Copy the full SHA
    4e5a8d4 View commit details
  3. Release v1.14.4

    josevalim committed Apr 3, 2023
    Copy the full SHA
    6f96693 View commit details
Showing with 418 additions and 191 deletions.
  1. +43 −1 CHANGELOG.md
  2. +1 −1 VERSION
  3. 0 _build/dev/lib/git_app/.mix/compile.lock
  4. +1 −1 bin/elixir
  5. +1 −1 bin/elixir.bat
  6. +1 −2 lib/elixir/lib/calendar/naive_datetime.ex
  7. +2 −2 lib/elixir/lib/code/normalizer.ex
  8. +3 −3 lib/elixir/lib/enum.ex
  9. +6 −1 lib/elixir/lib/inspect.ex
  10. +5 −0 lib/elixir/lib/inspect/algebra.ex
  11. +3 −1 lib/elixir/lib/io/ansi/docs.ex
  12. +2 −2 lib/elixir/lib/module/parallel_checker.ex
  13. +1 −1 lib/elixir/lib/module/types.ex
  14. +2 −0 lib/elixir/lib/stream.ex
  15. +2 −1 lib/elixir/lib/string_io.ex
  16. +1 −1 lib/elixir/lib/supervisor.ex
  17. +1 −1 lib/elixir/pages/compatibility-and-deprecations.md
  18. +1 −1 lib/elixir/src/elixir_erl.erl
  19. +1 −1 lib/elixir/src/elixir_expand.erl
  20. +1 −1 lib/elixir/src/elixir_interpolation.erl
  21. +1 −1 lib/elixir/src/elixir_map.erl
  22. +22 −0 lib/elixir/test/elixir/code_normalizer/formatted_ast_test.exs
  23. +61 −64 lib/elixir/test/elixir/enum_test.exs
  24. +13 −6 lib/elixir/test/elixir/exception_test.exs
  25. +22 −11 lib/elixir/test/elixir/inspect_test.exs
  26. +21 −1 lib/elixir/test/elixir/kernel/dialyzer_test.exs
  27. +1 −1 lib/elixir/test/elixir/kernel/quote_test.exs
  28. +1 −0 lib/elixir/test/elixir/kernel/raise_test.exs
  29. +1 −1 lib/elixir/test/elixir/map_test.exs
  30. +19 −19 lib/elixir/test/elixir/module/types/pattern_test.exs
  31. +2 −0 lib/elixir/test/elixir/stream_test.exs
  32. +1 −1 lib/elixir/test/erlang/string_test.erl
  33. +5 −0 lib/elixir/test/erlang/tokenizer_test.erl
  34. +3 −1 lib/ex_unit/lib/ex_unit/cli_formatter.ex
  35. +4 −1 lib/iex/lib/iex/helpers.ex
  36. +21 −1 lib/iex/lib/iex/server.ex
  37. +3 −3 lib/iex/test/iex/autocomplete_test.exs
  38. +7 −2 lib/iex/test/iex/interaction_test.exs
  39. +2 −1 lib/logger/lib/logger/utils.ex
  40. +24 −23 lib/logger/test/logger/translator_test.exs
  41. +43 −13 lib/mix/lib/mix/compilers/application_tracer.ex
  42. +4 −2 lib/mix/lib/mix/tasks/format.ex
  43. +1 −0 lib/mix/lib/mix/tasks/test.coverage.ex
  44. +19 −1 lib/mix/lib/mix/utils.ex
  45. +29 −16 lib/mix/test/mix/dep_test.exs
  46. +10 −0 lib/mix/test/mix/tasks/format_test.exs
  47. BIN tmp/SystemTest/test-Unix-cmd-3-with-absolute-and-relative-paths-f3bf3544/echo-elixir-test
44 changes: 43 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -241,6 +241,45 @@ protocol, giving developers more control over the struct representation.
See the updated documentation for `Inspect` for a general rundown on
the approaches and options available.

## v1.14.4 (2023-04-03)

This release adds basic support for Erlang/OTP 26. When migrating
to Erlang/OTP 26, keep it mind it changes how maps are stored
internally and they will be printed and traversed in a different
order (note maps never provided a guarantee of their order).
To aid migration, this release adds `:sort_maps` to `inspect`
custom options, in case you want to sort them before inspection:

inspect(map, custom_options: [sort_maps: true])

### Enhancements

#### Elixir

* [Inspect] Add `:sort_maps` to `Inspect.Opts.custom_options`

#### IEx

* [IEx] Support shell history in Erlang/OTP 26+

#### Mix

* [mix compile.elixir] Optimize application tracer

### Bug fixes

#### Elixir

* [Code] Properly handle blocks with comments in all cases in `Code.quoted_to_string_with_comments/2`
* [Kernel] Fix `debug_info/4` when returning core_v1
* [Kernel] Store complete path on `quote keep: true` to avoid invalid stacktraces
* [Kernel] Fix column count when tokenizing escaped interpolations
* [Stream] Fix `Stream.zip/1` hanging on empty list

#### Mix

* [mix fomrat] Don't call formatter on directories

## v1.14.3 (2023-01-14)

### 1. Enhancements
@@ -259,14 +298,17 @@ the approaches and options available.
#### Elixir

* [Calendar] Fix handling of negative years in `Calendar.strftime/2`
* [DateTime] Consistently merge precision of subsecond operations (the bug was that subsecond precision was lost in functions like `DateTime.add/3`)
* [Exception] Improve blaming of FunctionClauseError with `is_struct/2` guards
* [Kernel] Fix invalid variable scoping in `defguard` expansion
* [Kernel] Do not warn on captured underscored vars from `defmodule`
* [Kernel] Do not crash for missing line info on type warnings
* [NaiveDateTime] Consistently merge precision of subsecond operations (the bug was that subsecond precision was lost in functions like `NaiveDateTime.add/3`)
* [Macro] Fix `Macro.to_string/1` for large negative integers
* [Macro] Properly type and escape expansion of `__ENV__` in macros
* [Path] Make sure `Path.wildcard/2` expands `..` symlinks accordingly
* [Range] Address corner cases in `Range.disjoint?/2` implementation
* [Time] Consistently merge precision of subsecond operations (the bug was that subsecond precision was lost in functions like `Time.add/3`)

#### ExUnit

@@ -466,7 +508,7 @@ the approaches and options available.
* [Module] Fix loop while unifying type variables
* [Protocol] Warn if a protocol has no definitions
* [Regex] Show list options when inspecting a Regex manually defined with `Regex.compile/2`
* [String] Allow slices to overflow on both starting and ending positions
* [String] Allow slices to overflow on both starting and ending positions
* [System] Raise non-generic exception on missing env in `System.fetch_env!/1` to mirror map operations

#### ExUnit
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.14.3
1.14.4
Empty file.
2 changes: 1 addition & 1 deletion bin/elixir
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
set -e

ELIXIR_VERSION=1.14.3
ELIXIR_VERSION=1.14.4

if [ $# -eq 0 ] || { [ $# -eq 1 ] && { [ "$1" = "--help" ] || [ "$1" = "-h" ]; }; }; then
cat <<USAGE >&2
2 changes: 1 addition & 1 deletion bin/elixir.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@if defined ELIXIR_CLI_ECHO (@echo on) else (@echo off)

set ELIXIR_VERSION=1.14.3
set ELIXIR_VERSION=1.14.4

setlocal enabledelayedexpansion
if ""%1""=="""" if ""%2""=="""" goto documentation
3 changes: 1 addition & 2 deletions lib/elixir/lib/calendar/naive_datetime.ex
Original file line number Diff line number Diff line change
@@ -361,8 +361,7 @@ defmodule NaiveDateTime do
`t:System.time_unit/0`. It defaults to `:second`. Negative values
will move backwards in time.
This function always consider the unit to be computed according
to the `Calendar.ISO`.
This function always considers the unit to be computed according to the `Calendar.ISO`.
## Examples
4 changes: 2 additions & 2 deletions lib/elixir/lib/code/normalizer.ex
Original file line number Diff line number Diff line change
@@ -362,7 +362,7 @@ defmodule Code.Normalizer do
normalize_kw_blocks(form, meta, args, state)

allow_keyword?(form, arity) ->
args = normalize_args(args, %{state | parent_meta: state.parent_meta})
args = normalize_args(args, %{state | parent_meta: meta})
{last_arg, leading_args} = List.pop_at(args, -1, [])

last_args =
@@ -384,7 +384,7 @@ defmodule Code.Normalizer do
{form, meta, leading_args ++ last_args}

true ->
args = normalize_args(args, %{state | parent_meta: state.parent_meta})
args = normalize_args(args, %{state | parent_meta: meta})
{form, meta, args}
end
end
6 changes: 3 additions & 3 deletions lib/elixir/lib/enum.ex
Original file line number Diff line number Diff line change
@@ -2276,13 +2276,13 @@ defmodule Enum do
iex> Enum.split_with([5, 4, 3, 2, 1, 0], fn x -> rem(x, 2) == 0 end)
{[4, 2, 0], [5, 3, 1]}
iex> Enum.split_with(%{a: 1, b: -2, c: 1, d: -3}, fn {_k, v} -> v < 0 end)
iex> Enum.split_with([a: 1, b: -2, c: 1, d: -3], fn {_k, v} -> v < 0 end)
{[b: -2, d: -3], [a: 1, c: 1]}
iex> Enum.split_with(%{a: 1, b: -2, c: 1, d: -3}, fn {_k, v} -> v > 50 end)
iex> Enum.split_with([a: 1, b: -2, c: 1, d: -3], fn {_k, v} -> v > 50 end)
{[], [a: 1, b: -2, c: 1, d: -3]}
iex> Enum.split_with(%{}, fn {_k, v} -> v > 50 end)
iex> Enum.split_with([], fn {_k, v} -> v > 50 end)
{[], []}
"""
7 changes: 6 additions & 1 deletion lib/elixir/lib/inspect.ex
Original file line number Diff line number Diff line change
@@ -302,7 +302,12 @@ end

defimpl Inspect, for: Map do
def inspect(map, opts) do
list = Map.to_list(map)
list =
if Keyword.get(opts.custom_options, :sort_maps) do
map |> Map.to_list() |> :lists.sort()
else
Map.to_list(map)
end

fun =
if Inspect.List.keyword?(list) do
5 changes: 5 additions & 0 deletions lib/elixir/lib/inspect/algebra.ex
Original file line number Diff line number Diff line change
@@ -31,6 +31,11 @@ defmodule Inspect.Opts do
options. Useful when implementing the `Inspect` protocol for nested structs
to pass the custom options through.
It supports some pre-defined keys:
- `:sort_maps` (since v1.15.0) - if set to `true`, sorts key-value pairs in maps.
This can be helpful to make map inspection deterministic for testing,
especially since key order is random since OTP 26.
* `:inspect_fun` (since v1.9.0) - a function to build algebra documents.
Defaults to `Inspect.Opts.default_inspect_fun/0`.
4 changes: 3 additions & 1 deletion lib/elixir/lib/io/ansi/docs.ex
Original file line number Diff line number Diff line change
@@ -78,7 +78,9 @@ defmodule IO.ANSI.Docs do
@metadata_filter [:deprecated, :guard, :since]

defp print_each_metadata(metadata, options) do
Enum.reduce(metadata, false, fn
metadata
|> Enum.sort()
|> Enum.reduce(false, fn
{key, value}, _printed when is_binary(value) and key in @metadata_filter ->
label = metadata_label(key, options)
indent = String.duplicate(" ", length_without_escape(label, 0) + 1)
4 changes: 2 additions & 2 deletions lib/elixir/lib/module/parallel_checker.ex
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ defmodule Module.ParallelChecker do
spawn({self(), checker}, module, file)
end

modules = :gen_server.call(checker, :start)
modules = :gen_server.call(checker, :start, :infinity)
collect_results(modules, [])
end

@@ -171,7 +171,7 @@ defmodule Module.ParallelChecker do
"""
def test_cache do
{:ok, checker} = start_link()
{checker, :gen_server.call(checker, :ets)}
{checker, :gen_server.call(checker, :ets, :infinity)}
end

@doc """
2 changes: 1 addition & 1 deletion lib/elixir/lib/module/types.ex
Original file line number Diff line number Diff line change
@@ -252,7 +252,7 @@ defmodule Module.Types do
"undefined field \"#{atom}\" ",
format_expr(expr, location),
"expected one of the following fields: ",
Enum.map_join(Enum.sort(known_atoms), ", ", & &1),
Enum.join(Enum.sort(known_atoms), ", "),
"\n\n",
traces,
format_message_hints(hints),
2 changes: 2 additions & 0 deletions lib/elixir/lib/stream.ex
Original file line number Diff line number Diff line change
@@ -1315,6 +1315,8 @@ defmodule Stream do
{:suspended, acc, &zip_list(enumerables, &1, fun, zip_fun)}
end

defp zip_list([], {:cont, acc}, _fun, _zip_fun), do: {:done, acc}

defp zip_list(enumerables, {:cont, acc}, fun, zip_fun) do
case zip_list_heads_tails(enumerables, [], []) do
{heads, tails} -> zip_list(tails, fun.(zip_fun.(heads), acc), fun, zip_fun)
3 changes: 2 additions & 1 deletion lib/elixir/lib/string_io.ex
Original file line number Diff line number Diff line change
@@ -366,6 +366,7 @@ defmodule StringIO do
defp get_until(encoding, prompt, mod, fun, args, %{input: input} = state) do
case get_until(input, encoding, mod, fun, args, [], 0) do
{result, input, count} ->
# Convert :eof to "" as they are both treated the same
input =
case input do
:eof -> ""
@@ -392,7 +393,7 @@ defmodule StringIO do
defp get_until(chars, encoding, mod, fun, args, continuation, count) do
case bytes_until_eol(chars, encoding, 0) do
{kind, size} when kind in [:split, :replace_split] ->
{line, rest} = :erlang.split_binary(chars, size)
<<line::binary-size(size), rest::binary>> = chars

case apply(mod, fun, [continuation, binary_to_list(line, encoding) | args]) do
{:done, result, :eof} ->
2 changes: 1 addition & 1 deletion lib/elixir/lib/supervisor.ex
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ defmodule Supervisor do
GenServer.call(Counter, :get)
#=> 0
GenServer.cast(Counter, {:bump, 3})
GenServer.call(Counter, {:bump, 3})
#=> 0
GenServer.call(Counter, :get)
2 changes: 1 addition & 1 deletion lib/elixir/pages/compatibility-and-deprecations.md
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ Erlang/OTP versioning is independent from the versioning of Elixir. Erlang relea

Elixir version | Supported Erlang/OTP versions
:------------- | :-------------------------------
1.14 | 23 - 25
1.14 | 23 - 25 (and Erlang/OTP 26 from v1.14.4)
1.13 | 22 - 24 (and Erlang/OTP 25 from v1.13.4)
1.12 | 22 - 24
1.11 | 21 - 23 (and Erlang/OTP 24 from v1.11.4)
2 changes: 1 addition & 1 deletion lib/elixir/src/elixir_erl.erl
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ debug_info(core_v1, _Module, {elixir_v1, Map, Specs}, Opts) ->
%% warnings nor the other functionality provided there.
case elixir_erl_compiler:erl_to_core(Prefix ++ Specs ++ Forms, AllOpts) of
{ok, CoreForms, _} ->
try compile:noenv_forms(CoreForms, [no_spawn_compiler_process, from_core, core, return | AllOpts]) of
try compile:noenv_forms(CoreForms, [no_spawn_compiler_process, from_core, to_core, return | AllOpts]) of
{ok, _, Core, _} -> {ok, Core};
_What -> {error, failed_conversion}
catch
2 changes: 1 addition & 1 deletion lib/elixir/src/elixir_expand.erl
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ expand({quote, Meta, [Opts, Do]}, S, E) when is_list(Do) ->

{File, Line} = case lists:keyfind(location, 1, EOpts) of
{location, keep} ->
{elixir_utils:relative_to_cwd(?key(E, file)), false};
{?key(E, file), false};
false ->
{proplists:get_value(file, EOpts, nil), proplists:get_value(line, EOpts, false)}
end,
2 changes: 1 addition & 1 deletion lib/elixir/src/elixir_interpolation.erl
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ extract([$\\, Last, Last, Last | Rest], Buffer, Output, Line, Column, Scope, Int
extract(Rest, [Last, Last, Last | Buffer], Output, Line, Column+4, Scope, Interpol, All);

extract([$\\, $#, ${ | Rest], Buffer, Output, Line, Column, Scope, true, Last) ->
extract(Rest, [${, $#, $\\ | Buffer], Output, Line, Column+1, Scope, true, Last);
extract(Rest, [${, $#, $\\ | Buffer], Output, Line, Column+3, Scope, true, Last);

extract([$#, ${ | Rest], Buffer, Output, Line, Column, Scope, true, Last) ->
Output1 = build_string(Buffer, Output),
2 changes: 1 addition & 1 deletion lib/elixir/src/elixir_map.erl
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ expand_struct(Meta, Left, {'%{}', MapMeta, MapArgs}, S, #{context := Context} =
AssocKeys = [K || {K, _} <- Assocs],
Struct = load_struct(Meta, ELeft, [Assocs], AssocKeys, EE),
Keys = ['__struct__'] ++ AssocKeys,
WithoutKeys = maps:to_list(maps:without(Keys, Struct)),
WithoutKeys = lists:sort(maps:to_list(maps:without(Keys, Struct))),
StructAssocs = elixir_quote:escape(WithoutKeys, none, false),
{{'%', Meta, [ELeft, {'%{}', MapMeta, StructAssocs ++ Assocs}]}, SE, EE};

22 changes: 22 additions & 0 deletions lib/elixir/test/elixir/code_normalizer/formatted_ast_test.exs
Original file line number Diff line number Diff line change
@@ -507,6 +507,28 @@ defmodule Code.Normalizer.FormatterASTTest do
# after
""",
literal_encoder: fn literal, _ -> {:ok, literal} end

assert_same """
block do
# before 1
1 + 1
# before 2
2 + 2
end
""",
literal_encoder: fn literal, _ -> {:ok, literal} end

assert_same """
block do
# before 1
Mix.install([1 + 1])
# before 2
Mix.install([2 + 2])
end
""",
literal_encoder: fn literal, _ -> {:ok, literal} end
end

test "before and after expressions with newlines" do
Loading