Tracing re-compiled files?

Hello!

When I modify a Phoenix controller, in a given app this gives me:

==> transport
Compiling 14 files (.ex)

I would like to better understand why so many files are recompiled (maybe the app needs some rework to reduce that).

What is the best tool to trace that down?

Thanks!

– Thibaut

3 Likes

Hi! This post should provide some good pointers on how to achieve this using mix xref graph:

5 Likes

Salut @thbar :wave:

It rings a bell, check this old post:

3 Likes

Thanks @sabiwara & @cblavier! I will dive into this & report back :smile:

3 Likes

To know which files are recompiled, mix compile --verbose will list the file names.

To understand why, the the posts above help, but they predate mix xref trace as well as mix xref graph --label compile-connected.

I’d love to blog more about this.

5 Likes

Thanks for those good tips Marc-André!

I now have a good idea of which files are recompiled, but even with compile-connected it’s so far not very clear why these files are related. I will have to understand that a bit further.

(but thanks for your help which moved me a bit further in the right direction).