LDC: Speed up incremental builds with object file caching

Martin Nowak via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Sep 19 01:58:54 PDT 2016


On Sunday, 18 September 2016 at 09:10:41 UTC, Johan Engelen wrote:
> I think LDC has the same problems (template instances are 
> emitted in the first module not the one that needed the 
> instantiation?). Knowing this, you may be able to set up a case 
> where things break, but I think it would have to involve 
> recompilation with a different set of sources than the first 
> compile. E.g. `ldc2 -c a.d b.d c.d` first, then `ldc2 -c b.d 
> c.d`, and then trying to link. Which probably doesn't work well 
> without caching either... We should deprecate non-singleobj 
> compiles.

Yes, it's difficult to make that work correctly when the object 
cache is outside of the compiler. Maybe archives would provide a 
good way to build a better incremental rebuild support into the 
compiler.
At least with dmd's multiobj archives, template instances become 
their own object file.
It's definitely worth to put some more thought into how we can 
leverage parallel builds and incremental rebuilds.

https://trello.com/c/dBfiJHEM/72-spec-better-parallel-incremental-build-strategies-for-bigger-projects


More information about the Digitalmars-d-announce mailing list