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?

First 3 of 3 Posts! Switch mode

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?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement