summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2019-07-09 07:55:22 -0400
committerGitHub <noreply@github.com>2019-07-09 07:55:22 -0400
commit76935555f3587d160e7ed87ff61f744f822f8d37 (patch)
tree8271a07e0ebcf96b7b996c90302131ee2ef33a12
parent57237d442ea8bcbfb35239a613dc29e73ef736b8 (diff)
parent0c8a75d94b02a386df4327895f49b095eb864558 (diff)
Merge pull request #2111 from jkakar/dialyzer-warn-without-debug-info
rebar3 dialyzer: Warn when debug_info is disabled
-rw-r--r--src/rebar_prv_dialyzer.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl
index 82b4012..1de978b 100644
--- a/src/rebar_prv_dialyzer.erl
+++ b/src/rebar_prv_dialyzer.erl
@@ -155,6 +155,13 @@ plt_name(Prefix) ->
do(Args, State, Plt) ->
Output = get_output_file(State),
+ case debug_info(State) of
+ true ->
+ ok;
+ false ->
+ ?WARN("Add debug_info to compiler options (erl_opts) "
+ "if Dialyzer fails to load Core Erlang.", [])
+ end,
{PltWarnings, State1} = update_proj_plt(Args, State, Plt, Output),
{Warnings, State2} = succ_typings(Args, State1, Plt, Output),
case PltWarnings + Warnings of
@@ -539,6 +546,12 @@ get_config(State, Key, Default) ->
Config = rebar_state:get(State, dialyzer, []),
proplists:get_value(Key, Config, Default).
+debug_info(State) ->
+ Config = rebar_state:get(State, erl_opts, []),
+ proplists:get_value(debug_info, Config, false) =/= false orelse
+ proplists:get_value(debug_info_key, Config, false) =/= false orelse
+ proplists:get_value(encrypt_debug_info, Config, false) =/= false.
+
-spec collect_nested_dependent_apps([atom()]) -> [atom()].
collect_nested_dependent_apps(RootApps) ->
Deps = lists:foldl(fun collect_nested_dependent_apps/2, sets:new(), RootApps),