09.09.2026 13:59, Anthony J. Bentley пишет:
> 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.
We could also add a few likely candidates to configure args by default,
say -DCCACHE=OFF, -CCACHE_Found=FALSE, etc.
> If there isn't one, we can at least add an explicit build dependency.
I'm not convinced we should help the port(er) use ccache(1) directly.
Rather all usage should go through USE_CCACHE, which does warn if the
package is missing.
>
> 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)
Same check twice?
> + @printf '#!/bin/sh\n\
> + echo "*** $$0 was called without devel/ccache dependency ***"
> >&2\n\
Again, I'd refer to our bsd.port.mk knob and not encourage direct use.
> + 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)
Same.
> + @printf '#!/bin/sh\n\
> + echo "*** $$0 was called without devel/sccache dependency ***"
> >&2\n\
Same.
> + 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\
>