Skip to content

Commit 5a03a1e

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 <winford@object.stream>
1 parent 8361958 commit 5a03a1e

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/atomvm_dialyzer_provider.erl

Lines changed: 7 additions & 13 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...", []),
@@ -204,39 +204,33 @@ do_build_base_plt(Config) ->
204204
end.
205205

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

219219
% @private
220-
do_build_plt(Config, State) ->
220+
do_build_plt(State) ->
221221
rebar_api:info("Building application PLT...", []),
222222
%% build plt
223223
BEAMdir = string:trim(get_app_beam_abspath(State)),
224224
PLT = string:trim(plt_absolute_name(State)),
225-
BasePLT = base_plt_absname(Config),
226225
try
227226
dialyzer:run([
228227
{analysis_type, plt_build},
229-
{init_plt, PLT},
230-
{plts, [BasePLT]},
231228
{output_plt, PLT},
232229
{files_rec, [BEAMdir]}
233230
])
234231
of
235-
[] ->
236-
ok;
237-
Failure ->
238-
print_warnings(Failure),
239-
rebar_api:abort("Failed to create project plt!~n", [])
232+
_ ->
233+
ok
240234
catch
241235
throw:{dialyzer_error, Error} ->
242236
rebar_api:abort("Failed to crete plt, error: ~p~n", [Error])

0 commit comments

Comments
 (0)