[Issue 17069] New: rdmd code should be split in reusable libraries

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jan 7 15:21:44 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17069

          Issue ID: 17069
           Summary: rdmd code should be split in reusable libraries
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: tools
          Assignee: nobody at puremagic.com
          Reporter: timothee.cour2 at gmail.com

rdmd is insufficient to build D applications:
(A) mainly because of this 6 year old bug
https://issues.dlang.org/show_bug.cgi?id=7016 local import does not create
-deps dependency
(B) no support for partial recompilation (blocked by lack of -oq, which ldc has
but not dmd: https://github.com/dlang/dmd/pull/1871 has been pending for 4
years; see also https://issues.dlang.org/show_bug.cgi?id=3541: Add -oq to dmd
(use fully qualified module name as object filename) ;
https://issues.dlang.org/show_bug.cgi?id=12116: dmd -op -od broken)

I built a build system for my use cases that addresses (A) and (B)
(suboptimally though) based on forking off rdmd but it's very hard to keep in
sync with rdmd because of rdmd's monolithic design:

* it contains a main function (so can't be used as a library)
* it's one big file, the private functions can't be reused elsewhere
* in some sense it does too much (--eval=code, --loop should belong in a
separate module)

Recommendations:
* split rdmd into several reusable modules (eg: dtools.rdmd.dependency, etc)
* make the main subject to a switch

--


More information about the Digitalmars-d-bugs mailing list