You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2024/06/06 20:28:38 UTC

(couchdb) branch main updated: Move to Erlang 25 minimum

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 0713a058d Move to Erlang 25 minimum
0713a058d is described below

commit 0713a058d11743991414b9c9640dcc4026026acc
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Thu Jun 6 12:14:19 2024 -0400

    Move to Erlang 25 minimum
    
    This lets us remove a few ifdefs and a compat module.
---
 build-aux/Jenkinsfile.full                 |  4 +--
 build-aux/Jenkinsfile.pr                   |  4 +--
 rebar.config.script                        |  3 +--
 src/couch/src/couch_lists.erl              | 40 ------------------------------
 src/couch/src/couch_passwords.erl          | 23 -----------------
 src/couch/test/eunit/couch_lists_tests.erl | 30 ----------------------
 src/docs/src/install/unix.rst              |  2 +-
 src/mango/src/mango_idx_nouveau.erl        |  2 +-
 src/mango/src/mango_idx_text.erl           |  2 +-
 9 files changed, 8 insertions(+), 102 deletions(-)

diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full
index 20426f114..66356c5dd 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -14,11 +14,11 @@
 // the License.
 
 // Erlang version embedded in binary packages
-ERLANG_VERSION = '24.3.4.17'
+ERLANG_VERSION = '25.3.2.12'
 
 // Erlang version used for rebar in release process. CouchDB will not build from
 // the release tarball on Erlang versions older than this
-MINIMUM_ERLANG_VERSION = '24.3.4.17'
+MINIMUM_ERLANG_VERSION = '25.3.2.12'
 
 // We create parallel build / test / package stages for each OS using the metadata
 // in this map. Adding a new OS should ideally only involve adding a new entry here.
diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index d6a5ea571..cdaca9f95 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -50,7 +50,7 @@ pipeline {
     // Search for ERLANG_VERSION
     // see https://issues.jenkins.io/browse/JENKINS-61047 for why this cannot
     // be done parametrically
-    LOW_ERLANG_VER = '24.3.4.17'
+    LOW_ERLANG_VER = '25.3.2.12'
   }
 
   options {
@@ -247,7 +247,7 @@ pipeline {
         axes {
           axis {
             name 'ERLANG_VERSION'
-            values '24.3.4.17', '25.3.2.12', '26.2.5'
+            values '25.3.2.12', '26.2.5'
           }
           axis {
             name 'SM_VSN'
diff --git a/rebar.config.script b/rebar.config.script
index 8af2d1cee..e3a075019 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -86,7 +86,6 @@ end.
 case VerList of
     % Leave example around if we have to exlude specific versions
     % [22, 0, N | _] when N < 5 -> BadErlang(VerString);
-    [24, 3, 4, N | _] when N < 17 -> BadErlang(VerString);
     [25, 3, 2, N | _] when N < 10 -> BadErlang(VerString);
     [26, 2, N | _] when N < 3 -> BadErlang(VerString);
     _ -> ok
@@ -194,7 +193,7 @@ end.
 AddConfig = [
     {cover_enabled, true},
     {cover_print_enabled, true},
-    {require_otp_vsn, "24|25|26|27"},
+    {require_otp_vsn, "25|26|27"},
     {deps_dir, "src"},
     {deps, lists:map(MakeDep, DepDescs ++ OptionalDeps)},
     {sub_dirs, SubDirs},
diff --git a/src/couch/src/couch_lists.erl b/src/couch/src/couch_lists.erl
deleted file mode 100644
index acb99f7f3..000000000
--- a/src/couch/src/couch_lists.erl
+++ /dev/null
@@ -1,40 +0,0 @@
-% Licensed under the Apache License, Version 2.0 (the "License"); you may not
-% use this file except in compliance with the License. You may obtain a copy of
-% the License at
-%
-%   http://www.apache.org/licenses/LICENSE-2.0
-%
-% Unless required by applicable law or agreed to in writing, software
-% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-% License for the specific language governing permissions and limitations under
-% the License.
-
--module(couch_lists).
-
--export([uniq/1]).
-
-%% uniq/1: return a new list with the unique elements of the given list
-
--spec uniq(List1) -> List2 when
-    List1 :: [T],
-    List2 :: [T],
-    T :: term().
-
--if((?OTP_RELEASE) >= 25).
-uniq(L) ->
-    lists:uniq(L).
--else.
-uniq(L) ->
-    uniq_1(L, #{}).
-
-uniq_1([X | Xs], M) ->
-    case is_map_key(X, M) of
-        true ->
-            uniq_1(Xs, M);
-        false ->
-            [X | uniq_1(Xs, M#{X => true})]
-    end;
-uniq_1([], _) ->
-    [].
--endif.
diff --git a/src/couch/src/couch_passwords.erl b/src/couch/src/couch_passwords.erl
index 3d23fccae..74f35e42e 100644
--- a/src/couch/src/couch_passwords.erl
+++ b/src/couch/src/couch_passwords.erl
@@ -132,7 +132,6 @@ pbkdf2(PRF, Password, Salt, Iterations, KeyLen) when
     throw({forbidden, Msg}).
 
 %% verify two lists for equality without short-circuits to avoid timing attacks.
--if((?OTP_RELEASE) >= 25).
 verify(ListA, ListB) when is_list(ListA), is_list(ListB) ->
     verify(?l2b(ListA), ?l2b(ListB));
 verify(BinA, BinB) when is_binary(BinA), is_binary(BinB), byte_size(BinA) == byte_size(BinB) ->
@@ -141,25 +140,3 @@ verify(BinA, BinB) when is_binary(BinA), is_binary(BinB) ->
     false;
 verify(_A, _B) ->
     false.
--else.
--spec verify(string(), string(), integer()) -> boolean().
-verify([X | RestX], [Y | RestY], Result) ->
-    verify(RestX, RestY, (X bxor Y) bor Result);
-verify([], [], Result) ->
-    Result == 0.
-
--spec verify
-    (binary(), binary()) -> boolean();
-    (list(), list()) -> boolean().
-verify(<<X/binary>>, <<Y/binary>>) ->
-    verify(?b2l(X), ?b2l(Y));
-verify(X, Y) when is_list(X) and is_list(Y) ->
-    case length(X) == length(Y) of
-        true ->
-            verify(X, Y, 0);
-        false ->
-            false
-    end;
-verify(_X, _Y) ->
-    false.
--endif.
diff --git a/src/couch/test/eunit/couch_lists_tests.erl b/src/couch/test/eunit/couch_lists_tests.erl
deleted file mode 100644
index 2fae71562..000000000
--- a/src/couch/test/eunit/couch_lists_tests.erl
+++ /dev/null
@@ -1,30 +0,0 @@
-% Licensed under the Apache License, Version 2.0 (the "License"); you may not
-% use this file except in compliance with the License. You may obtain a copy of
-% the License at
-%
-%   http://www.apache.org/licenses/LICENSE-2.0
-%
-% Unless required by applicable law or agreed to in writing, software
-% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-% License for the specific language governing permissions and limitations under
-% the License.
-
--module(couch_lists_tests).
-
--include_lib("couch/include/couch_eunit.hrl").
-
-uniq_test_() ->
-    [
-        ?_assertEqual([], couch_lists:uniq([])),
-        ?_assertEqual(lists:seq(1, 100), couch_lists:uniq(lists:seq(1, 100))),
-        ?_assertEqual(lists:seq(100, 1, -1), couch_lists:uniq(lists:seq(100, 1, -1))),
-        ?_assertEqual(
-            [1, 2, 3, 4],
-            couch_lists:uniq([1, 2, 2, 3, 3, 3, 4, 4, 4, 4])
-        ),
-        ?_assertEqual(
-            [5, 1, 3, 2, 8],
-            couch_lists:uniq([5, 1, 1, 5, 5, 3, 2, 5, 3, 3, 2, 3, 8, 2, 2, 8])
-        )
-    ].
diff --git a/src/docs/src/install/unix.rst b/src/docs/src/install/unix.rst
index 4686cfe36..8d1548514 100644
--- a/src/docs/src/install/unix.rst
+++ b/src/docs/src/install/unix.rst
@@ -158,7 +158,7 @@ Dependencies
 
 You should have the following installed:
 
-* `Erlang OTP (24.x, 25.x)      <http://erlang.org/>`_
+* `Erlang OTP (25, 26, 27)      <http://erlang.org/>`_
 * `ICU                          <http://icu-project.org/>`_
 * `OpenSSL                      <http://www.openssl.org/>`_
 * `Mozilla SpiderMonkey (1.8.5, 60, 68, 78, 91) <https://spidermonkey.dev/>`_
diff --git a/src/mango/src/mango_idx_nouveau.erl b/src/mango/src/mango_idx_nouveau.erl
index d37721380..33c76a57d 100644
--- a/src/mango/src/mango_idx_nouveau.erl
+++ b/src/mango/src/mango_idx_nouveau.erl
@@ -312,7 +312,7 @@ indexable_fields({[]}) ->
     [];
 indexable_fields(Selector) ->
     TupleTree = mango_selector_text:convert([], Selector),
-    couch_lists:uniq(indexable_fields([], TupleTree)).
+    lists:uniq(indexable_fields([], TupleTree)).
 
 indexable_fields(Fields, {op_and, Args}) when is_list(Args) ->
     lists:foldl(
diff --git a/src/mango/src/mango_idx_text.erl b/src/mango/src/mango_idx_text.erl
index 1f6ede04e..8890eb96c 100644
--- a/src/mango/src/mango_idx_text.erl
+++ b/src/mango/src/mango_idx_text.erl
@@ -320,7 +320,7 @@ indexable_fields({[]}) ->
     [];
 indexable_fields(Selector) ->
     TupleTree = mango_selector_text:convert([], Selector),
-    couch_lists:uniq(indexable_fields([], TupleTree)).
+    lists:uniq(indexable_fields([], TupleTree)).
 
 -spec indexable_fields(Fields, abstract_text_selector()) -> Fields when
     Fields :: [binary()].