Skip to content
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

Mix release fails with logger application error #4265

Closed
wants to merge 1 commit into from

Conversation

slezakattack
Copy link
Contributor

When attempting a mix release on a new mix project, I get the following error:

** (Mix) :logger is listed both as a regular application and as an included application

Repro steps:

  1. mix new ejabberd_mix_release_issue
  2. Within mix.exs, add {:ejabberd, "~> 24.7"} in the list of deps.
  3. mix deps.get
  4. mix compile
  5. mix release

Updating the mix.exs within ejabberd seems to fix the issue as I'm able to generate a release and the application is able to start up (provided there's an ejabberd.cfg file 🙂)

…lar application and as an included application.
@coveralls
Copy link

Coverage Status

coverage: 32.972% (-0.01%) from 32.986%
when pulling dc9137e on slezakattack:mix_release_fix
into 15569d0 on processone:master.

@badlop
Copy link
Member

badlop commented Aug 16, 2024

Your change seems problematic when running "make dev" in ejabberd.

What if you move to extra_applications only "logger", instead of all the apps? Something like this, does that work correctly for your user case?

diff --git a/mix.exs b/mix.exs
index 9093fef9f..ac40e3b1e 100644
--- a/mix.exs
+++ b/mix.exs
@@ -47,7 +47,8 @@ defmodule Ejabberd.MixProject do
                     :fast_tls, :fast_xml, :fast_yaml, :jose,
                     :p1_utils, :stringprep, :syntax_tools, :yconf, :xmpp]
      ++ cond_apps(),
-     included_applications: [:mnesia, :os_mon, :logger,
+     extra_applications: [:logger],
+     included_applications: [:mnesia, :os_mon,
                              :cache_tab, :eimp, :mqtree, :p1_acme,
                              :p1_oauth2, :pkix]
      ++ cond_included_apps()]

@prefiks
Copy link
Member

prefiks commented Aug 16, 2024

To use extra_applications, i think we would need to remove from that apps that we specify in deps (as those will be added automatically)

@slezakattack
Copy link
Contributor Author

What if you move to extra_applications only "logger", instead of all the apps? Something like this, does that work correctly for your user case?

Just tried this and got a warning when I compiled it:

Compiling 17 files (.ex)
both :extra_applications and :applications was found in your mix.exs. You most likely want to remove the :applications key, as all applications are derived from your dependencies
Generated ejabberd app
==> ejabberd_mix_release_issue

Running mix release works too. While it still technically works with badlop's change, mix seems to want either applications or extra_applications as maybe it's redundant or something.

@badlop
Copy link
Member

badlop commented Aug 21, 2024

@slezakattack: Good news: I've pushed your commit directly in master, and followed the suggestion from @prefiks , and it works correctly now :-)

@slezakattack
Copy link
Contributor Author

Awesome, thank you so much. Looks much cleaner too 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants