Deps are pulled properly, the build occurs fine, in the console I can use :uuid.get_v1/1 but can’t use Elixir.UUID
The path to _build/dev/lib/elixir_uuid/ebin is not included when I run the console. I have verified this to be true by manually adding the path to elixir_uuid/ebin in the shell using :code.add_path/1
How can I include the path to _build/dev/lib/elixir_uuid/ebin automatically as part of the build aka ‘mix compile’ ?
As far as I’m aware it’s not possible to have two different applications with the same name on a single BEAM instance.
That’s one of the reasons hex does not have namespaces - it wouldn’t be possible to use the packages at the same time anyway. Manually specifying namespaces (like in this case) only pushes the problem further to the final users.
OTP/BEAM does not care where the files are, both applications have the same application name in their respective configs, its :uuid for the :uuid package from hex.pm (in mix.exs) and it is uuid for the erlang UUID package from github (in src/uuid.app.src).
The addition of :elixir_uuid to the list of :applications does not add anything, but just another problem: Your application might refuse to start, since there is no application :elixir_uuid available.
Besides of that, beginning with elixir 1.4, you really should avoid :applications and use :extra_applications instead (and runtime: false for deps that do not need to be started).
As noted above I had marked the :uuid package from hex.pm as :elixir_uuid. I’m wondering what is the purpose of that key given mix allows and seems to respect this renaming for compilation but does not use it when generating a release.
Overall the consensus seems to be I am out of luck on this one…
I’m not even sure what this change actually means to mix. But with a high chance it is just “the dependency known as elixir_uuid can be downloaded from hex under the name uuid.”
The mix.lock is meant to be written by mix only, not to be tampered with by humans.
You can specify the dependency with the hex option. It’s mentioned here.
{:elixir_uuid, "~> 1.1.8", hex: :uuid}
I’ve used it to fork a library that was a dependency of another, so that I didn’t have to fork both. Not sure if it’ll help in your situation, but it might.