Bug 203107 - devel/ccache: installworld fails with ccache, mk/bsd.compiler.mk unable to determine compiler
Summary: devel/ccache: installworld fails with ccache, mk/bsd.compiler.mk unable to de...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-14 19:56 UTC by Tony Narlock
Modified: 2015-11-06 20:50 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bdrewery)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Narlock 2015-09-14 19:56:24 UTC
Related: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=173914

I was able to do `make buildworld` successfully. However, I had to `installworld` like this:

sudo make installworld COMPILER_TYPE=clang

Other relation: https://svnweb.freebsd.org/ports?view=revision&revision=316346

Maybe COMPILER_TYPE should have a helper for `installworld` too?


$ freebsd-version -ku; uname -apKU
11.0-CURRENT
11.0-CURRENT
FreeBSD z600 11.0-CURRENT FreeBSD 11.0-CURRENT #6: Sun Sep 13 22:16:54 CDT 2015     root@z600:/usr/obj/usr/src/sys/MYKERNEL  amd64 amd64 1100079 1100079


$ pkg info ccache
ccache-3.2.3
Name           : ccache
Version        : 3.2.3
Installed on   : Wed Sep  9 18:10:31 CDT 2015
Origin         : devel/ccache
Architecture   : freebsd:11:x86:64
<chop>

$ cat /etc/make.conf
MALLOC_PRODUCTION=1
                                                                          

.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
.if !defined(NOCCACHE) && exists(/usr/local/libexec/ccache/world/cc)
CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1}
CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1}
.endif
.endif


$ cat /etc/profile 

LANG=en_US.UTF-8;   export LANG
CHARSET=UTF-8;  export CHARSET
GDM_LANG=en_US.UTF-8;   export GDM_LANG

export CCACHE_DIR=/usr/.ccache
export PATH=/usr/local/libexec/ccache:$PATH
export CCACHE_PATH=/usr/bin:/usr/local/bin
export CCACHE_MAXSIZE=10
Comment 1 Bryan Drewery freebsd_committer 2015-09-14 20:47:52 UTC
Strange, I have not run into this and use ccache in installworld frequently.
Comment 2 Bryan Drewery freebsd_committer 2015-09-16 17:12:28 UTC
Actually I just noticed I have 'COMPILER_TYPE=clang' in my make.conf for CCACHE. I should update the example configuration.

As a side note, the current support is not very good and needs to be rethought to avoid
issues like this and the XCC one.
Comment 3 Bryan Drewery freebsd_committer 2015-10-06 22:05:04 UTC
I'm working on a more official support for ccache in buildworld. The WIP is at https://reviews.freebsd.org/D3736
Comment 4 Bryan Drewery freebsd_committer 2015-11-06 20:49:43 UTC
This should be fixed by the following, without needing to set COMPILER_TYPE:

r290417 | imp | 2015-11-05 13:48:12 -0800 (Thu, 05 Nov 2015) | 10 lines

Fix CC being wrong during install* targets.

Move CROSS_TOOLS stuff to top of file (before bsd.compiler.mk) so that
decisions made by bsd.compiler.mk can properly affect the defaults in
src.opts.mk. Move that to after bsd.compiler.mk. Add a comment about
why we include bsd.compiler.mk here despite the fact that src.opts.mk
currently does too. Also remove bsd.arch.inc.mk that's been OBE.

Differential Revision: https://reviews.freebsd.org/D4087