paulanthonywilson

paulanthonywilson

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?

Showing Posts 27 to 18

paulanthonywilson

paulanthonywilson OP

Sorry, I was kidding. Good look with wading through the job swamp!

We were also not pinning the exact erlang version and seem to have just hit the issue again when an updated image was used from Docker. It’s good to have an explanation.

dimitarvp

dimitarvp

Hey, at least for the moment I have an excuse: I’m deep into the job search swamp. :neutral_face:

Later on, why not. It’s one of those things that should have been nailed and written in stone like 5 years ago.

paulanthonywilson

paulanthonywilson OP

yeah, someone should do that . Stares pointedly :stuck_out_tongue:

Wouldn’t help the OP (me) who is in the unfortunate situation of building on Azure.

dimitarvp

dimitarvp

All of this thread really makes me want somebody open-sources an exact and very detailed CI/CD setup(s) for Elixir projects that work perfectly on GitHub, GitLab, BitBucket, any Forgejo hosting etc.

It seems to annoying to do every time.

RobertoSchneiders

RobertoSchneiders

awesome! You were right, we were not pinning the patch version in CI. I followed your suggestions.

Thank you!

lud

lud

Hey! I just updated my Github config :slight_smile:

I use this strategy on my personal projects: nvir/.github/workflows/elixir.yaml at main · lud/nvir · GitHub

It’s based on the well-known template but I removed the check on cache hit for the PLT, as I got problems with that. And it’s simpler. Also checking the PLT is actually fast, even for large projects.

If you add 200 files I’m not sure how slow it is but that’s why I added a cache_vsn variable that I can bump. But I too use dependabot so the mix.lock file is updated quite often.

I wonder if in addition to hashFiles it is possible to use something like find lib test -type f | wc -l in the cache keys, that would make dialyzer update when files are added. But at some point you will never use the cache if you invalidate it for everychange.

So I prefer the current strategy of hashing mix.lock and just regenerate the PLT for the app code only. Also I feel like Github action got really faster lately.

alexslade

alexslade

@RobertoSchneiders We recently fixed this issue too.

Perhaps you have the same cause: are you not pinning the patch version of erlang in your CI?

Here is the cause breakdown from our bug ticket:

  • Dialyzer creates an md5 hash of files to check, and that includes beam files.
  • We are not pinning an exact version of erlang in CI
  • Prior to each failing PLT check has been an erlang patch version bump!
  • It looks like erlang project releases the patch bumps roughly weekly. This explains the roughly-weekly occurences we were seeing. It wasn’t a timestamp issues as first suspected.
  • This patch bump means that the PLT files are different to the ones in the cache, so dialyzer is correctly flagging the old PLT files.

Proposed solution: check .tool-versions during CI setup and install the exact pinned version of erlang that our project uses.

Note: I also included the erlang version in the cache key, to avoid confusion in future and to immediately bust the cache lookup.

RobertoSchneiders

RobertoSchneiders

Understood. We update dependencies with Dependabot every week, so that’s not a big issue for us but I will keep an eye on it, thank you.

dimitarvp

dimitarvp

That’s not happening because again, the virtual instances where the actions are ran are often using network-mounted disks. They don’t even have local disks. :roll_eyes:

D4no0

D4no0

I think the effort would be better spent on making a mutable local-first cache system, otherwise all of these solutions are just a hack around the main problem.

If only these goddamn action weren’t written in JS… also BTW you cannot write tests for them, amazing.

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews