Skip to content

Commit 13024f4

Browse files
authored
Remove OTP26 support and add OTP29-rc (#15164)
* Update OTP compatibility table * Add OTP 29.0 rc to CI, remove 26.0 * Remove :elxiir_json polyfill * Remove :elixir_utils.jaro_similarity polyfill * defdelegate directly to :proc_lib.set_label/2
1 parent 8914dcd commit 13024f4

8 files changed

Lines changed: 20 additions & 1249 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
include:
29+
- otp_version: "29.0-rc1"
2930
- otp_version: "28.1"
3031
deterministic: true
3132
- otp_version: "28.1"
@@ -36,7 +37,6 @@ jobs:
3637
erlc_opts: "warnings_as_errors"
3738
- otp_version: "27.0"
3839
erlc_opts: "warnings_as_errors"
39-
- otp_version: "26.0"
4040
- otp_version: master
4141
development: true
4242
- otp_version: maint
@@ -121,9 +121,9 @@ jobs:
121121
strategy:
122122
matrix:
123123
otp_version:
124+
- "29.0-rc1"
124125
- "28.1"
125126
- "27.3"
126-
- "26.2"
127127

128128
steps:
129129
- name: Configure Git

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,16 @@ jobs:
7171
fail-fast: true
7272
matrix:
7373
include:
74-
- otp: 26
75-
otp_version: "26.0"
76-
7774
- otp: 27
7875
otp_version: "27.0"
7976

8077
- otp: 28
8178
otp_version: "28.0"
8279
build_docs: build_docs
8380

81+
- otp: 29
82+
otp_version: "29.0-rc1"
83+
8484
steps:
8585
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8686
with:
@@ -125,7 +125,7 @@ jobs:
125125
strategy:
126126
fail-fast: true
127127
matrix:
128-
otp: [26, 27, 28]
128+
otp: [27, 28, 29]
129129
flavor: [windows, linux]
130130

131131
env:

lib/elixir/lib/json.ex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ defprotocol JSON.Encoder do
6767

6868
{io, _prefix} =
6969
Enum.flat_map_reduce(kv, ?{, fn {field, value}, prefix ->
70-
key = IO.iodata_to_binary([prefix, :elixir_json.encode_binary(Atom.to_string(field)), ?:])
70+
key = IO.iodata_to_binary([prefix, :json.encode_binary(Atom.to_string(field)), ?:])
7171
{[key, quote(do: encoder.(unquote(value), encoder))], ?,}
7272
end)
7373

@@ -130,25 +130,25 @@ end
130130

131131
defimpl JSON.Encoder, for: BitString do
132132
def encode(value, _encoder) do
133-
:elixir_json.encode_binary(value)
133+
:json.encode_binary(value)
134134
end
135135
end
136136

137137
defimpl JSON.Encoder, for: List do
138138
def encode(value, encoder) do
139-
:elixir_json.encode_list(value, encoder)
139+
:json.encode_list(value, encoder)
140140
end
141141
end
142142

143143
defimpl JSON.Encoder, for: Integer do
144144
def encode(value, _encoder) do
145-
:elixir_json.encode_integer(value)
145+
:json.encode_integer(value)
146146
end
147147
end
148148

149149
defimpl JSON.Encoder, for: Float do
150150
def encode(value, _encoder) do
151-
:elixir_json.encode_float(value)
151+
:json.encode_float(value)
152152
end
153153
end
154154

@@ -408,7 +408,7 @@ defmodule JSON do
408408
decoders = Keyword.put_new(decoders, :null, nil)
409409

410410
try do
411-
:elixir_json.decode(binary, acc, Map.new(decoders))
411+
:json.decode(binary, acc, Map.new(decoders))
412412
catch
413413
:error, :unexpected_end ->
414414
{:error, {:unexpected_end, byte_size(binary)}}
@@ -528,16 +528,16 @@ defmodule JSON do
528528
end
529529

530530
def protocol_encode(value, _encoder) when is_binary(value),
531-
do: :elixir_json.encode_binary(value)
531+
do: :json.encode_binary(value)
532532

533533
def protocol_encode(value, _encoder) when is_integer(value),
534-
do: :elixir_json.encode_integer(value)
534+
do: :json.encode_integer(value)
535535

536536
def protocol_encode(value, _encoder) when is_float(value),
537-
do: :elixir_json.encode_float(value)
537+
do: :json.encode_float(value)
538538

539539
def protocol_encode(value, encoder) when is_list(value),
540-
do: :elixir_json.encode_list(value, encoder)
540+
do: :json.encode_list(value, encoder)
541541

542542
def protocol_encode(%{} = value, encoder) when not is_map_key(value, :__struct__),
543543
do: JSON.Encoder.Map.encode(value, encoder)

lib/elixir/lib/process.ex

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -997,12 +997,7 @@ defmodule Process do
997997
"""
998998
@doc since: "1.17.0"
999999
@spec set_label(term()) :: :ok
1000-
def set_label(label) do
1001-
# TODO: switch to `:proc_lib.set_label/2` when we require Erlang/OTP 27+
1002-
Process.put(:"$process_label", label)
1003-
# mimic return value of `:proc_lib.set_label/2`
1004-
:ok
1005-
end
1000+
defdelegate set_label(label), to: :proc_lib
10061001

10071002
@compile {:inline, nilify: 1}
10081003
defp nilify(:undefined), do: nil

lib/elixir/lib/string.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3168,8 +3168,7 @@ defmodule String do
31683168
def jaro_distance("", _string), do: 0.0
31693169

31703170
def jaro_distance(string1, string2) when is_binary(string1) and is_binary(string2) do
3171-
# TODO: Replace by :string.jaro_similarity/2 when we require Erlang/OTP 27+
3172-
:elixir_utils.jaro_similarity(string1, string2)
3171+
:string.jaro_similarity(string1, string2)
31733172
end
31743173

31753174
@doc """

lib/elixir/pages/references/compatibility-and-deprecations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Erlang/OTP versioning is independent from the versioning of Elixir. Erlang relea
4949

5050
Elixir version | Supported Erlang/OTP versions
5151
:------------- | :-------------------------------
52-
1.20 | 26 - 28
52+
1.20 | 27 - 29
5353
1.19 | 26 - 28
5454
1.18 | 25 - 27
5555
1.17 | 25 - 27

0 commit comments

Comments
 (0)