-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add inet_cidr to included_applications #1
Comments
Thanks! Hadn't crossed the bridge of working with Elixir releases yet, so I'll take your word on this & push out the fix. :) |
By the way, do you know of an easy way to tell what will or won't break a release? There are two other declared deps that don't have corresponding applications: I suppose |
Oh I completely forgot to answer... Actually you have to add every dependency you are using in production. Elixir 1.4 will automate this and you don't have to define them anymore. In Plug is already included in phoenix. Actually you probably also have to add You can read about it here http://blog.plataformatec.com.br/2016/07/understanding-deps-and-applications-in-your-mixfile/ |
@philipgiuliani Thanks for the follow-up! I've only now just gotten around to addressing this, myself. :) Application inference sounds super useful. I see Elixir 1.4 was just released recently, I'll definitely have to play around with it. In the meantime, I verified that (indeed) the lack of |
Per further discussion on #1, a deployed Erlang app needs to know of all the library applications, even if they aren't active. RemoteIp.Headers.Forwarded was breaking at runtime from such apps because Combine was not being loaded (even though it doesn't have a supervisor to start or anything). I believe this would be fixed by adding everything to `:applications`, which Elixir 1.4 would do anyway, but for the sake of specificity I've added all of remote_ip's dependencies (all the other 2 of them...) to their "proper" places.
Yes perfect, so you can also use it without using Phoenix. Great job! With Elixir 1.4 you can just remove all of this :) |
As noted in #12, #14, #15, #16, #17, and even way back in a comment on a5fb55b, my prior inclination to try to use `:included_applications` and `:applications` separately was ill-fated. Under Elixir 1.9.0, Mix started blowing up properly on `mix release` with ** (Mix) :combine is listed both as a regular application and as an included application So I guess everything should go under `:applications` by design. /shrug I'm trusting this to be backwards-compatible with Elixir 1.3, per the discussions on #1 from way back when. 😅
Previously, on "I don't actually know how application/0 works": #1, #17. And now, the next exciting installment! We don't need to list all the dependencies under :applications anymore, since Elixir v1.4 infers all of them. In fact, declaring :applications like this is clobbering any of the inference work that would otherwise have happened, thus leaving :logger out of the picture! In practice, I think this was fine just because :logger would be pulled in via :plug (and possibly others) transitively. But we're well past the days of supporting Elixir v1.3, so I think it'll generally be clearer to lean on :extra_applications and let Elixir take care of the big picture. In turn, this change makes :ex_doc's `runtime: false` flag make sense. I added it blindly to the dependency in 27a108f because that's what their README said. But now I know its actual purpose is to keep Elixir from pulling :ex_doc into the inferred :applications list. Further reading: * https://elixirforum.com/t/documenting-the-use-of-included-applications/1673 * https://blog.plataformatec.com.br/2016/07/understanding-deps-and-applications-in-your-mixfile/ * https://elixir-lang.org/blog/2017/01/05/elixir-v1-4-0-released/ * https://stackoverflow.com/a/44727742 * https://www.amberbit.com/blog/2017/9/22/elixir-applications-vs-extra_applications-guide/
inet_cidr
should be added toincluded_applications
, otherwise it will not be added in the release and the application will crash on startup.The text was updated successfully, but these errors were encountered: