我使用以下命令为 ejabberd 和标准库构建了 .plt 文件:
$ dialyzer --build_plt --apps kernel stdlib erts mnesia eunit -o ./dialyzer/ejabberd.plt /path/to/ejabberd/repository/ebin/*.beam
生成文件的手动检查表明该文件有效:
$ dialyzer --check_plt dialyzer/ejabberd.plt
Checking whether the PLT /home/citxx/.dialyzer_plt is up-to-date... yes
done (passed successfully)
但是当我尝试使用这个 .plt 文件检查我的源代码时,会发生以下错误:
$ dialyzer --plts dialyzer/ejabberd.plt ebin/*.beam
Checking whether the PLT dialyzer/ejabberd.plt is up-to-date...
dialyzer: The file: dialyzer/ejabberd.plt is not a valid PLT file
Use the options:
--build_plt to build a new PLT; or
--add_to_plt to add to an existing PLT
For example, use a command like the following:
dialyzer --build_plt --apps erts kernel stdlib mnesia
Note that building a PLT such as the above may take 20 mins or so
If you later need information about other applications, say crypto,
you can extend the PLT by the command:
dialyzer --add_to_plt --apps crypto
For applications that are not in Erlang/OTP use an absolute file name.
如果 plt 文件中不包含标准应用程序,也会发生同样的情况。
这种行为的原因是什么?
UPD。我正在使用 ejabberd 14.05 和 erlang OTP 17.0。