There are probably still several ports with hidden deps on ccache.
This should catch them.
If upstream has a knob to turn off ccache, the port should use it.
If there isn't one, we can at least add an explicit build dependency.
ok?
--- infrastructure/mk/bsd.port.mk
+++ infrastructure/mk/bsd.port.mk
@@ -452,7 +452,8 @@ CCACHE_DIR ?= ${WRKOBJDIR_${PKGPATH}}/.ccache
MAKE_ENV += CCACHE_DIR=${CCACHE_DIR} ${CCACHE_ENV}
CONFIGURE_ENV += CCACHE_DIR=${CCACHE_DIR}
# scons cleans the environment when calling the compiler
-COMPILER_WRAPPER += env CCACHE_DIR=${CCACHE_DIR} ${CCACHE_ENV} ccache
+COMPILER_WRAPPER += env CCACHE_DIR=${CCACHE_DIR} ${CCACHE_ENV} \
+ ${LOCALBASE}/bin/ccache
. if !exists(${LOCALBASE}/bin/ccache)
ERRORS += "Fatal: USE_CCACHE is set, but ccache is not installed."
. endif
@@ -2783,6 +2784,13 @@ ${_WRKDIR_COOKIE}:
@${_PBUILD} mkdir -p ${WRKDIR} ${WRKDIR}/bin
@${_wrap_install_commands}
# poison some common binaries unless the relevant BUILD_DEPENDS is used
+.if empty(_BUILD_DEP:Mdevel/ccache) && \
+ empty(_BUILD_DEP:Mdevel/ccache)
+ @printf '#!/bin/sh\n\
+ echo "*** $$0 was called without devel/ccache dependency ***"
>&2\n\
+ exit 1\n' ${_PREDIR} ${WRKDIR}/bin/ccache
+ @${_PBUILD} chmod 555 ${WRKDIR}/bin/ccache
+.endif
.if empty(_BUILD_DEP:Mdevel/gettext,-tools) && \
empty(_BUILD_DEP:Mtextproc/intltool)
@printf '#!/bin/sh\n\
@@ -2793,6 +2801,13 @@ ${_WRKDIR_COOKIE}:
@${_PBUILD} ln -sf msgfmt ${WRKDIR}/bin/${name}
. endfor
.endif
+.if empty(_BUILD_DEP:Mdevel/sccache) && \
+ empty(_BUILD_DEP:Mdevel/sccache)
+ @printf '#!/bin/sh\n\
+ echo "*** $$0 was called without devel/sccache dependency ***"
>&2\n\
+ exit 1\n' ${_PREDIR} ${WRKDIR}/bin/sccache
+ @${_PBUILD} chmod 555 ${WRKDIR}/bin/sccache
+.endif
.if empty(_BUILD_DEP:Mtextproc/asciidoc)
@printf '#!/bin/sh\n\
echo "*** $$0 was called without textproc/asciidoc dependency
***" >&2\n\