paulanthonywilson

paulanthonywilson

Dialyzer error: Old PLT file

I’m working with a team that are running (relatively) old versions of Elixir and Erlang. Last month I added dialyzer, via dialyxir (can never spell that) to their build. Today we are running into an issue:

:dialyzer.run error: Old PLT file /apps/[redacted]/priv/plts/application.plt

The build is on Azure. The PLTs are cached using Azure Pipeline caching (here if you want to know but I wouldn’t if I could avoid it).

Dialyxir config is

  defp dialyzer do
    [
      plt_add_apps: [:mix, :ex_insights],
      plt_file: {:no_warn, "priv/plts/application.plt"},
      ignore_warnings: "dialyzer.ignore_warnings"
    ]
  end

The plts are excluded from source control.

Versions:

elixir 1.14.2-otp-25
erlang 25.3.2.6

I know I can fix the issue by invalidating the cache but I would like to understand how it happened in the first place. The only thing I’ve been able to find is this somewhat cryptic Erlang mailing list q&a. Old PLT file? .

The checking is going on here which looks like there is some discrepancy between an internally held hash in the PLT and the file contents.

Thoughts?

Most Liked

paulanthonywilson

paulanthonywilson

I did link to that in my question :wink:

I am about to invalidate the cache. It definitely doesn not happen locally.

[edit s/no/not/]

D4no0

D4no0

Did invalidating of cache help?

paulanthonywilson

paulanthonywilson

Yes, thanks. Building and caching a new plt worked.

RobertoSchneiders

RobertoSchneiders

We have the same issue in a project using Elixir 1.18.3 and GitHub Actions. It has been happening for quite a while now. It seems completely random. Once this error appears, I have to clear the cache to fix it.

This is how I’m saving the PLT cache, I’m wondering if there is something else that should be considered for the cache key.

      - name: Save PLT cache
        id: plt_cache_save
        uses: actions/cache/save@v4
        if: steps.plt_cache.outputs.cache-hit != 'true'
        with:
          key: |
            plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
          path: |
            priv/plts 
D4no0

D4no0

If you are paying for the service, which a lot of companies that depend on github do, a difference between a pipeline running 2 minutes and 4 minutes becomes a valid concern.

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

We're in Beta

About us Mission Statement