Add failing root_module test that produces duplicate modules.
The error exhibited here is not the same as the one I get locally, which is the erroneous behavior I want to exhibit. I'm not sure why (yet)
File "test/blackbox-tests/test-cases/root-module-duplicate.t", line 1, characters 0-0:
Renamed _build/.sandbox/f5fdd33f4e465224997051cdf5d77d56/default/test/blackbox-tests/test-cases/root-module-duplicate.t to _build/.sandbox/f5fdd33f4e465224997051cdf5d77d56/default/test/blackbox-tests/test-cases/root-module-duplicate.t.corrected
_build/.sandbox/f5fdd33f4e465224997051cdf5d77d56/default/test/blackbox-tests/test-cases/root-module-duplicate.t.corrected --- Text
53 53
54 Trigger the error. 54 Trigger the error.
55 55
56 $ dune build 56 $ dune build
57 File "root.ml-gen", line 15, characters 0-18:
58 15 | module Logs = Logs
59 ^^^^^^^^^^^^^^^^^^
60 Error: Multiple definition of the module name Logs.
61 Names must be unique in a given structure or signature.
62 [1]
It does now exhibit the incorrect behavior as expected.
Thanks for the repro. The issue is caused by an unfortunate interaction between:
-
The library layout in the logs package. It does not install sub libraries in separate directories.
-
For findlib libraries, dune needs to guess what the entry modules are.
The result is that 2. cannot work if all the libraries are installed in one dir.
The simplest fix would be to change logs to install sub libraries in sub directories. This would have other advantages as well.
I merged your test case with a few small edits.