Adding ccache-like output caching to dmd

Petar Petar
Tue Dec 29 17:23:07 UTC 2020


On Monday, 28 December 2020 at 23:14:02 UTC, Per Nordlöw wrote:
> Has anyone considered integrating into a `dmd` a ccache-like 
> caching of output files indexed by digests based on
>
> - environment variables,
> - process arguments which, in turn, decide
> - input file contents (including import files detected upon 
> first uncached compile)
> - dmd compiler binary fingerprint
> - ...probably something more I missed
>
> Initial call stores that list alongside content hash and 
> resulting binary(s).
>
> If not, would anyone have any strong objections against adding 
> this?

Or we could just use Nix [1] (TL;DR version - [2]) :P

That said, Nix mostly with high-level caching, and won't help 
with incremental compilation.

Checkout the previous efforts in this area: [3] [4]

[1]: https://edolstra.github.io/pubs/phd-thesis.pdf
[2]: https://nixos.org/guides/how-nix-works.html
[3]: https://www.youtube.com/watch?v=WHb7y3JYEBQ
[4]: https://github.com/dlang/dmd/pull/7843


More information about the Digitalmars-d mailing list