我使用以下命令为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 17.0。
发布于 2014-06-03 17:37:49
有两件事:
-o
选项并不使透析器将PLT写入给定的文件,而是使分析结果。查看该文件,您将看到它是一个文本文件。您想要的选项是--output_plt
。--check_plt
不使用PLT文件名。请注意,它说明/home/citxx/.dialyzer_plt
是有效的,而不是您引用的文件。您需要将其与--plt
或--plts
参数组合起来,如下所示:
透析器--check_plt --plts透析器/ejabberd.plthttps://stackoverflow.com/questions/24020330
复制相似问题