From 1aa2a26a341da05ff9420ac365b967b8be2d84a7 Mon Sep 17 00:00:00 2001 From: Jamu Kakar Date: Wed, 26 Jun 2019 22:13:53 -0700 Subject: rebar3 dialyzer: Warn when debug_info is disable --- src/rebar_prv_dialyzer.erl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl index 82b4012..500b591 100644 --- a/src/rebar_prv_dialyzer.erl +++ b/src/rebar_prv_dialyzer.erl @@ -474,6 +474,13 @@ proj_files(State) -> get_files(State, Apps, PltApps, [], PltMods). run_dialyzer(State, Opts, Output) -> + case debug_info(State) of + true -> + ok; + false -> + ?WARN("Add {erl_opts, [debug_info]} to rebar.config if Dialyzer fails to load Core Erlang.", []), + ok + end, %% dialyzer may return callgraph warnings when get_warnings is false case proplists:get_bool(get_warnings, Opts) of true -> @@ -539,6 +546,10 @@ 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). + -spec collect_nested_dependent_apps([atom()]) -> [atom()]. collect_nested_dependent_apps(RootApps) -> Deps = lists:foldl(fun collect_nested_dependent_apps/2, sets:new(), RootApps), -- cgit v1.1 From 68985ea883f93e8f3c5a6a0b3d4bc49497bf9177 Mon Sep 17 00:00:00 2001 From: Jamu Kakar Date: Fri, 28 Jun 2019 08:09:45 -0700 Subject: Use better warning message. --- src/rebar_prv_dialyzer.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl index 500b591..f16b795 100644 --- a/src/rebar_prv_dialyzer.erl +++ b/src/rebar_prv_dialyzer.erl @@ -478,7 +478,7 @@ run_dialyzer(State, Opts, Output) -> true -> ok; false -> - ?WARN("Add {erl_opts, [debug_info]} to rebar.config if Dialyzer fails to load Core Erlang.", []), + ?WARN("Add debug_info to compiler options (erl_opts) if Dialyzer fails to load Core Erlang.", []), ok end, %% dialyzer may return callgraph warnings when get_warnings is false @@ -548,7 +548,7 @@ get_config(State, Key, Default) -> debug_info(State) -> Config = rebar_state:get(State, erl_opts, []), - proplists:get_value(debug_info, Config, false). + proplists:get_value(debug_info, Config, true). -spec collect_nested_dependent_apps([atom()]) -> [atom()]. collect_nested_dependent_apps(RootApps) -> -- cgit v1.1 From 0c8a75d94b02a386df4327895f49b095eb864558 Mon Sep 17 00:00:00 2001 From: Jamu Kakar Date: Mon, 8 Jul 2019 21:03:30 -0700 Subject: Apply patch from ferd. --- src/rebar_prv_dialyzer.erl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl index f16b795..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 @@ -474,13 +481,6 @@ proj_files(State) -> get_files(State, Apps, PltApps, [], PltMods). run_dialyzer(State, Opts, Output) -> - case debug_info(State) of - true -> - ok; - false -> - ?WARN("Add debug_info to compiler options (erl_opts) if Dialyzer fails to load Core Erlang.", []), - ok - end, %% dialyzer may return callgraph warnings when get_warnings is false case proplists:get_bool(get_warnings, Opts) of true -> @@ -548,7 +548,9 @@ get_config(State, Key, Default) -> debug_info(State) -> Config = rebar_state:get(State, erl_opts, []), - proplists:get_value(debug_info, Config, true). + 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) -> -- cgit v1.1