Question

I've built .plt file for ejabberd and standard libraries with the following command:

$ dialyzer --build_plt --apps kernel stdlib erts mnesia eunit -o ./dialyzer/ejabberd.plt /path/to/ejabberd/repository/ebin/*.beam

The manual check of generated file states that this file is valid:

$ dialyzer --check_plt dialyzer/ejabberd.plt 
  Checking whether the PLT /home/citxx/.dialyzer_plt is up-to-date... yes
done (passed successfully)

But when I try to check my source code using this .plt file the following error occurs:

$ 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.

The same happens if standard applications aren't included in plt file.

What can be the reason of such behavior?

UPD. I'm using ejabberd 14.05 and erlang OTP 17.0.

Was it helpful?

Solution

Two things:

  • The -o option doesn't make Dialyzer write the PLT to the given file, but the analysis results. Look at the file, and you'll see it is a text file. The option you want is --output_plt.
  • --check_plt doesn't take a PLT file name. Note that it says that /home/citxx/.dialyzer_plt is valid, not the file you referenced. You need to combine it with a --plt or --plts argument, like this:

    dialyzer --check_plt --plts dialyzer/ejabberd.plt
    
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top