diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-06-27 17:47:56 -0500 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-06-27 17:47:56 -0500 |
commit | 5012e06e68a168d102545ddd3fb0428715c08753 (patch) | |
tree | 1d84b4e90a580be07e632fa4a468ec82d4055adb /src/rebar_prv_dialyzer.erl | |
parent | e28ebaa95725698bfed110804e0448c073c98531 (diff) | |
parent | 99858f3b6902c4feb95620ce0125c52635bf8f00 (diff) |
Merge pull request #489 from kovyl2404/windows-ct-fix
Make test on windows green.
Diffstat (limited to 'src/rebar_prv_dialyzer.erl')
-rw-r--r-- | src/rebar_prv_dialyzer.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rebar_prv_dialyzer.erl b/src/rebar_prv_dialyzer.erl index 15f1dac..1cf7b71 100644 --- a/src/rebar_prv_dialyzer.erl +++ b/src/rebar_prv_dialyzer.erl @@ -72,6 +72,7 @@ short_desc() -> -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> + maybe_fix_env(), ?INFO("Dialyzer starting, this may take a while...", []), code:add_pathsa(rebar_state:code_paths(State, all_deps)), Plt = get_plt(State), @@ -91,6 +92,13 @@ do(State) -> rebar_utils:cleanup_code_path(rebar_state:code_paths(State, default)) end. +%% This is used to workaround dialyzer quirk discussed here +%% https://github.com/rebar/rebar3/pull/489#issuecomment-107953541 +%% Dialyzer gets default plt location wrong way by peeking HOME environment +%% variable which usually is not defined on Windows. +maybe_fix_env() -> + os:putenv("DIALYZER_PLT", filename:join(rebar_dir:home_dir(), ".dialyzer_plt")). + -spec format_error(any()) -> iolist(). format_error({error_processing_apps, Error}) -> io_lib:format("Error in dialyzing apps: ~s", [Error]); @@ -380,7 +388,7 @@ run_dialyzer(State, Opts, Output) -> {check_plt, false} | Opts], ?DEBUG("Running dialyzer with options: ~p~n", [Opts2]), - _ = dialyzer:run(Opts2), + dialyzer:run(Opts2), {0, State} end. |