CCACHE_BUILD: Follow-up r321880: Fix some PATH issues with buildworld.

- bsd.compiler.mk: Must ensure that the CCACHE_WRAPPER_PATH comes first
  in PATH.
- Makefile.inc1: Must prepend the CCACHE_WRAPPER_PATH into BPATH as it
  overrides the PATH set in bsd.compiler.mk in sub-makes.  The PATH
  set in bsd.compiler.mk is not exported and doing so would cause it to
  then override the BPATH set from environment.  The only sane solution
  is to prepend into BPATH as needed.
CCACHE_PATH could possibly be used for some of this as well.

Sponsored by:	Dell EMC Isilon
This commit is contained in:
bdrewery 2017-08-01 18:26:20 +00:00
parent 3e6e87b1e5
commit f5c5b3c9c9
2 changed files with 5 additions and 2 deletions

View File

@ -444,7 +444,7 @@ BUILD_ARCH!= uname -p
.endif
.endif
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin
BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
STRICTTMPPATH= ${BPATH}:${XPATH}
TMPPATH= ${STRICTTMPPATH}:${PATH}

View File

@ -82,8 +82,11 @@ PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g}
${var}:= ${CCACHE_BIN} ${${var}}
.endif
.endfor
.elif empty(PATH:M*${CCACHE_WRAPPER_PATH}*)
.else
# Need to ensure CCACHE_WRAPPER_PATH is the first in ${PATH}
PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g}
PATH:= ${CCACHE_WRAPPER_PATH}:${PATH}
CCACHE_WRAPPER_PATH_PFX= ${CCACHE_WRAPPER_PATH}:
.endif # ${CCACHE_BUILD_TYPE} == "command"
# GCC does not need the CCACHE_CPP2 hack enabled by default in devel/ccache.
# The port enables it due to ccache passing preprocessed C to clang