Multi applications depend on same application, but different branch

84 Views Asked by At

I have application A depend on application B, both A and B depend on application C.

A require C's master branch, B require C's other branch.

Is there any way to resolve this issue?

1

There are 1 best solutions below

2
On

I assume you wrote that A. If C application is backward compatible then modify B's dependency to C master.

If not... then... well... if those versions are really different the only reasonable (not really) solution which comes to my mind is to fork one of C and modify it's name, all module names and occurrences by adding something like "_ver_x_y_z", then modify its occurrences in A or B. It should work if there are no weird runtime resolved references to module names. You also need to modify possible name clashes in ets and mnesia tables, registered processes and resource files... and something hard to predict.

As far as i know module names in erlang vm are just atoms and there is no way to keep different versions loaded and reference them (exception is hot code swapping).

I would love to read answers from more experienced programmers. Maybe there are some tools already written dedicated to that problem.