With help from pkgsrc-users and a colleague, I've partially figured out a ccache mystery. All is with HEAD pkgsrc. On a Mac, I started getting constant cache misses. I tested on NetBSD/i386 5.1ish, or so I thought, and seemed to have the same problem. Note that CCACHE_HASHCC was in 2.4 and has been withdrawn from 3.1.4. On the mac, putting CCACHE_COMPILERCHECK in the environment resolves the issue, and caching works as expected (but the old cache contents won't hit, since they used a different compiler version hash). On NetBSD, the following doesn't seem to have any effect. I don't understand why this was ever needed, because work/.ccache/bin seems to be a symlink to ccache, and the real compiler doesn't change. But I don't fully understand the ccache/gcc layering. So, can anyone explain why CCACHE_HASHCC was necessary? And if so, whether they think CCACHE_COMPILERCHECK should be set? --- ccache.mk.~1.32.~ 2009-10-05 08:36:46.000000000 -0400 +++ ccache.mk 2011-03-30 16:38:04.000000000 -0400 @@ -119,9 +119,12 @@ BUILD_DEPENDS+= ccache-[0-9]*:../../deve . endif # Override the compiler-specific hash with the version string for the -# compiler. -# +# compiler (ccache 2.4). PKGSRC_MAKE_ENV+= CCACHE_HASHCC=${CC_VERSION_STRING:Q} +# Similar for modern ccache (ccache 3.1.4). We ask ccache to run the +# compiler with -v, and treat matching output as a matching compiler. +PKGSRC_MAKE_ENV+= CCACHE_COMPILERCHECK="%compiler% -v" + PKGSRC_MAKE_ENV+= CCACHE_DIR=${CCACHE_DIR:Q} # Create symlinks for the compiler into ${WRKDIR}.
Attachment:
pgpXoXuO1WNXh.pgp
Description: PGP signature