Elixir 1.19: deps only compilation

Hi,

I’m in the process of upgrading from Elixir 1.17.x to Elixir 1.19.x. I’ve noticed that running mix loadpaths now compiles the entire application (including dependencies and application code), rather than just the dependencies. I observe the same behavior with mix deps.compile.

In our CI pipeline, it’s important to compile dependencies and application code separately to enable efficient layer caching.

Is this a regression in Elixir 1.19.x? Is there an alternative approach to achieve this separation with the new version?

Thank you for your help!

2 Likes

I never used mix loadpaths, though I am under the impression, that mix deps.compile always compiled all “children” under the umbrella, though with “plain singular” apps I never observed the described behaviour.

I do not have a testbed for non-umbrella apps currently.

PS: Just checked, with 1.18, all apps under the umbrella are built when using mix deps.compile.

1 Like

Ok, I never realized it was because we’re also using an umbrella app.
Anyway, I still need a solution to prevent my CI from recompiling all my deps whenever a source file changes

mix deps.compile --skip-umbrella-children should do the trick.

1 Like

@josevalim Am I missing something?

❯ mix deps.compile –-skip-umbrella-children
** (Mix) Unknown dependency –-skip-umbrella-children for environment dev

Which Elixir version are you at? mix deps.compile --skip-umbrella-childrenworked fine for me locally, both at the umbrella root and inside a child project.

ChatGPT to the rescue :sweat_smile:

The error is caused by the command you’re running:
mix deps.compile –-skip-umbrella-children

Notice the double dashes before ⁠skip-umbrella-children. The error message:
** (Mix) Unknown dependency –-skip-umbrella-children for environment dev

Problem:

You’re using the wrong type of dash before ⁠skip-umbrella-children.

You have ⁠–-skip-umbrella-children (an en dash ⁠ plus hyphen ⁠-), when it should be ⁠--skip-umbrella-children (two standard hyphens).

This often happens when copying from formatted text editors that substitute double hyphens with a long dash.

1 Like

(I fixed the post if someone reads José’s post)

1 Like

Gah! Apparently my phone sneaked in some weird Unicode dash! Thanks!

2 Likes