Beam loader confusing resources from my get_text app and the gettext dependency?

[outline: INTRO, EVIDENCE, EXPLANATION, WORK-AROUND?]
INTRO: I noticed the error flag in VS Code this morning after I started my computer. It was not there yesterday when I stopped. I believe there is a naming conflict between Gettext.beam and GetText.beam. I use VS Code on Windows 10. I committed my changes in my ‘web_eme_frequency’ app this morning and haven’t touched my ‘get_text’ app in a few days.

It looks like assets from my get_text app have been leaked into the beam file loading for the web_eme_frequency app. The web_eme_frequency app has no direct, nor indirect, dependencies on the get_text app. (Although I’d like to be able to add those in the future.)

EVIDENCE: Here is the output from ‘mix compile’ following ‘mix clean’:
$ mix compile
==> morph
Compiling 2 files (.ex)
Generated morph app
==> eme_ecto
Compiling 4 files (.ex)
Generated eme_ecto app
==> get_text
Compiling 2 files (.ex)

07:15:29.690 [error] beam/beam_load.c(1433): Error loading module ‘Elixir.GetText’:
BEAM file exists but it defines a module named Elixir.Gettext

07:15:29.690 [error] Loading of c:/Users/at7wa/NoneDrive/dev/eme-frequency/_build/dev/lib/gettext/ebin/Elixir.GetText.beam failed: :badfile

Generated get_text app
==> web_eme_frequency
Compiling 14 files (.ex)

07:15:30.538 [error] beam/beam_load.c(1433): Error loading module ‘Elixir.Gettext’:
BEAM file exists but it defines a module named Elixir.GetText

07:15:30.538 [error] Loading of c:/Users/at7wa/NoneDrive/dev/eme-frequency/_build/dev/lib/get_text/ebin/Elixir.Gettext.beam failed: :badfile

07:15:31.686 [error] beam/beam_load.c(1433): Error loading module ‘Elixir.Gettext’:
BEAM file exists but it defines a module named Elixir.GetText

07:15:31.686 [error] Loading of c:/Users/at7wa/NoneDrive/dev/eme-frequency/_build/dev/lib/get_text/ebin/Elixir.Gettext.beam failed: :badfile

== Compilation error in file lib/web_eme_frequency/gettext.ex ==
** (CompileError) lib/web_eme_frequency/gettext.ex:23: module Gettext is not loaded and could not be found
(elixir) expanding macro: Kernel.use/2
lib/web_eme_frequency/gettext.ex:23: WebEmeFrequency.Gettext (module)

EVIDENCE: The gettext files in my _build directory are:
./_build/dev/lib/gettext/ebin/Elixir.Gettext.beam
./_build/dev/lib/gettext/ebin/Elixir.Mix.Tasks.Compile.Gettext.beam
./_build/dev/lib/get_text/ebin/Elixir.GetText.beam

EXPLANATION: I have an umbrella project: eme-frequency–to get information about graphemes, phonemes, morphemes (I tutor dyslexics and do recreational programming).
The umbrella project has four apps: eme_ecto, get_text, morph, and web_eme_frequency. (It will probably have two more – graph and phon…)
web_eme_frequency is the latest, generated with mix phx.new.web. One of the phoenix dependencies is gettext. Apparently due to windows case insensitivity, Gettext.beam and GetText.beam get confused.

This shouldn’t happen from my point of view, first because it was not a problem yesterday, second because the dependency trees are clean with respect to gettext and get_text, and as noted above my actions have been in the web_eme_frequency app, in the …/live/ and …/templates/*/ directories.

WORK-AROUND?
At this point, my five decades of experience tell me there is enough sufficiently advanced technology in mix, elixir, phoenix, and erlang, and I should “simply” rename my get_text app and resources. And then run ‘mix do clean, compile’. Is it that simple? Has anyone listed all the touch points when renaming an app in an umbrella project? (quick search in elixir forum yielded nothing obvious to me.)

OTOH, is there a simple configuration change that will make the loader for the web_eme_frequency app use only the dependencies in that app? The web_eme_frequency app’s dependencies are eme_ecto (in_umbrella: true) and the standard phoenix dependencies. The eme_ecto dependencies are as expected for using postgresql and do not include get_text.

The problem is that you are using case-independent filesystem (I assume that you use either Windows or macOS). In this case there is a problem that GetText and Gettext will try to create respectively Elixir.GetText.beam and Elixir.Gettext.beam files which on case-independent FS are both readable when you try to load Elixir.Gettext.beam. This causes VM to be confused due to the fact that it try to load one file but get module with different name. The VM BEAM load path works like PATH so it will load first encountered file with given name, and it doesn’t matter that these projects have different build paths as from the VM viewpoint these are equivalent. There is no other solution than renaming at least this one module.

I’ll rename my get_text app. I may create a note in this forum if it seems somewhat involved. [comment if that’s a bad idea or if you know of an extant note.]

Some comments:

  1. I am sad to return to 1980s-style name spacing by using names that are the equivalent of “the_get_text_that_howard_bussey_created”.

  2. I cannot imagine how the get_text app assets could be in a load path when mix is compiling the web_eme_frequency app,

  3. I cannot imaging how the gettext dependency assets could be in a load path when mix is compiling the get_text app.

This is how Erlang works and Elixir cannot do anything about it. You need to accept it.

All .beam files are shared between the compilations, and these need to be shared due to fact that Mix can need the custom tasks that are defined in one of your projects. You can always ditch the idea of Umbrella and use Ponchos that do not suffer from such problem.

Ok, Thank you for the explanations.