Proposal: warn for untreated deps

53 views
Skip to first unread message

Saša Jurić

unread,
Feb 11, 2017, 9:21:11 AM2/11/17
to elixir-lang-core
This is a proposal to introduce mix warning (or error) if a dependency is not listed in the applications list, or explicitly marked with runtime: false.

I saw this case yesterday, as one user of my lib was puzzled by a failure when starting their app. The root cause of the failure was that they didn't include my lib in the applications list. However, the error message was not quite revealing for them. In particular, the error message clearly indicated that some process is not running. While that's quite useful info for lib authors, it's not as helpful for lib users, and it doesn't really points to the root cause of the problem.

Since `runtime: false` is now the official thing, mix could require that a dep is either included in app list or explicitly marked as compile-time only, which would then provide a more instructive error message.

Perhaps a better solution would be to deprecate the applications setting, in which case the proposed verification wouldn't be needed. TBH, I actually think that the applications key makes it quite easy to get things wrong, so maybe such deprecation is worth considering.

José Valim

unread,
Feb 11, 2017, 2:09:39 PM2/11/17
to elixir-l...@googlegroups.com
I believe we can warn if a dependency is not listed in the applications list or explicitly marked with runtime: false. We already know how to compute this information so it is a matter of guaranteeing everything is sync. Please open up an issue or send a PR. If the code is straight-forward, then I see no reason for not doing this.

Unfortunately we cannot deprecate :applications because fixing the warning implies your package will only run on Elixir v1.4+. Maybe we can do it in the future, for v1.7 or v1.8, but now it is definitely too early.




José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/99c7767e-0b7c-4dfc-b643-db5d9c19d371%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saša Jurić

unread,
Feb 11, 2017, 2:40:40 PM2/11/17
to elixir-lang-core
On 11 Feb 2017, at 20:09, José Valim <jose....@plataformatec.com.br> wrote:

I believe we can warn if a dependency is not listed in the applications list or explicitly marked with runtime: false. We already know how to compute this information so it is a matter of guaranteeing everything is sync. Please open up an issue or send a PR. If the code is straight-forward, then I see no reason for not doing this.

I’ll see about making a PR, but can’t commit on time because I’m prepping a talk & busy with some other stuff. 


Unfortunately we cannot deprecate :applications because fixing the warning implies your package will only run on Elixir v1.4+. Maybe we can do it in the future, for v1.7 or v1.8, but now it is definitely too early.

Perhaps we could soft-deprecate it in 1.5, i.e. remove the description from docs (e.g. https://hexdocs.pm/mix/Mix.Tasks.Compile.App.html)?

José Valim

unread,
Feb 11, 2017, 2:57:26 PM2/11/17
to elixir-l...@googlegroups.com
Perhaps we could soft-deprecate it in 1.5, i.e. remove the description from docs (e.g. https://hexdocs.pm/mix/Mix.Tasks.Compile.App.html)?

Let's go with baby steps. If the warning is not good enough or insufficient then we can consider deprecating it.

Paul Schoenfelder

unread,
Feb 11, 2017, 3:13:58 PM2/11/17
to elixir-l...@googlegroups.com
Distillery does this currently, so the code could likely be reused with some tweaking, I'll look into opening a PR for it.

Paul

On Sat, Feb 11, 2017 at 1:57 PM José Valim <jose....@plataformatec.com.br> wrote:
Perhaps we could soft-deprecate it in 1.5, i.e. remove the description from docs (e.g. https://hexdocs.pm/mix/Mix.Tasks.Compile.App.html)?

Let's go with baby steps. If the warning is not good enough or insufficient then we can consider deprecating it.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BjukLjkhdBSaT9nioL3NeNH_nDMQ-D8n0xP8EG--6XZA%40mail.gmail.com.

José Valim

unread,
Feb 11, 2017, 3:36:15 PM2/11/17
to elixir-l...@googlegroups.com
Paul, we also already compute this on mix compile.app so It may be be a matter of doing a list subtraction and warning on the leftovers.



José Valim
Skype: jv.ptec
Founder and Director of R&D

On Sat, Feb 11, 2017 at 9:13 PM, Paul Schoenfelder <paulscho...@gmail.com> wrote:
Distillery does this currently, so the code could likely be reused with some tweaking, I'll look into opening a PR for it.

Paul
On Sat, Feb 11, 2017 at 1:57 PM José Valim <jose....@plataformatec.com.br> wrote:
Perhaps we could soft-deprecate it in 1.5, i.e. remove the description from docs (e.g. https://hexdocs.pm/mix/Mix.Tasks.Compile.App.html)?

Let's go with baby steps. If the warning is not good enough or insufficient then we can consider deprecating it.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAK%3D%2B-TtV%3DQQB%2Bx_4r42-1cKOatFyee2YM4ZFvZwESNwCjbGj1g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages