Precreate base dialyzer PLT files?

We run mix dialyzer as part of our build process, and it takes a while. One of the steps is to create a “base” .plt file (e.g. ~/.mix/dialyxir_erlang-24.1.5_elixir-1.12.3.plt).

Can I pre-create this file (and stash it in our base docker build image, preferably)?

1 Like

Yes, that is why it is separate file.

How can I pre-create this file? Specifically: how do I pre-create it for a particular Erlang/Elixir combination, without having an Elixir project available? Remember: this is for a base docker image (or other cache).

Have you checked Dialyxir’s docs?

You could add this part to your mix.exs file’s project function like so:

dialyzer: [plt_local_path: "priv/dialyzer", plt_core_path: "priv/dialyzer"]

Then mkdir -p priv/dialyzer and then mix dialyzer should put these files in the directory. Just tried it a few minutes ago and it worked.

Not aware of such an option but you can always have a super minimal Elixir project with just a few base files and without any actual code and then just build a PLT file inside it, then copy it and store it for future use.