Jump to content

CCache: Difference between revisions

Not related to NixOS, read https://ccache.dev/manual/4.8.2.html#_cache_statistics and run ccache -vs
imported>Pupbrained
m (Typo fixes)
(Not related to NixOS, read https://ccache.dev/manual/4.8.2.html#_cache_statistics and run ccache -vs)
 
(One intermediate revision by the same user not shown)
Line 156: Line 156:
</pre>
</pre>


== Uncacheable ==
== Sloppiness ==


TODO: why are some compilations "uncacheable" according to <code>ccache --show-stats</code>?
By default, <code>stdenv</code> inserts <code>-frandom-seed</code> C compiler flag with a value that changes whenever the derivation hash has changed.
Consequently, this behavior completely defeats any usage of <code>ccacheWrapper</code>
To counterpart this behavior, add the following line to the ccache config (typically <code>/var/cache/ccache/ccache.conf</code>):
<pre>
sloppiness = random_seed
</pre>
 
Be warned that this configuration option might affect reproducibility of builds, and could lead to cache poisoning.
See [https://github.com/NixOS/nixpkgs/issues/109033 issue 109033] for more details.


== See also ==
== See also ==
2

edits