From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Jul 1 16:30:09 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB876106567A for ; Sun, 1 Jul 2012 16:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9DE368FC14 for ; Sun, 1 Jul 2012 16:30:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q61GU9jc044520 for ; Sun, 1 Jul 2012 16:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q61GU9Um044517; Sun, 1 Jul 2012 16:30:09 GMT (envelope-from gnats) Resent-Date: Sun, 1 Jul 2012 16:30:09 GMT Resent-Message-Id: <201207011630.q61GU9Um044517@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bryan Drewery Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC6991065670 for ; Sun, 1 Jul 2012 16:26:39 +0000 (UTC) (envelope-from bryan@shatow.net) Received: from secure.xzibition.com (secure.xzibition.com [173.160.118.92]) by mx1.freebsd.org (Postfix) with ESMTP id 59B948FC14 for ; Sun, 1 Jul 2012 16:26:39 +0000 (UTC) Received: (qmail 20500 invoked from network); 1 Jul 2012 11:26:31 -0500 Received: from unknown (HELO test8.xzibition.com) (10.10.0.34) by sweb.xzibition.com with SMTP; 1 Jul 2012 11:26:31 -0500 Received: by test8.xzibition.com (sSMTP sendmail emulation); Sun, 01 Jul 2012 11:25:50 -0500 Message-Id: <20120701162639.AC6991065670@hub.freebsd.org> Date: Sun, 01 Jul 2012 11:25:50 -0500 From: "Bryan Drewery" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: portmgr@FreeBSD.org Subject: ports/169579: [bsd.port.mk] [exp-run] ccache support for building ports X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bryan Drewery List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2012 16:30:10 -0000 >Number: 169579 >Category: ports >Synopsis: [bsd.port.mk] [exp-run] ccache support for building ports >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sun Jul 01 16:30:08 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Bryan Drewery >Release: FreeBSD 8.3-RELEASE i386 >Organization: >Environment: >Description: This patch adds ccache support to ports (off by default). Other patches have changed $CC to use ccache, which results in having a space in $CC. This breaks many ports such as boost and libtool ports. This patch however utilizes the symlinks in /usr/local/libexec/ccache/world/{cc,gcc,etc...} by prepending that directory into $PATH in the $MAKE_ENV. Using this method, I have seen 0 failures, compared to the $CC method which results in many build failures and requiring to define which ports do not support ccache. To enable: Define WANT_CCACHE= in /etc/make.conf The cache directory CCACHE_DIR defaults to /usr/obj/ccache Defining NO_CCACHE can disable ccache support in make.conf or in a port. This is mostly to allow compatibility with current setups utilizing NO_CCACHE. If $CC already contains ccache, the support is disabled in case of custom setup. Users can override other ccache env variables [1] by using MAKE_ENV+= in their make.conf. Such as: MAKE_ENV+= CCACHE_LOGFILE=/var/log/ccache.log To use ccache(1) from the command line to configure the size or view stats: CCACHE_DIR=/usr/obj/ccache ccache -s [1] https://ccache.samba.org/manual.html#_environment_variables >How-To-Repeat: >Fix: --- patch-ccache.txt begins here --- --- bsd.port.mk.orig 2012-06-30 12:38:02.000000000 -0500 +++ bsd.port.mk 2012-07-01 11:13:06.000000000 -0500 @@ -942,6 +942,13 @@ # that are explicitly marked MAKE_JOBS_UNSAFE. User settable. # MAKE_JOBS_NUMBER # - Override the number of make jobs to be used. User settable. +## cacche +# +# WANT_CCACHE +# - Enable CCACHE support (devel/ccache) +# CCACHE_DIR +# - Directory to use for ccache objects +# Default: /usr/obj/ccache # # For install: # @@ -2208,6 +2215,21 @@ .endif .endif +# ccache support +# Support NO_CCACHE for common setups, require WANT_CCACHE, and don't use if ccache already set in CC +.if !defined(NO_CCACHE) && defined(WANT_CCACHE) && !${CC:M*ccache*} +CCACHE_DIR?= /usr/obj/ccache + +# Avoid depends loops between pkg and ccache +. if !${.CURDIR:M*/devel/ccache} && !${.CURDIR:M*/ports-mgmt/pkg} +BUILD_DEPENDS+= ${LOCALBASE}/bin/ccache:${PORTSDIR}/devel/ccache +. endif + +# Prepend the ccache dir into the PATH and setup ccache env +MAKE_ENV+= PATH=${LOCALBASE}/libexec/ccache/world:${PATH} \ + CCACHE_DIR=${CCACHE_DIR} +.endif + PTHREAD_CFLAGS?= PTHREAD_LIBS?= -pthread --- patch-ccache.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: