Skip to content

Commit 98895fa

Browse files
committed
Fix bug when generating app PTL for the first time
Removes unnecessary checks for warnings when building the application PLT for the first time, these should be ignored until the actual analysis after both the base and application PLT are checked or created. Signed-off-by: Winford <[email protected]>
1 parent 48efb93 commit 98895fa

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

src/atomvm_dialyzer_provider.erl

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ do_dialize(Config, State) ->
126126
PLT = plt_absolute_name(State),
127127
case dialyzer:plt_info(PLT) of
128128
{ok, _} ->
129-
check_app_plt(Config, State);
129+
check_app_plt(State);
130130
_ ->
131-
do_build_plt(Config, State)
131+
do_build_plt(State)
132132
end,
133133
AppBEAMs = get_app_beam_abspath(State),
134134
rebar_api:info("Analyzing application with dialyzer...", []),
@@ -206,40 +206,33 @@ do_build_base_plt(Config) ->
206206
end.
207207

208208
% @private
209-
check_app_plt(Config, State) ->
209+
check_app_plt(State) ->
210210
rebar_api:info("Checking application PLT...", []),
211211
PLT = plt_absolute_name(State),
212212
try dialyzer:run([{analysis_type, plt_check}, {plts, [PLT]}]) of
213213
_ ->
214214
ok
215215
catch
216216
throw:{dialyzer_error, _} ->
217-
ok = do_build_plt(Config, State)
217+
ok = do_build_plt(State)
218218
end,
219219
ok.
220220

221221
% @private
222-
do_build_plt(Config, State) ->
222+
do_build_plt(State) ->
223223
rebar_api:info("Building application PLT...", []),
224224
%% build plt
225225
BEAMdir = string:trim(get_app_beam_abspath(State)),
226226
PLT = string:trim(plt_absolute_name(State)),
227-
BasePLT = base_plt_absname(Config),
228227
try
229228
dialyzer:run([
230229
{analysis_type, plt_build},
231-
{init_plt, PLT},
232-
{plts, [BasePLT]},
233230
{output_plt, PLT},
234231
{files_rec, [BEAMdir]}
235232
])
236233
of
237-
[] ->
238-
ok;
239-
Failure ->
240-
print_warnings(Failure),
241-
rebar_api:abort("Failed to create project plt!~n", []),
242-
{error, dialyzer_error}
234+
_ ->
235+
ok
243236
catch
244237
throw:{dialyzer_error, Error} ->
245238
rebar_api:abort("Failed to crete plt, error:~p~n", [Error]),

0 commit comments

Comments
 (0)