From e1e6b68997108a1cd10fd9d2cd524173db439026 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Tue, 5 Jan 2021 21:04:27 +0000 Subject: [PATCH] OTP-24 Builds passing This does not get rid of all warnings. This fixes the HiPE dependency to be conditional to whether dialyzer actually requires it or not, and makes use of the .app.src.script feature internally, at build time. This may cause issues for scripts built prior to OTP-24 being used for OTP-24 versions as it will ask for apps that aren't in place, but there's no good work-around for that. This also bumps the erlware-commons version to one that eliminates some warnings, and makes the bootstrap script honor the warnings_as_errors value of dependencies to allow the build to proceed until parse_trans is fixed upstream. --- bootstrap | 5 ++++- rebar.config | 4 ++-- rebar.lock | 6 +++--- src/{rebar.app.src => rebar.app.src.script} | 8 ++++++-- 4 files changed, 15 insertions(+), 8 deletions(-) rename src/{rebar.app.src => rebar.app.src.script} (90%) diff --git a/bootstrap b/bootstrap index cd41321f..0ea87060 100755 --- a/bootstrap +++ b/bootstrap @@ -213,7 +213,10 @@ compile_erl_file(File, Opts) -> ok; {ok, _Mod, Ws} -> io:format("~s~n", [format_warnings(File, Ws)]), - halt(1); + case lists:member(warnings_as_errors, Opts) of + true -> halt(1); + false -> ok + end; {error, Es, Ws} -> io:format("~s ~s~n", [format_errors(File, Es), format_warnings(File, Ws)]), halt(1) diff --git a/rebar.config b/rebar.config index 896533b3..99af30ef 100644 --- a/rebar.config +++ b/rebar.config @@ -1,10 +1,10 @@ %% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- %% ex: ts=4 sw=4 ft=erlang et -{deps, [{erlware_commons, "1.3.1"}, +{deps, [{erlware_commons, "1.4.0"}, {ssl_verify_fun, "1.1.6"}, {certifi, "2.5.3"}, - {parse_trans, "3.3.0"}, % force otp-21 compat + {parse_trans, "3.3.0"}, {providers, "1.8.1"}, {getopt, "1.0.1"}, {bbmustache, "1.10.0"}, diff --git a/rebar.lock b/rebar.lock index 05f59e82..1e320c6e 100644 --- a/rebar.lock +++ b/rebar.lock @@ -3,7 +3,7 @@ {<<"certifi">>,{pkg,<<"certifi">>,<<"2.5.3">>},0}, {<<"cf">>,{pkg,<<"cf">>,<<"0.3.1">>},0}, {<<"cth_readable">>,{pkg,<<"cth_readable">>,<<"1.4.9">>},0}, - {<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.3.1">>},0}, + {<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.4.0">>},0}, {<<"eunit_formatters">>,{pkg,<<"eunit_formatters">>,<<"0.5.0">>},0}, {<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},0}, {<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.3.0">>},0}, @@ -16,7 +16,7 @@ {<<"certifi">>, <<"70BDD7E7188C804F3A30EE0E7C99655BC35D8AC41C23E12325F36AB449B70651">>}, {<<"cf">>, <<"5CB902239476E141EA70A740340233782D363A31EEA8AD37049561542E6CD641">>}, {<<"cth_readable">>, <<"034FB69795F11061980ECB62B40EF51DC10D4AC115B98FDB2C0CC71D851FBF98">>}, - {<<"erlware_commons">>, <<"0CE192AD69BC6FD0880246D852D0ECE17631E234878011D1586E053641ED4C04">>}, + {<<"erlware_commons">>, <<"F9EE38412E1413944BE78736DDB9BDB4C0664ABA5133563F4F3B359A8ED0AD52">>}, {<<"eunit_formatters">>, <<"6A9133943D36A465D804C1C5B6E6839030434B8879C5600D7DDB5B3BAD4CCB59">>}, {<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>}, {<<"parse_trans">>, <<"09765507A3C7590A784615CFD421D101AEC25098D50B89D7AA1D66646BC571C1">>}, @@ -28,7 +28,7 @@ {<<"certifi">>, <<"ED516ACB3929B101208A9D700062D520F3953DA3B6B918D866106FFA980E1C10">>}, {<<"cf">>, <<"315E8D447D3A4B02BCDBFA397AD03BBB988A6E0AA6F44D3ADD0F4E3C3BF97672">>}, {<<"cth_readable">>, <<"B4C6ABABDB046C5F2FBB3C22F030B4C5A679083956DCDD29C1DF0CB30B18DA24">>}, - {<<"erlware_commons">>, <<"7AADA93F368D0A0430122E39931B7FB4AC9E94DBF043CDC980AD4330FD9CD166">>}, + {<<"erlware_commons">>, <<"185ECF5CF43BAB3A013DDB3614CE7BBA7F6C7A827904E64E57DA54FCDFDCE2E6">>}, {<<"eunit_formatters">>, <<"D6C8BA213424944E6E05BBC097C32001CDD0ABE3925D02454F229B20D68763C9">>}, {<<"getopt">>, <<"53E1AB83B9CEB65C9672D3E7A35B8092E9BDC9B3EE80721471A161C10C59959C">>}, {<<"parse_trans">>, <<"17EF63ABDE837AD30680EA7F857DD9E7CED9476CDD7B0394432AF4BFC241B960">>}, diff --git a/src/rebar.app.src b/src/rebar.app.src.script similarity index 90% rename from src/rebar.app.src rename to src/rebar.app.src.script index 303ef27c..2f1a6a68 100644 --- a/src/rebar.app.src +++ b/src/rebar.app.src.script @@ -8,7 +8,6 @@ {registered, []}, {applications, [kernel, stdlib, - hipe, sasl, compiler, crypto, @@ -30,7 +29,12 @@ relx, cf, inets, - eunit_formatters]}, + eunit_formatters + % OTP 24 drops HiPE + | [hipe || _ <- [application:load(dialyzer)], + {ok, Apps} <- [application:get_key(dialyzer, applications)], + lists:member(hipe, Apps)] + ]}, {env, [ %% Default log level {log_level, warn},