ccache: zero cache hit ratio on port update

Rozhuk Ivan rozhuk.im at gmail.com
Sun Dec 20 21:05:56 UTC 2020


Hi!

I spent some time to digg into this.
This is my 2-3 attempt to fix it. [1]


Current we have normal cache hit ratio on port rebuild and
zero on version/hashtag/any_thing_that_change_port_src_dir_name.

Zero cache hit ratio even if only readme.md changed in project,
that causes hashtag->dir name change.

Most annoying effect of this - build time for heavy projects
is very different:
chorome: build ~4 hours, rebuild 15 minutes. (Ryzen 2700x)
I do not expext that 4h->15m, but even 2h - is good motivation for me.


I know two ways to fix it:

1. Change port system to use static names
Example:
Now: /tmp/ports/usr/ports/net/ssdpd/work/ssdpd-784c7a726c26561bb65345b71b4e1726b69f58c7/
Fixed: /tmp/ports/usr/ports/net/ssdpd/work/ssdpd
Fixed: /tmp/ports/usr/ports/net/ssdpd/work/src
(Can some one explain: why port system add version/hashtag/random to dir name?)
(Is it strongly required?)

2. Do something with ccache + out of source build:
https://github.com/ccache/ccache/issues/751


[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246245


More information about the freebsd-hackers mailing list