Unreliable incremental builds

Hi :wave:

I’m using Elixir and Phoenix in a new open source project and I noticed that incremental builds are unreliable. Sometimes they work fine, and other times start yielding odd behaviours:

  • It fails to compile an external dependency that had previously been successfully compiled.
  • It starts compiling all the projects even if I only change one line of code in a file. I checked with xref and --sink and no other module has a compile dependency with it.

My guess is that something is odd in my module graph, but xref is not revealing anything useful. How would you recommend debugging this issue? I was excited about everything Elixir would offer, but incremental builds that often get invalidated worsen the experience significantly.

Edit
I just noticed that the incremental build got invalidated after seeing an error popping in the bottom right corner of VSCode so it might have something to do with either the ElixirLS or Credo extensions.

Have you tried removing the _build folder?

I’ve had it a few times happen to me too, but those are very rare.

That’s strange. How can I reproduce it?

I’d start with deleting VSCode’s directory – I think it was .vscode? – and let it rebuild its stuff first. IIRC it kind of duplicates work with the Elixir LSP and that has been an occasional problem for people but was always solved by pruning the directories so far.

The elixir-ls uses a custom root directory named .elixir-ls.

I also might have a suspection there might be some kind of version mismatch, are you using asdf or rtx to manage elixir/OTP versions?

I’ve disabled the Credo VSCode and that seems to have solved the issue. I wonder if it conflicts with ElixirLS somehow.