Shallow search of modules by dunecontrol?

The command dunecontrol for managing modules seems to be doing a deep search of folders to find dune.module files. During the years this has caused several headaches:

  • Awarded as bug-of-the-year, this command was finding a "module" within the .git directory which in reality was the wording of a git commit and caused a fallout all CI runners in our GitLab. See #320 (closed).
  • Apparently, at some point it followed symlinks and caused who-knows what problems.
  • On super builds !1391 (closed), modules may be downloaded somewhere in the build directory. dunecontrol takes them as actual modules to use and surprisingly tries to configure them. If a copy of the same module is in the root directory (or somewhere else), a double definition appears.
  • I do not understand exact the circumstances but I have eye witnessed false-positive double module definitions when using python bindings. I suspect there is a dune.module file within the dune venv to be able to make dune and depending on the configuration this may be taken as a "module" too.

So the the main question is: Do we really need to make a deep search of directories to find dune modules? Who is using this feature anyways?

Edited by Santiago Ospina De Los Ríos