<div>Currently rdmd is broken because of (Issue 8856, Issue 8858, Issue 7016), ie local import does not create -deps dependency, which results in link errors.</div><div>This makes people use global imports as opposed to local ones, which is less clean.</div>
<div><br></div><div>I wrote a recursive dependency analyzer and plugged it in a modified rdmd, and it does indeed work in all cases I tried (for example eg, see failing case for rdmd here: Issue 8856).</div><div>The dependency analyzer works by calling dmd -v recursively using a breadth first search strategy, until no more modules are added to the growing dependency list (it can typically take 3 or 4 iterations). It makes use of the new std.process to get dmd -v's output via stdout instead of files and is reasonably fast.</div>
<div><br></div><div>However, this is sounds like an un-necessary hack and wastes compile time by invoking dmd multiple times instead of twice (dmd -v -c -o- main.d followed by dmd all_deps.d) or even, ideally, once if that would be possible.</div>
<div><br></div><div>quoting from Issue 8856:</div><div>* The root problem is that semantic isn't run on the dependencies. It's in Import::semantic where the import is printed.</div><div>* semantic3 for imported functions is only run during the inline pass.</div>
<div><br></div><div>can this be fixed? possible with a dmd compiler flag : dmd -recursive_deps ?</div>