From owner-svn-ports-all@freebsd.org Thu Feb 11 01:33:08 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C230AA01DA; Thu, 11 Feb 2016 01:33:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1AEF1957; Thu, 11 Feb 2016 01:33:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1B1X7D0070339; Thu, 11 Feb 2016 01:33:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1B1X6Ip070337; Thu, 11 Feb 2016 01:33:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602110133.u1B1X6Ip070337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 11 Feb 2016 01:33:06 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r408673 - in head/devel/ccache: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Feb 2016 01:33:08 -0000 Author: bdrewery Date: Thu Feb 11 01:33:06 2016 New Revision: 408673 URL: https://svnweb.freebsd.org/changeset/ports/408673 Log: - Don't cache -fcolor-diagnostics. Unlike gmake, which ccache is primarily targetted at, our make does not give a TTY to stderr. Thus make -j does not use -fcolor-diagnostics by default. If you run with make -j, then run make again ccache will add in -fcolor-diagnostics and find only cache misses. Skip processing of -fcolor-diagnostics (and gcc equivalents) to avoid this problem and fix cache hits when flip-flopping between TTY/colors. Fixing our make is possible but this change also allows the user to decide to add -fcolor-diagnostics and still use their existing uncolored cache. Modified: head/devel/ccache/Makefile head/devel/ccache/files/patch-ccache.c Modified: head/devel/ccache/Makefile ============================================================================== --- head/devel/ccache/Makefile Thu Feb 11 01:29:36 2016 (r408672) +++ head/devel/ccache/Makefile Thu Feb 11 01:33:06 2016 (r408673) @@ -3,7 +3,7 @@ PORTNAME= ccache PORTVERSION= 3.2.4 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= http://www.samba.org/ftp/ccache/ \ LOCAL/bdrewery Modified: head/devel/ccache/files/patch-ccache.c ============================================================================== --- head/devel/ccache/files/patch-ccache.c Thu Feb 11 01:29:36 2016 (r408672) +++ head/devel/ccache/files/patch-ccache.c Thu Feb 11 01:33:06 2016 (r408673) @@ -1,4 +1,8 @@ -Determine whether cc(1) is clang or gcc at compile-time. +- Determine whether cc(1) is clang or gcc at compile-time. +- Don't hash -fcolor-diagnostics; make will auto use it while make -j will not. + There's no reason to not use the cache in either of these cases if it is + already available. +-bdrewery --- ccache.c.orig 2015-10-08 19:14:23 UTC +++ ccache.c @@ -26,3 +30,33 @@ Determine whether cc(1) is clang or gcc free(name); return is; } +@@ -1463,6 +1473,7 @@ calculate_common_hash(struct args *args, + free(p); + } + ++#if 0 + /* Possibly hash GCC_COLORS (for color diagnostics). */ + if (compiler_is_gcc(args)) { + const char *gcc_colors = getenv("GCC_COLORS"); +@@ -1471,6 +1482,7 @@ calculate_common_hash(struct args *args, + hash_string(hash, gcc_colors); + } + } ++#endif + } + + /* +@@ -1509,6 +1521,13 @@ calculate_object_hash(struct args *args, + continue; + } + ++ /* Colors do not affect compilation. */ ++ if (str_startswith(args->argv[i], "-fcolor-diagnostics") || ++ str_eq(args->argv[i], "-fdiagnostics-color") || ++ str_eq(args->argv[i], "-fdiagnostics-color=always")) { ++ continue; ++ } ++ + /* The -fdebug-prefix-map option may be used in combination with + * CCACHE_BASEDIR to reuse results across different directories. Skip it + * from hashing. */