In an Umbrella child and no PLT found

Hi all

I am trying to use dialyzer for analyse my codes. When I try to use it, it says me:

D:\elixir\weight_protocol\apps\sap_odata_service>mix dialyzer
In an Umbrella child and no PLT found - building that first.
Checking PLT...
[:compiler, :cowboy, :cowlib, :crypto, :eex, :elixir, :gettext, :kernel,
 :logger, :mime, :phoenix, :phoenix_html, :phoenix_pubsub, :plug, :poison,
 :ranch, :stdlib]
Finding suitable PLTs
Looking up modules in dialyxir_erlang-19.0_elixir-1.4.0_deps-dev.plt
Looking up modules in dialyxir_erlang-19.0_elixir-1.4.0.plt
Looking up modules in dialyxir_erlang-19.0.plt
Finding applications for dialyxir_erlang-19.0.plt
Finding modules for dialyxir_erlang-19.0.plt
Creating dialyxir_erlang-19.0.plt

As you can see above, I am using windows operating system.

Thanks

There are no errors in that log, everything looks good, do you have any more log or what errors are you getting?

Here we go:

D:\elixir\weight_protocol\apps\sap_odata_service>mix dialyzer
In an Umbrella child and no PLT found - building that first.
Checking PLT...
[:compiler, :cowboy, :cowlib, :crypto, :eex, :elixir, :gettext, :kernel,
 :logger, :mime, :phoenix, :phoenix_html, :phoenix_pubsub, :plug, :poison,
 :ranch, :stdlib]
Finding suitable PLTs
Looking up modules in dialyxir_erlang-19.0_elixir-1.4.0_deps-dev.plt
Looking up modules in dialyxir_erlang-19.0_elixir-1.4.0.plt
Looking up modules in dialyxir_erlang-19.0.plt
Finding applications for dialyxir_erlang-19.0.plt
Finding modules for dialyxir_erlang-19.0.plt
Creating dialyxir_erlang-19.0.plt
** (ErlangError) erlang error: {:dialyzer_error, 'The HOME environment variable
needs to be set so that Dialyzer knows where to find the default PLT'}
    dialyzer.erl:173: :dialyzer.run/1
    lib/dialyxir/plt.ex:148: Dialyxir.Plt.plt_new/1
    lib/dialyxir/plt.ex:120: Dialyxir.Plt.check_beams/4
    lib/dialyxir/plt.ex:41: Dialyxir.Plt.check_plt/4
    (elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
    lib/dialyxir/plt.ex:28: Dialyxir.Plt.check_plts/1
    lib/mix/tasks/dialyzer.ex:128: Mix.Tasks.Dialyzer.check_plt/0
    lib/mix/tasks/dialyzer.ex:110: Mix.Tasks.Dialyzer.run/1
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
    (elixir) lib/code.ex:370: Code.require_file/2

Starting Dialyzer
dialyzer --no_check_plt --fullpath --plt d:/elixir/weight_protocol/_build/dev/di
alyxir_erlang-19.0_elixir-1.4.0_deps-dev.plt d:/elixir/weight_protocol/_build/de
v/lib/sap_odata_service/ebin

dialyzer: {dialyzer_error,"The HOME environment variable needs to be set so that
 Dialyzer knows where to find the default PLT"}
[{dialyzer_plt,plt_error,1,[{file,"dialyzer_plt.erl"},{line,588}]},
 {dialyzer_options,build,1,[{file,"dialyzer_options.erl"},{line,57}]},
 {dialyzer_cl_parse,cl,1,[{file,"dialyzer_cl_parse.erl"},{line,229}]},
 {dialyzer_cl_parse,start,0,[{file,"dialyzer_cl_parse.erl"},{line,47}]},
 {dialyzer,plain_cl,0,[{file,"dialyzer.erl"},{line,61}]},
 {init,start_em,1,[{file,"init.erl"},{line,1077}]},
 {init,do_boot,3,[{file,"init.erl"},{line,785}]}]

Ahh, it is telling you exactly what to do. It is trying to create a default plt file at a default location since you’ve not specified any other location, and that default location requires the HOME environment variable to be set, which is set on about every operating system except Windows, so you just need to add it to Windows.

In Windows just set a system environment variable with the name HOME and the value of %USERPROFILE% and that way HOME will always equal your user profile home in windows (which in windows goes by the default name of %USERPROFILE%. :slight_smile:

Yes, Windows is not consistent with the rest of the world. ^.^