tty

tty

Setting path to deps for Elixir uuid and Erlang uuid

Hello,
Our application uses UUID but one of the Erlang packages has a dependency to Erlang uuid (GitHub - okeuday/uuid: Erlang Native UUID Generation · GitHub). In mix.lock we have the following two lines:

“uuid”: {:git, “GitHub - okeuday/uuid: Erlang Native UUID Generation · GitHub”, “a59624205fe3b6f83b69fc7768bb24068b556c86”, [branch: “master”]}
“elixir_uuid”: {:hex, :uuid, “1.1.8”, “e22fc04499de0de3ed1116b770c7737779f226ceefa0badb3592e64d5cfb4eb9”, [:mix], , “hexpm”}

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’ ?

Thanks

Most Liked

michalmuskala

michalmuskala

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.

NobbZ

NobbZ

I guess you mean to rewrite the elixir software (which is owned by the OP) to use the erlang UUID-library?

Yeah, definitively a way to go, but that will break once one uses something from this page:

An ugly workaround, which will break in pretty much the same way as above.

Yeah, the same as above, it will break when you use something that depends on the regular package.

But there is hope: There is a ~20 months old bug:

https://github.com/zyro/elixir-uuid/issues/24

NobbZ

NobbZ

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).

Where Next?

Popular in Questions Top

skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vac
Hi, I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement