Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Aug 2012 20:05:54 -0500
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports@FreeBSD.org
Subject:   [CFT] [bsd.port.mk] ports ccache build support
Message-ID:  <501C7572.3020707@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------010907060809010505080901
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi,

ports/169579 is currently tracking this.

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/{cc,gcc,etc...} by prefixing 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 WITH_CCACHE_BUILD=yes 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

FWIW, this is also possible to achieve with bsd.local.mk [2], but it
would be much nicer to support without needing to customize your checkout.

[1] https://ccache.samba.org/manual.html#_environment_variables
[2] http://fossil.etoilebsd.net/poudriere/doc/trunk/doc/ccache.wiki


-- 
Regards,
Bryan Drewery
bdrewery@freenode/EFNet



--------------010907060809010505080901
Content-Type: text/plain; charset=windows-1252;
	name="patch-bsd.port.mk-ccache.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="patch-bsd.port.mk-ccache.txt"

LS0tIGJzZC5wb3J0Lm1rLm9yaWcJMjAxMi0wOC0wNCAwMjo1NzoxOS4wMD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ovZGV2ZWwvY2NhY2hlfSAmJiAhJHsuQ1VSRElSOk0qL3BvcnRzLW1n
bXQvcGtnfQorQlVJTERfREVQRU5EUys9CQkke0xPQ0FMQkFTRX0vYmluL2NjYWNoZToke1BP
UlRTRElSfS9kZXZlbC9jY2FjaGUKKy4JZW5kaWYKKworIyBQcmVwZW5kIHRoZSBjY2FjaGUg
ZGlyIGludG8gdGhlIFBBVEggYW5kIHNldHVwIGNjYWNoZSBlbnYKK01BS0VfRU5WKz0JUEFU
SD0ke0xPQ0FMQkFTRX0vbGliZXhlYy9jY2FjaGU6JHtQQVRIfSBcCisJCQlDQ0FDSEVfRElS
PSR7Q0NBQ0hFX0RJUn0KKy5lbmRpZgorCiBQVEhSRUFEX0NGTEFHUz89CiBQVEhSRUFEX0xJ
QlM/PQkJLXB0aHJlYWQKIAo=
--------------010907060809010505080901--



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