sandorbedo

sandorbedo

Dependency name clash - decimal

How can this be solved? There are two decimal deps out there with identical names.

We have an erlang package that uses decimal (the old, erlang decimal package, that is called erlang_decimal in hex nowadays), but we also need another dependency that uses the elixir decimal package. In the deps section of the mix.exs file there are two deps with the same name here:

{:decimal, "~> 2.0"},  # the Elixir Decimal module
{:decimal, "~> 0.6.2", hex: :erlang_decimal} # the Erlang :decimal module

This is definitely not OK. If I rename the 2nd one to :erlang_decimal, then the problem is that Mix looks for the .app file of the erlang_decimal package as erlang_decimal.app, which is actually decimal.app, since the app name is still decimal. At this point I froked the erlang_decimal into a local git repo and renamed the application to erlang_decimal properly, and then forced the top level app to load this forked version instead of the erlang_decimal hex package. This works with the .app files, but then another problem bumped up: a reference to an .hrl file in an erlang dependency that uses the old erlang decimal app:

-include_lib("decimal/include/decimal.hrl").

I could just fork this erlang app too, and change the path to "erlang_decimal/include/decimal.hrl", but at this point I believe this isn’t the right thing to do.

Do you have any suggestions how to get rid of this decimal problam?

Most Liked

NobbZ

NobbZ

You can not have 2 applications with the same name.

You have to decide on one of them.

Or as you already started, forking and patching down the rabbit hole.

sandorbedo

sandorbedo

Thanks for the answer. I know that rule in general. The thing is that in this particular case, it would be possible to have both apps loaded, since one of then uses the Decimal, the other one uses the :decimal namespace for modules. Only the app names are colliding.

NobbZ

NobbZ

Yes, and that’s why you need to change one of them and use the patched name throughout the dependees by patching them.

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
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 ...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? 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 ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
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

We're in Beta

About us Mission Statement