diff options
Diffstat (limited to 'dev-lang/elixir/files')
4 files changed, 224 insertions, 81 deletions
diff --git a/dev-lang/elixir/files/elixir-1.11.2-mksh.patch b/dev-lang/elixir/files/elixir-1.11.2-mksh.patch deleted file mode 100644 index 3fda43156890..000000000000 --- a/dev-lang/elixir/files/elixir-1.11.2-mksh.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 69bb81635a77afb28419103bdb02867b48994d4a Mon Sep 17 00:00:00 2001 -From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> -Date: Wed, 9 Dec 2020 18:21:34 +0100 -Subject: [PATCH] bin/elixir: Rename erl() function to erl_set() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It conflicted with the erl executable for Korn-derived shells where a function -can be used in `exec command`. - -It isn't clear which behavior is expected from reading the POSIX specification -but "Shell Command Language § 2.9.1 Simple Commands" clears the usage of -the term `command` quite well. -And even with excluding functions from the `command` operand of `exec`, -why are aliases accepted? (in most if not all shells) - -See: https://bugs.gentoo.org/729964 ---- - bin/elixir | 28 ++++++++++++++-------------- - 1 file changed, 14 insertions(+), 14 deletions(-) - ---- a/bin/elixir -+++ b/bin/elixir -@@ -70,7 +70,7 @@ readlink_f () { - ERL="" - - # Stores erl arguments preserving spaces/quotes (mimics an array) --erl () { -+erl_set () { - eval "E${E}=\$1" - E=$((E + 1)) - } -@@ -137,34 +137,34 @@ while [ $I -le $LENGTH ]; do - ;; - --cookie) - S=2 -- erl "-setcookie" -- erl "$2" -+ erl_set "-setcookie" -+ erl_set "$2" - ;; - --sname|--name) - S=2 -- erl "$(echo "$1" | cut -c 2-)" -- erl "$2" -+ erl_set "$(echo "$1" | cut -c 2-)" -+ erl_set "$2" - ;; - --erl-config) - S=2 -- erl "-config" -- erl "$2" -+ erl_set "-config" -+ erl_set "$2" - ;; - --vm-args) - S=2 -- erl "-args_file" -- erl "$2" -+ erl_set "-args_file" -+ erl_set "$2" - ;; - --boot) - S=2 -- erl "-boot" -- erl "$2" -+ erl_set "-boot" -+ erl_set "$2" - ;; - --boot-var) - S=3 -- erl "-boot_var" -- erl "$2" -- erl "$3" -+ erl_set "-boot_var" -+ erl_set "$2" -+ erl_set "$3" - ;; - --pipe-to) - S=3 diff --git a/dev-lang/elixir/files/elixir-1.14.1-make44-parallel-build.patch b/dev-lang/elixir/files/elixir-1.14.1-make44-parallel-build.patch new file mode 100644 index 000000000000..81d40f751da8 --- /dev/null +++ b/dev-lang/elixir/files/elixir-1.14.1-make44-parallel-build.patch @@ -0,0 +1,27 @@ +From c668ce22b0dd72261621f19f124490eb5425eacd Mon Sep 17 00:00:00 2001 +From: Matthew Smith <matthew@gentoo.org> +Date: Tue, 15 Nov 2022 21:38:50 +0000 +Subject: [PATCH] Disable parallel build in Make 4.4 + +In versions of GNU Make prior to 4.4, ".NOTPARALLEL: compile" made the whole +build run serially. In 4.4 and later, ".NOTPARALLEL: compile" makes only +the compile target run serially. + +This breaks the build and can lead to e.g. EEx being built before Mix. +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index f6ba18d90e..8bb5bcdc65 100644 +--- a/Makefile ++++ b/Makefile +@@ -24,7 +24,7 @@ SOURCE_DATE_EPOCH_PATH = lib/elixir/tmp/ebin_reproducible + SOURCE_DATE_EPOCH_FILE = $(SOURCE_DATE_EPOCH_PATH)/SOURCE_DATE_EPOCH + + .PHONY: install compile erlang elixir unicode app build_plt clean_plt dialyze test check_reproducible clean clean_residual_files format install_man clean_man docs Docs.zip Precompiled.zip zips +-.NOTPARALLEL: compile ++.NOTPARALLEL: + + #==> Functions + diff --git a/dev-lang/elixir/files/elixir-1.14.5-otp26-tests.patch b/dev-lang/elixir/files/elixir-1.14.5-otp26-tests.patch new file mode 100644 index 000000000000..4e554cda252a --- /dev/null +++ b/dev-lang/elixir/files/elixir-1.14.5-otp26-tests.patch @@ -0,0 +1,107 @@ +Grabbed as-is from https://github.com/elixir-lang/elixir/commit/54516c5684daa3af7f15477c77fae39e8d0c6482 which was done for 1.15.x + +From 54516c5684daa3af7f15477c77fae39e8d0c6482 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@dashbit.co> +Date: Sun, 1 Oct 2023 15:46:17 +0200 +Subject: [PATCH] Address tests on Erlang/OTP 26.1, closes #12975 + +--- + lib/ex_unit/lib/ex_unit/callbacks.ex | 9 +----- + lib/ex_unit/test/ex_unit/formatter_test.exs | 31 +++++++++----------- + lib/ex_unit/test/ex_unit/supervised_test.exs | 11 ++----- + 3 files changed, 18 insertions(+), 33 deletions(-) + +diff --git a/lib/ex_unit/lib/ex_unit/callbacks.ex b/lib/ex_unit/lib/ex_unit/callbacks.ex +index 060d207516a..2dbe9bd0e4a 100644 +--- a/lib/ex_unit/lib/ex_unit/callbacks.ex ++++ b/lib/ex_unit/lib/ex_unit/callbacks.ex +@@ -549,14 +549,7 @@ defmodule ExUnit.Callbacks do + end + + child_spec = Supervisor.child_spec(child_spec_or_module, opts) +- +- case Supervisor.start_child(sup, child_spec) do +- {:error, {:already_started, _pid}} -> +- {:error, {:duplicate_child_name, child_spec.id}} +- +- other -> +- other +- end ++ Supervisor.start_child(sup, child_spec) + end + + @doc """ +diff --git a/lib/ex_unit/test/ex_unit/formatter_test.exs b/lib/ex_unit/test/ex_unit/formatter_test.exs +index afb66a52436..bb9642fbcc4 100644 +--- a/lib/ex_unit/test/ex_unit/formatter_test.exs ++++ b/lib/ex_unit/test/ex_unit/formatter_test.exs +@@ -491,28 +491,25 @@ defmodule ExUnit.FormatterTest do + test "inspect failure" do + failure = [{:error, catch_assertion(assert :will_fail == %BadInspect{}), []}] + +- message = ~S''' +- got FunctionClauseError with message: +- +- """ +- no function clause matching in Inspect.ExUnit.FormatterTest.BadInspect.inspect/2 +- """ +- +- while inspecting: +- +- %{__struct__: ExUnit.FormatterTest.BadInspect, key: 0} +- +- Stacktrace: +- ''' +- +- assert format_test_failure(test(), failure, 1, 80, &formatter/2) =~ """ ++ assert format_test_failure(test(), failure, 1, 80, &formatter/2) =~ ~s''' + 1) world (Hello) + test/ex_unit/formatter_test.exs:1 + Assertion with == failed + code: assert :will_fail == %BadInspect{} + left: :will_fail +- right: #Inspect.Error<\n#{message}\ +- """ ++ right: #Inspect.Error< ++ got FunctionClauseError with message: ++ ++ """ ++ no function clause matching in Inspect.ExUnit.FormatterTest.BadInspect.inspect/2 ++ """ ++ ++ while inspecting: ++ ++ #{inspect(%BadInspect{}, structs: false)} ++ ++ Stacktrace: ++ ''' + end + + defmodule BadMessage do +diff --git a/lib/ex_unit/test/ex_unit/supervised_test.exs b/lib/ex_unit/test/ex_unit/supervised_test.exs +index 577ae6b9676..a02dfe3c0c5 100644 +--- a/lib/ex_unit/test/ex_unit/supervised_test.exs ++++ b/lib/ex_unit/test/ex_unit/supervised_test.exs +@@ -73,19 +73,14 @@ defmodule ExUnit.SupervisedTest do + + test "starts a supervised process with ID checks" do + {:ok, pid} = start_supervised({MyAgent, 0}) ++ assert is_pid(pid) + +- assert {:error, {:duplicate_child_name, ExUnit.SupervisedTest.MyAgent}} = +- start_supervised({MyAgent, 0}) +- +- assert {:error, {{:already_started, ^pid}, _}} = start_supervised({MyAgent, 0}, id: :another) ++ assert {:error, _} = start_supervised({MyAgent, 0}) ++ assert {:error, _} = start_supervised({MyAgent, 0}, id: :another) + + assert_raise RuntimeError, ~r"Reason: bad child specification", fn -> + start_supervised!(%{id: 1, start: :oops}) + end +- +- assert_raise RuntimeError, ~r"Reason: already started", fn -> +- start_supervised!({MyAgent, 0}, id: :another) +- end + end + + test "stops a supervised process" do diff --git a/dev-lang/elixir/files/elixir-1.16.1-skip-tests-requiring-erlang-docs.patch b/dev-lang/elixir/files/elixir-1.16.1-skip-tests-requiring-erlang-docs.patch new file mode 100644 index 000000000000..187c45a7d902 --- /dev/null +++ b/dev-lang/elixir/files/elixir-1.16.1-skip-tests-requiring-erlang-docs.patch @@ -0,0 +1,90 @@ +Upstream-Commit: https://github.com/elixir-lang/elixir/commit/c50863615c0e8ac957e22ae01a6f9af23978c3f9 + +From c50863615c0e8ac957e22ae01a6f9af23978c3f9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@dashbit.co> +Date: Thu, 8 Feb 2024 08:08:03 +0100 +Subject: [PATCH] Skip tests if Erlang was compiled without docs, closes #13322 + +--- + lib/iex/test/iex/helpers_test.exs | 12 +++++++++--- + lib/iex/test/test_helper.exs | 10 +++++++++- + 2 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/lib/iex/test/iex/helpers_test.exs b/lib/iex/test/iex/helpers_test.exs +index 54f946516ce..171acc72abc 100644 +--- a/lib/iex/test/iex/helpers_test.exs ++++ b/lib/iex/test/iex/helpers_test.exs +@@ -332,17 +332,20 @@ defmodule IEx.HelpersTest do + assert help =~ "Welcome to Interactive Elixir" + end + ++ @tag :erlang_doc + test "prints Erlang module documentation" do + captured = capture_io(fn -> h(:timer) end) + assert captured =~ "This module provides useful functions related to time." + end + ++ @tag :erlang_doc + test "prints Erlang module function specs" do + captured = capture_io(fn -> h(:timer.sleep() / 1) end) + assert captured =~ ":timer.sleep/1" + assert captured =~ "-spec sleep(Time) -> ok when Time :: timeout()." + end + ++ @tag :erlang_doc + test "handles non-existing Erlang module function" do + captured = capture_io(fn -> h(:timer.baz() / 1) end) + assert captured =~ "No documentation for :timer.baz was found" +@@ -1008,13 +1011,15 @@ defmodule IEx.HelpersTest do + cleanup_modules([TypeSample]) + end + +- test "prints all types in erlang module" do ++ @tag :erlang_doc ++ test "prints all types in Erlang module" do + captured = capture_io(fn -> t(:queue) end) + assert captured =~ "-type queue() :: queue(_)" + assert captured =~ "-opaque queue(Item)" + end + +- test "prints single type from erlang module" do ++ @tag :erlang_doc ++ test "prints single type from Erlang module" do + captured = capture_io(fn -> t(:erlang.iovec()) end) + assert captured =~ "-type iovec() :: [binary()]" + assert captured =~ "A list of binaries." +@@ -1024,7 +1029,8 @@ defmodule IEx.HelpersTest do + assert captured =~ "A list of binaries." + end + +- test "handles non-existing types from erlang module" do ++ @tag :erlang_doc ++ test "handles non-existing types from Erlang module" do + captured = capture_io(fn -> t(:erlang.foo()) end) + assert captured =~ "No type information for :erlang.foo was found or :erlang.foo is private" + +diff --git a/lib/iex/test/test_helper.exs b/lib/iex/test/test_helper.exs +index f5a55f0aa80..b32c8be4e91 100644 +--- a/lib/iex/test/test_helper.exs ++++ b/lib/iex/test/test_helper.exs +@@ -7,11 +7,19 @@ IEx.configure(colors: [enabled: false]) + {line_exclude, line_include} = + if line = System.get_env("LINE"), do: {[:test], [line: line]}, else: {[], []} + ++erlang_doc_exclude = ++ if match?({:docs_v1, _, _, _, _, _, _}, Code.fetch_docs(:array)) do ++ [] ++ else ++ IO.puts("Erlang/OTP compiled without docs, some tests are excluded...") ++ [:erlang_doc] ++ end ++ + ExUnit.start( + assert_receive_timeout: assert_timeout, + trace: !!System.get_env("TRACE"), + include: line_include, +- exclude: line_exclude ++ exclude: line_exclude ++ erlang_doc_exclude + ) + + defmodule IEx.Case do |