[erlang-questions] clarify: why does Dialyzer have an implicit dependency on Mnesia?

Kostis Sagonas <>
Wed Dec 12 21:16:53 CET 2007

Eric Merritt wrote:
> Guys,
> Dialyzer seems to have an implicit dependency on Mnesia. Mnesia isn't
> specified as a dependency in dialyzer.app, nor does dialyzer ever
> actually call any of the Mnesia APIs.  However, dialyzer attempts to
> get information about mnesia in dialyzer_plt. It makes use of a list
> of default libraries provided by the dialyzer header. Why is this? If
> there actually is a dependency shouldn't dialyzer have mnesia listed
> as a dependency in its .app file? If its not a dependency why try to
> retrieve information about it with the code module?

I am not 100% sure what you are referring to, but most probably you are 
talking about the fact that by default Dialyzer builds (or these days 
comes with) an initial PLT (Persistent Lookup Table) of the following 
applications: [kernel,stdlib,mnesia]

This is done so that there is cached type information about functions 
that an application might be using -- thereby avoiding having to include 
modules of these applications in each analysis and repeatedly analyzing 
these modules. However, dialyzer needs to check that the cached type 
information is still valid (i.e. has not changed since the time when the 
PLT was built) and thus checks that the .beam files have not changed by 
comparing their checksums with the current one. Thus, it needs to be 
able to locate these .beam files.

In principle, no application is needed in PLT or more than the above 
three could be added, so if it bothers you feel free to take mnesia out 
of the set of applications in the PLT (these are specified in dialyzer's 
Makefile) and rebuild the PLT.

Hope this answers your question.


More information about the erlang-questions mailing list