Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Aug 2017 18:26:20 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321887 - in head: . share/mk
Message-ID:  <201708011826.v71IQK5j072218@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Tue Aug  1 18:26:20 2017
New Revision: 321887
URL: https://svnweb.freebsd.org/changeset/base/321887

Log:
  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

Modified:
  head/Makefile.inc1
  head/share/mk/bsd.compiler.mk

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Tue Aug  1 18:25:04 2017	(r321886)
+++ head/Makefile.inc1	Tue Aug  1 18:26:20 2017	(r321887)
@@ -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}

Modified: head/share/mk/bsd.compiler.mk
==============================================================================
--- head/share/mk/bsd.compiler.mk	Tue Aug  1 18:25:04 2017	(r321886)
+++ head/share/mk/bsd.compiler.mk	Tue Aug  1 18:26:20 2017	(r321887)
@@ -82,8 +82,11 @@ PATH:=	${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?
 ${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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708011826.v71IQK5j072218>