ccache: differences between building world and kernel

I'd like to use ccache(1) to rebuild kernels. In my current setup the buildworld target uses the ccache(1) symlinks as expected, but the buildkernel one doesn't.

I'm using the suggested snippet (/usr/local/share/doc/ccache/ccache-howto-freebsd.txt) in /etc/make.conf. It's similar to what i've seen on other threads:
Code:
.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
.if !defined(NOCCACHE)
C:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1}
CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1}
.endif
.endif

I don't know enough make(1) syntax to understand how those variable expansion work, and I'm not finding anything about the C and CXX variables in make.conf(5) or in /usr/share/examples/etc/make.conf anyway...

Is there some fundamental difference between world and kernel that's preventing the compilation system from going through the ccache symlinks ?
 
lbc said:
Code:
.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
.if !defined(NOCCACHE)
[color="Red"]C[/color]:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1}
CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1}
.endif
.endif

That should be CC.
 
  • Thanks
Reactions: lbc
Incidentally, setting ccache(1) to keep the cache files compressed will allow more files in the same space. When I tested it, it was actually a tiny bit faster than uncompressed. Barely measurable, but the point is that there's no speed penalty.

Do that by setting
Code:
setenv CCACHE_COMPRESS yes

along with the other variables for ccache.
 
Thanks Warren, I needed that second pair of eyes. I should probably think about enabling syntax coloring in vim to avoid such crude typos in the future :)

I'm sure there's little to no speed penalty using modern CPUs to decompress things on the fly on such disk-bound tasks as compiling. I'm also a fan of storing the compilation cache in /var/cache/ccache using CCACHE_DIR and sharing it amongst users of a developers groups, as has been described in other threads in the forums.

(That probably stems from my using of an OS where you're both urged not to elevate your privileges mindlessly, and often stumble upon a piece of a build system that doesn't play nice with non-root users...)
 
wblock@ said:
Incidentally, setting ccache(1) to keep the cache files compressed will allow more files in the same space. When I tested it, it was actually a tiny bit faster than uncompressed. Barely measurable, but the point is that there's no speed penalty.

Do that by setting
Code:
setenv CCACHE_COMPRESS yes

along with the other variables for ccache.

What if there's zfs lzjb compression enabled already?
 
Back
Top