Update to work on OTP 26

* erlang:stacktrace() has been deprecated a long time
* Update deps to OTP 26-compatible versions
* Add rebar3 lockfile
This commit is contained in:
Sean Cribbs 2024-07-15 09:29:53 -05:00 committed by Greg Burd
parent 68333fa51a
commit 0d651700ac
12 changed files with 64 additions and 34 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@ deps
*~
.eunit
.project
_build

View file

@ -26,14 +26,14 @@
{xref_checks, [undefined_function_calls]}.
{deps, [ {sext, ".*", {git, "git://github.com/uwiger/sext", {branch, "master"}}}
, {lager, ".*", {git, "git://github.com/basho/lager", {branch, "master"}}}
, {snappy, "1.*", {git, "git://github.com/fdmanana/snappy-erlang-nif.git", {branch, "master"}}}
, {plain_fsm, "1.*", {git, "git://github.com/gburd/plain_fsm", {branch, "master"}}}
% , {basho_bench, ".*", {git, "git://github.com/basho/basho_bench", {branch, "master"}}}
, {ebloom, ".*", {git, "git://github.com/basho/ebloom", {branch, "master"}}}
, {triq, ".*", {git, "git://github.com/krestenkrab/triq", {branch, "master"}}}
, {lz4, ".*", {git, "git://github.com/krestenkrab/erlang-lz4.git", {branch, "master"}}}
{deps, [ {sext, ".*", {git, "https://github.com/uwiger/sext.git", {branch, "master"}}}
, {lager, ".*", {git, "https://github.com/basho/lager.git", {branch, "master"}}}
, {snappy, "1.*", {git, "https://github.com/fdmanana/snappy-erlang-nif.git", {branch, "master"}}}
, {plain_fsm, "1.*", {git, "https://github.com/gburd/plain_fsm.git", {branch, "master"}}}
%% , {basho_bench, ".*", {git, "https://github.com/basho/basho_bench.git", {branch, "master"}}}
, {ebloom, ".*", {git, "https://github.com/basho/ebloom.git", {branch, "develop"}}}
, {triq, ".*", {git, "https://github.com/krestenkrab/triq.git", {branch, "master"}}}
, {lz4, ".*", {git, "https://github.com/krestenkrab/erlang-lz4.git", {branch, "master"}}}
% , {edown, "0.3.*", {git, "git://github.com/uwiger/edown.git", {branch, "master"}}}
% , {asciiedoc, "0.1.*", {git, "git://github.com/norton/asciiedoc.git", {branch, "master"}}}
% , {triq, ".*", {git, "git://github.com/krestenkrab/triq.git", {branch, "master"}}}

32
rebar.lock Normal file
View file

@ -0,0 +1,32 @@
[{<<"ebloom">>,
{git,"https://github.com/basho/ebloom.git",
{ref,"0a176b5b41cd418adeaa3747c8138e0e7da0adc7"}},
0},
{<<"goldrush">>,
{git,"https://github.com/basho/goldrush.git",
{ref,"8f1b715d36b650ec1e1f5612c00e28af6ab0de82"}},
1},
{<<"lager">>,
{git,"https://github.com/basho/lager.git",
{ref,"81eaef0ce98fdbf64ab95665e3bc2ec4b24c7dac"}},
0},
{<<"lz4">>,
{git,"https://github.com/krestenkrab/erlang-lz4.git",
{ref,"5fd90ca1e2345bdc359ee43d958da87fafb4fd78"}},
0},
{<<"plain_fsm">>,
{git,"https://github.com/gburd/plain_fsm.git",
{ref,"1de45fba4caccbc76df0b109e7581d0fc6a2e67b"}},
0},
{<<"sext">>,
{git,"https://github.com/uwiger/sext.git",
{ref,"c22486add9cc374dc8138b1f547c0999a1922a65"}},
0},
{<<"snappy">>,
{git,"https://github.com/fdmanana/snappy-erlang-nif.git",
{ref,"ceaceb4d964b33489ab76e2a281bec31a0e84e51"}},
0},
{<<"triq">>,
{git,"https://github.com/krestenkrab/triq.git",
{ref,"c7306b8eaea133d52140cb828817efb5e50a3d52"}},
0}].

View file

@ -24,7 +24,7 @@
{application, hanoidb,
[
{description, ""},
{description, "LSM-tree tiered storage engine with amortized merging"},
{vsn, "1.3.0"},
{registered, []},
{applications, [

View file

@ -210,9 +210,9 @@ receive_fold_range(MRef,PID,Fun,Acc0, Limit) ->
try
{ok, Fun(K,V,Acc0)}
catch
Class:Exception ->
Class:Exception:Stacktrace ->
% TODO ?log("Exception in hanoidb fold: ~p ~p", [Exception, erlang:get_stacktrace()]),
{'EXIT', Class, Exception, erlang:get_stacktrace()}
{'EXIT', Class, Exception, Stacktrace}
end
of
{ok, Acc1} ->

View file

@ -231,7 +231,7 @@ as_array(BM) ->
end.
%%%========== Bitarray representation - suitable for sparse arrays ==========
bitarray_new(N) -> array:new((N-1) div ?W + 1, {default, 0}).
%% bitarray_new(N) -> array:new((N-1) div ?W + 1, {default, 0}).
-ifdef(pre18).
-spec bitarray_set( non_neg_integer(), array() ) -> array().

View file

@ -79,10 +79,10 @@ start(SendTo) ->
initialize(#state{sendto=SendTo, sendto_ref=MRef}, []),
?log("fold_worker done ~p~n", [self()])
catch
Class:Ex ->
?log("fold_worker exception ~p:~p ~p~n", [Class, Ex, erlang:get_stacktrace()]),
error_logger:error_msg("Unexpected: ~p:~p ~p~n", [Class, Ex, erlang:get_stacktrace()]),
exit({bad, Class, Ex, erlang:get_stacktrace()})
Class:Ex:Stacktrace ->
?log("fold_worker exception ~p:~p ~p~n", [Class, Ex, Stacktrace]),
error_logger:error_msg("Unexpected: ~p:~p ~p~n", [Class, Ex, Stacktrace]),
exit({bad, Class, Ex, Stacktrace})
end
end,
PID = plain_fsm:spawn(?MODULE, F),
@ -231,5 +231,3 @@ data_vsn() ->
code_change(_OldVsn, _State, _Extra) ->
{ok, {#state{}, data_vsn()}}.

View file

@ -159,9 +159,9 @@ initialize(State) ->
_Result = initialize2(State),
?log(" ** terminated ~p", [_Result])
catch
Class:Ex when not (Class == exit andalso Ex == normal) ->
?log("crashing ~p:~p ~p~n", [Class,Ex,erlang:get_stacktrace()]),
error_logger:error_msg("crash: ~p:~p ~p~n", [Class,Ex,erlang:get_stacktrace()])
Class:Ex:Stacktrace when not (Class == exit andalso Ex == normal) ->
?log("crashing ~p:~p ~p~n", [Class,Ex,Stacktrace]),
error_logger:error_msg("crash: ~p:~p ~p~n", [Class,Ex,Stacktrace])
end.
initialize2(State) ->

View file

@ -54,11 +54,11 @@ start(A,B,X, Size, IsLastLevel, Options) ->
Owner ! ?CAST(self(),{merge_done, OutCount, X})
catch
C:E ->
C:E:Stacktrace ->
%% this semi-bogus code makes sure we always get a stack trace if merging fails
error_logger:error_msg("~p: merge failed ~p:~p ~p -> ~s~n",
[self(), C,E,erlang:get_stacktrace(), X]),
erlang:raise(C,E,erlang:get_stacktrace())
[self(), C,E,Stacktrace, X]),
erlang:raise(C,E,Stacktrace)
end
end).

View file

@ -376,8 +376,8 @@ lookup_in_node(File,#node{members=Members},Key) ->
end),
try plain_rpc:call(PID, read)
catch
Class:Ex ->
error_logger:error_msg("crashX: ~p:~p ~p~n", [Class,Ex,erlang:get_stacktrace()]),
Class:Ex:Stacktrace ->
error_logger:error_msg("crashX: ~p:~p ~p~n", [Class,Ex,Stacktrace]),
not_found
end;

View file

@ -56,7 +56,7 @@
-define(BISECT_ENCODED, 126).
-define(FILE_ENCODING, bisect).
-define(FILE_ENCODING, hanoi2).
-compile({inline, [crc_encapsulate/1, crc_encapsulate_kv_entry/2 ]}).
@ -298,8 +298,8 @@ ensure_expiry(Opts) ->
undefined ->
try exit(err)
catch
exit:err ->
io:format(user, "~p~n", [erlang:get_stacktrace()])
exit:err:Stacktrace ->
io:format(user, "~p~n", [Stacktrace])
end,
exit(expiry_secs_not_set);
N when N >= 0 ->
@ -345,4 +345,3 @@ bloom_contains({sbloom, Bloom}, Key) ->
hanoidb_bloom:member(Key, Bloom);
bloom_contains({ebloom, Bloom}, Key) ->
ebloom:contains(Bloom, Key).

View file

@ -48,9 +48,9 @@ function periodic() {
}
merge_diff() {
SA=`ls -l A-${ID}.data 2> /dev/null | awk '{print $5}'`
SB=`ls -l B-${ID}.data 2> /dev/null | awk '{print $5}'`
SX=`ls -l X-${ID}.data 2> /dev/null | awk '{print $5}'`
SA=`/bin/ls -l A-${ID}.data 2> /dev/null | awk '{print $5}'`
SB=`/bin/ls -l B-${ID}.data 2> /dev/null | awk '{print $5}'`
SX=`/bin/ls -l X-${ID}.data 2> /dev/null | awk '{print $5}'`
if [ \( -n "$SA" \) -a \( -n "$SB" \) -a \( -n "$SX" \) ]; then
export RES=`expr ${SX}0 / \( $SA + $SB \)`
else
@ -64,7 +64,7 @@ function dynamic() {
start=`date +%s`
while true ; do
s=""
for ((i=8; i<22; i++)) ; do
for ((i=10; i<22; i++)) ; do
if [ -f "C-$i.data" ] ; then
s="${s}C"
else