Browse Source

Add a guide section about dealing with duplicate modules

While the solution is not the best we could do it's better
than nothing.
Loïc Hoguin 6 years ago
parent
commit
54df98c780
1 changed files with 22 additions and 0 deletions
  1. 22 0
      doc/src/guide/deps.asciidoc

+ 22 - 0
doc/src/guide/deps.asciidoc

@@ -515,6 +515,28 @@ projects using the `NO_AUTOPATCH` variable:
 [source,make]
 [source,make]
 NO_AUTOPATCH = cowboy ranch cowlib
 NO_AUTOPATCH = cowboy ranch cowlib
 
 
+=== Dealing with duplicate modules
+
+When there are duplicate modules found in both applications
+and their dependencies, some tasks may fail. Erlang expects
+modules to be unique in general.
+
+When the duplicates are found in dependencies, you will need
+to remove one of the duplicates at fetch time. To do so, you
+can add a rule similar to this to your Makefile before including
+'erlang.mk':
+
+[source,make]
+----
+DEPS_DIR = $(CURDIR)/deps
+
+deps:: $(DEPS_DIR)/cowlib
+	$(verbose) rm -f $(DEPS_DIR)/cowlib/src/cow_ws.erl
+----
+
+This must be done from the application that has this dependency.
+Only define the `DEPS_DIR` variable if necessary.
+
 === Skipping deps
 === Skipping deps
 
 
 It is possible to temporarily skip all dependency operations.
 It is possible to temporarily skip all dependency operations.