From owner-freebsd-ports@FreeBSD.ORG Wed Jun 18 21:45:55 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AB2A1065678 for ; Wed, 18 Jun 2008 21:45:55 +0000 (UTC) (envelope-from carpetsmoker-dated-1214688438.5c9d71@rwxrwxrwx.net) Received: from mail.rwxrwxrwx.net (rwxrwxrwx.net [82.93.23.199]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5688FC14 for ; Wed, 18 Jun 2008 21:45:55 +0000 (UTC) (envelope-from carpetsmoker-dated-1214688438.5c9d71@rwxrwxrwx.net) Received: from localhost (unknown [127.0.0.1]) by mail.rwxrwxrwx.net (Postfix) with ESMTP id CB88A6D442 for ; Wed, 18 Jun 2008 23:27:21 +0200 (CEST) Received: from mail.rwxrwxrwx.net ([127.0.0.1]) by localhost (mail.rwxrwxrwx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aPnKyuPSu247 for ; Wed, 18 Jun 2008 23:27:18 +0200 (CEST) Received: by mail.rwxrwxrwx.net (Postfix, from userid 1001) id 688F56D43D; Wed, 18 Jun 2008 23:27:18 +0200 (CEST) Received: by glitch.rwxrwxrwx.net (tmda-sendmail, from uid 1001); Wed, 18 Jun 2008 23:27:18 +0200 Date: Wed, 18 Jun 2008 23:27:16 +0200 To: freebsd-ports@freebsd.org Message-ID: <20080618212716.GA61331@rwxrwxrwx.net> References: <20080618125154.GC90685@k7.mavetju> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20080618125154.GC90685@k7.mavetju> User-Agent: Mutt/1.5.17 (2007-11-01) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Martin Tournoij Mail-Followup-To: freebsd-ports@freebsd.org X-Primary-Address: carpetsmoker@rwxrwxrwx.net Subject: Re: Standardize NO_CCACHE flag and ccache definitions X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Martin Tournoij List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2008 21:45:55 -0000 On Wed, Jun 18, 2008 at 10:51:54PM +1000, Edwin Groothuis wrote: > Hello, > > Recently I've started to use devel/ccache again (sometimes it takes > a while before you understand how it works) and it works pretty > well, except for some ports which can't be build with it. For example > devel/cmake. > > To prevent everybody from having to re-invent the wheel, we could > introduce a NO_CCACHE flag in the affected ports Makefile: > > NO_CCACHE=yes Hi Edwin, There are some ports which refuse to compile with ccache, these all seem to be projects which use scons, unlike make, scons does not copy the user's environment automatically, and the required environment variables for ccache (like CCACHE_DIR) aren't present, which leads to build failure, an example is games/freera. I'm not that familiar with scons, and what exactly the "proper way" is to handle this sort of stuff in scons, I looked at it some time ago for a port I maintain (graphics/gsculpt), and from what I remember, just copying the entire user's environment to the scons build environment is not as easy as it sounds, I don't remember the details. The fix I used was to just copy the ccache environment variables ... Quick 'n dirty, but it works. I didn't look at it very long, so there could be a better way. Note that some applications like graphics/blender work fine with ccache without modification (Note that the current blender port doesn't use scons, but a previous version did). Writing *good* SConstruct files seems to be relatively hard/complicated ... Which is seems to be why most projects don't have good SConstruct files. In any case, there seem to be only a few isolated ports which don't compile with ccache, fixing those also seems to be pretty easy ... So before implementing NO_CCACHE fixing the ports seems like a better idea IMO, if you want I can search for broken scons ports and fix if necessary. Not sure if there are other scenarios where ccache fails, I have used it for years in various environments (including jails/tinderboxes) without any problems other than those outlined above. -- Martin Tournoij carpetsmoker@rwxrwxrwx.net http://www.daemonforums.org QOTD: We all like praise, but a hike in our pay is the best kind of ways.