Skip to content

Commit

Permalink
Prepare for OTP-27 (#4275)
Browse files Browse the repository at this point in the history
* Rename a function else to else_do

* Replace maybe with 'maybe'

* Bump aesophia and aesophia_cli

* OPT-27: fix compiler warnings (test)

* Bump versions to avoid OTP26/27 warnings

* Add modern rebar3, works with OTP26/27

* Bump a (final?) dependency

* Make sure wx is not packaged
  • Loading branch information
hanssv committed Mar 13, 2024
1 parent 5e3e499 commit 0868e4d
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 66 deletions.
2 changes: 2 additions & 0 deletions apps/aecontract/test/aecontract_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
%%%-------------------------------------------------------------------
-module(aecontract_SUITE).

-compile([nowarn_update_literal]).

%% common_test exports
-export([ all/0
, groups/0
Expand Down
8 changes: 4 additions & 4 deletions apps/aecore/src/aec_sync.erl
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,18 @@ handle_worker(Task, Action) ->
opt_call(Req, Else) ->
case sync_running() of
true -> gen_server:call(?MODULE, Req);
false -> else(Else)
false -> else_do(Else)
end.

opt_call(Req, Timeout, Else) ->
case sync_running() of
true -> gen_server:call(?MODULE, Req, Timeout);
false -> else(Else)
false -> else_do(Else)
end.

else(F) when is_function(F, 0) ->
else_do(F) when is_function(F, 0) ->
F();
else(Else) ->
else_do(Else) ->
Else.

%% When we Ping a node with at least as much difficulty as we have,
Expand Down
2 changes: 1 addition & 1 deletion apps/aecore/src/aec_tx_pool_sync.erl
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ analyze_unfolds([N = {node, Path, Node} | Us], Tree, NewUs, NewGets) ->
case aeu_mp_trees:has_node(Path, Node, Tree) of
no ->
analyze_unfolds(Us, Tree, [{subtree, Path} | NewUs], NewGets);
maybe ->
'maybe' ->
analyze_unfolds(Us, Tree, [N | NewUs], NewGets);
yes ->
analyze_unfolds(Us, Tree, NewUs, NewGets)
Expand Down
15 changes: 0 additions & 15 deletions apps/aecore/test/aecore_suite_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -732,21 +732,6 @@ wait_for_tx_in_pool(Node, SignedTx, Timeout) ->
ok = unsubscribe(Node, tx_received)
end.

wait_for_tx_included_in_chain(Node, SignedTx) ->
wait_for_tx_included_in_chain(Node, SignedTx, 100).

wait_for_tx_included_in_chain(_Node, SignedTx, Attempts) when Attempts < 1 ->
error({run_out_of_attempts, SignedTx});
wait_for_tx_included_in_chain(Node, SignedTx, Attempts) ->
Hash = aetx_sign:hash(SignedTx),
case rpc:call(Node, aec_chain, find_tx_location, [Hash]) of
B when is_binary(B) -> ok;
none -> error({already_gc, SignedTx});
_ ->
timer:sleep(10),
wait_for_tx_included_in_chain(Node, SignedTx, Attempts - 1)
end.

mine_blocks_until_txs_on_chain(Node, TxHashes, MaxBlocks) ->
mine_blocks_until_txs_on_chain(Node, TxHashes, ?DEFAULT_CUSTOM_EXPECTED_MINE_RATE, MaxBlocks).

Expand Down
8 changes: 4 additions & 4 deletions apps/aeutils/src/aeu_mp_trees.erl
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ unfold(<<>>, _, #mpt{ hash = Hash, db = DB }) ->
unfold(PrefixPath, Node, #mpt{ db = DB }) ->
int_unfold(PrefixPath, decode_node(Node, DB), DB).

-spec has_node(path(), enc_node(), tree()) -> yes | no | maybe.
-spec has_node(path(), enc_node(), tree()) -> yes | no | 'maybe'.
has_node(Path, Node, T = #mpt{ hash = Root, db = DB }) ->
try decode_node(Node, DB) of
{'leaf', NodePath, Val} ->
Expand Down Expand Up @@ -605,7 +605,7 @@ int_has_node(<<Next:4>>, Node, {branch, Branch}, _DB) ->
case branch_next(Next, Branch) of
<<>> -> no;
Node -> yes;
_ -> maybe
_ -> 'maybe'
end;
int_has_node(<<Next:4, Rest/bits>>, Node, {branch, Branch}, DB) ->
NextEncoded = branch_next(Next, Branch),
Expand All @@ -622,15 +622,15 @@ int_has_node(Path, Node, {Type, NodePath, NodeVal}, DB)
S1 = bit_size(Path),
case NodePath of
<<Path:S1/bits, _/bits>> ->
maybe;
'maybe';
_ ->
no
end
end;
int_has_node(_, _, <<>>, _) ->
no;
int_has_node(<<>>, _, {branch, _Branch}, _DB) ->
maybe.
'maybe'.

%%%===================================================================
%%% Reachable store nodes (useful for implementing GC).
Expand Down
45 changes: 22 additions & 23 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,24 @@
{setup, "2.1.1"},
{gproc, "0.9.0"},
{jobs, "0.9.0"},
{exometer_core, "1.6.0"},
{exometer_core, "2.0.0"},
{trace_runner, "1.0.0"},
{yamerl, "0.7.0"},
{sext, "1.8.0"},
{argparse, {git, "https://github.com/aeternity/argparse", {ref, "a3d8aa0"}}},
{redbug, {git, "https://github.com/shiguredo/redbug.git",
{ref, "12bd0e0fb31d3a25219d70f53025bd27d0ef2119"}}}, % tag: 2.0.7
{redbug, {git, "https://github.com/massemanet/redbug.git", {ref, "325cb63"}}},
{kache, {git, "https://github.com/klarna-incubator/kache.git", {ref, "e5e10c6"}}},


%% lager version with trace-based msg suppression (merged upstream)
{lager, {git, "https://github.com/erlang-lager/lager.git",
{ref, "fae5339"}}},
{lager, {git, "https://github.com/aeternity/lager.git",
{ref, "a119ed7"}}},
{app_ctrl, {git, "https://github.com/aeternity/app_ctrl.git", {ref, "c1fb927"}}},

{cowboy, {git, "https://github.com/ninenines/cowboy.git",
{ref, "04ca4c5"}}}, % tag: 2.9.0"
{tag, "2.11.0"}}},
{idna, {git, "https://github.com/benoitc/erlang-idna",
{ref, "6cff727"}}}, % tag: 6.0.0
{nat, {git, "https://github.com/benoitc/erlang-nat.git",
{ref, "6136102"}}},
{nat, {git, "https://github.com/aeternity/erlang-nat.git",
{ref, "da8b260"}}},
{jsx, {git, "https://github.com/talentdeficit/jsx.git",
{ref, "3074d48"}}},
{lz4, {git, "https://github.com/szktty/erlang-lz4.git",
Expand Down Expand Up @@ -93,7 +90,7 @@
{ref, "67fceef"}}},

{jesse, {git, "https://github.com/for-GET/jesse.git",
{tag, "1.5.5"}}},
{ref, "cf075d2"}}},

% upstream is not maintained anymore
{base58, {git, "https://github.com/aeternity/erl-base58.git",
Expand All @@ -105,13 +102,13 @@

% for the online telecom style CLI
{ecli, {git, "https://github.com/mgmtd/ecli",
{ref, "eb06324"}}}
{ref, "d9f871e"}}}

]}.

{plugins, [
{swagger_endpoints, {git, "https://github.com/aeternity/swagger_endpoints", {ref, "dc758c6"}}}
]}.
{swagger_endpoints, {git, "https://github.com/aeternity/swagger_endpoints", {ref, "dcbfb26"}}}
]}.

{swagger_endpoints, [{src, "apps/aehttp/priv/swagger.yaml"}, {dst, "apps/aeutils/src/endpoints.erl"}]}.

Expand All @@ -123,6 +120,11 @@
parse_trans, exometer_core, ranch, aeminer, aecore, aeapi, aehttp, enacl, enoise,
aebytecode, aeserialization, aevm, aechannel, aefate, aemon, aestratum, ecrecover,
aesync, ecli, aedevmode]},

%% Make sure wx doesn't get included - from OTP-27 it is listed
%% as an optional dependency for observer.
{exclude_apps, [wx]},

{sys_config, "./config/sys.config"},
{vm_args, "./config/vm.args"},

Expand Down Expand Up @@ -216,10 +218,10 @@
{dist_node, [{setcookie, 'aeternity_cookie'},
{sname, 'aeternity_ct@localhost'}]},
{deps, [{meck, "0.8.12"},
{aesophia, {git, "https://github.com/aeternity/aesophia.git", {tag,"v8.0.0-rc1"}}},
{aesophia_cli, {git, "https://github.com/aeternity/aesophia_cli", {tag,"v8.0.0-rc1"}}},
{aestratum_client, {git, "https://github.com/aeternity/aestratum_client", {ref, "438a3aa"}}},
{websocket_client, {git, "https://github.com/aeternity/websocket_client", {ref, "95ef9de"}}},
{aesophia, {git, "https://github.com/aeternity/aesophia.git", {ref,"3130191"}}},
{aesophia_cli, {git, "https://github.com/aeternity/aesophia_cli", {ref,"e0a1730"}}},
{aestratum_client, {git, "https://github.com/aeternity/aestratum_client", {ref, "cfd406a"}}},
{websocket_client, {git, "https://github.com/aeternity/websocket_client", {ref, "506d8e2"}}},
{aesophia_aci_encoder, {git, "https://github.com/aeternity/aesophia_aci_encoder", {ref, "f4d60c2"}}}
]}
]},
Expand Down Expand Up @@ -262,12 +264,9 @@
{escript_comment, "%%\n"}.

{overrides, [
{add, jesse, [{erl_opts, [nowarn_match_float_zero]}]},

{add, bear, [{erl_opts, [nowarn_match_float_zero]}]},
{add, bear, [{erl_opts, [nowarn_match_float_zero]}]}
]}.

{add, redbug, [{erl_opts, [nowarn_match_float_zero]}]}
]}.

{provider_hooks,
[{pre, []},
Expand Down
32 changes: 13 additions & 19 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,18 @@
{git,"https://github.com/aeternity/erl-base58.git",
{ref,"60a335668a60328a29f9731b67c4a0e9e3d50ab6"}},
0},
{<<"bear">>,{pkg,<<"bear">>,<<"1.0.0">>},2},
{<<"cowboy">>,
{git,"https://github.com/ninenines/cowboy.git",
{ref,"04ca4c5d31a92d4d3de087bbd7d6021dc4a6d409"}},
{ref,"81f3a21474155f68fbf494b7026b9678027d303e"}},
0},
{<<"cowlib">>,
{git,"https://github.com/ninenines/cowlib",
{ref,"e9448e5628c8c1d9083223ff973af8de31a566d1"}},
{ref,"cc04201c1d0e1d5603cd1cde037ab729b192634c"}},
1},
{<<"eblake2">>,{pkg,<<"eblake2">>,<<"1.0.0">>},1},
{<<"ecli">>,
{git,"https://github.com/mgmtd/ecli",
{ref,"eb06324708f3c83e5954d6596dbf15226f9ecb75"}},
{ref,"d9f871e309a33ec5c80339aa50c53392ccdd3fdd"}},
0},
{<<"ecrecover">>,
{git,"https://github.com/aeternity/ecrecover.git",
Expand All @@ -66,8 +65,7 @@
{git,"https://github.com/aeternity/enoise.git",
{ref,"8acbce92695fb3ef37d8b0204d4dbfed41c6aa74"}},
0},
{<<"exometer_core">>,{pkg,<<"exometer_core">>,<<"1.6.0">>},0},
{<<"folsom">>,{pkg,<<"folsom">>,<<"1.0.0">>},1},
{<<"exometer_core">>,{pkg,<<"exometer_core">>,<<"2.0.0">>},0},
{<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},1},
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1},
{<<"gproc">>,{pkg,<<"gproc">>,<<"0.9.0">>},0},
Expand All @@ -82,7 +80,7 @@
{<<"intercept">>,{pkg,<<"intercept">>,<<"1.0.0">>},1},
{<<"jesse">>,
{git,"https://github.com/for-GET/jesse.git",
{ref,"1b5a16cc40c9b299ec825abcaf54a4bf140c4ba9"}},
{ref,"cf075d213ae9e9c54a748c93cc64d5350e646f9a"}},
0},
{<<"jobs">>,{pkg,<<"jobs">>,<<"0.9.0">>},0},
{<<"jsx">>,
Expand All @@ -94,8 +92,8 @@
{ref,"e5e10c6e0a31713f3e3c6bd102db5af20f8e1077"}},
0},
{<<"lager">>,
{git,"https://github.com/erlang-lager/lager.git",
{ref,"fae53399253da622afde3bf5fb5ff124b7d887fa"}},
{git,"https://github.com/aeternity/lager.git",
{ref,"a119ed7473f41e694985a692a6c645348f71c9e5"}},
0},
{<<"lz4">>,
{git,"https://github.com/szktty/erlang-lz4.git",
Expand All @@ -106,8 +104,8 @@
{ref,"0aecf5ef0192c9d130b9b0aabd8656d27d278815"}},
0},
{<<"nat">>,
{git,"https://github.com/benoitc/erlang-nat.git",
{ref,"6136102c176814dd26c11b93ca0ce852b66c4195"}},
{git,"https://github.com/aeternity/erlang-nat.git",
{ref,"da8b260ba34ecb307561d190d402c145a9b4003c"}},
0},
{<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.4.1">>},1},
{<<"ranch">>,
Expand All @@ -116,8 +114,8 @@
1},
{<<"rand_compat">>,{pkg,<<"rand_compat">>,<<"0.0.3">>},1},
{<<"redbug">>,
{git,"https://github.com/shiguredo/redbug.git",
{ref,"12bd0e0fb31d3a25219d70f53025bd27d0ef2119"}},
{git,"https://github.com/massemanet/redbug.git",
{ref,"325cb63f5d589a3c9c48fee8620e960421a4b584"}},
0},
{<<"rfc3339">>,{pkg,<<"rfc3339">>,<<"0.2.2">>},1},
{<<"rocksdb">>,
Expand All @@ -135,10 +133,8 @@
{<<"yamerl">>,{pkg,<<"yamerl">>,<<"0.7.0">>},0}]}.
[
{pkg_hash,[
{<<"bear">>, <<"430419C1126B477686CDE843E88BA0F2C7DC5CDF0881C677500074F704339A99">>},
{<<"eblake2">>, <<"EC8AD20E438AAB3F2E8D5D118C366A0754219195F8A0F536587440F8F9BCF2EF">>},
{<<"exometer_core">>, <<"7E1D4D8D05FE4E33B96EBA366B4A7C85F0E023573CAF297F13E83CF17A5E3941">>},
{<<"folsom">>, <<"50ECC998D2149939F1D5E0AA3E32788F8ED16A58E390D81B5C0BE4CC4EF25589">>},
{<<"exometer_core">>, <<"F19461FAE97B3AA70B6D2D586EE8101152916CB7884B973516F1F82C224CF7AD">>},
{<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>},
{<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>},
{<<"gproc">>, <<"853CCB7805E9ADA25D227A157BA966F7B34508F386A3E7E21992B1B484230699">>},
Expand All @@ -157,10 +153,8 @@
{<<"unicode_util_compat">>, <<"D869E4C68901DD9531385BB0C8C40444EBF624E60B6962D95952775CAC5E90CD">>},
{<<"yamerl">>, <<"E51DBA652DCE74C20A88294130B48051EBBBB0BE7D76F22DE064F0F3CCF0AAF5">>}]},
{pkg_hash_ext,[
{<<"bear">>, <<"157B67901ADF84FF0DA6EAE035CA1292A0AC18AA55148154D8C582B2C68959DB">>},
{<<"eblake2">>, <<"3C4D300A91845B25D501929A26AC2E6F7157480846FAB2347A4C11AE52E08A99">>},
{<<"exometer_core">>, <<"B539E97DBB3137E0FE0B782C561CACB64C9704CB3F19451442B6FDF46DB95B38">>},
{<<"folsom">>, <<"DD6AB97278E94F9E4CFC43E188224A7B8C7EAEC0DD2E935007005177F3EEBB0E">>},
{<<"exometer_core">>, <<"AEA333E830A33BE0D7BC60701BBDC899566DE9387A4DE8649412FCBD309633A4">>},
{<<"getopt">>, <<"53E1AB83B9CEB65C9672D3E7A35B8092E9BDC9B3EE80721471A161C10C59959C">>},
{<<"goldrush">>, <<"99CB4128CFFCB3227581E5D4D803D5413FA643F4EB96523F77D9E6937D994CEB">>},
{<<"gproc">>, <<"587E8AF698CCD3504CF4BA8D90F893EDE2B0F58CABB8A916E2BF9321DE3CF10B">>},
Expand Down
Binary file modified rebar3
Binary file not shown.

0 comments on commit 0868e4d

Please sign in to comment.