Page MenuHomeFreeBSD

Add WITH_CCACHE_BUILD support similar to the ports support.
AbandonedPublic

Authored by bdrewery on Sep 26 2015, 2:35 PM.

Details

Summary

This adds a WITH_CCACHE_BUILD knob that will handle using ccache properly.
The ccache guide has advised people to modify CC and CXX to point to
/usr/local/libexec/world/cc, but this causes Makefile.inc1 to consider it
an external compiler, confuses bsd.compiler.mk, and has proved in ports to
be a bad idea due to not being an expected compiler. This also ensures
users are using the world wrappers which handle compiler upgrades properly,
vs default ccache which does not.

Avoid these pitfalls by just adding the world wrappers into the PATH, which
will still cause the ccache wrappers to call the normal CC. This will work
fine whether CC is the bootstrapped cc or an external user-set one.

Obviously this is not complete. Adding mkopt knobs for this and documentation
is needed as well. I just want to get it out for discussion and early testing.
It is working for me great and the pattern has worked in ports for several
years now.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 704
Build 704: arc lint + arc unit

Event Timeline

bdrewery updated this revision to Diff 8946.
bdrewery retitled this revision from to Add WITH_CCACHE_BUILD support similar to the ports support..
bdrewery updated this object.
bdrewery edited the test plan for this revision. (Show Details)
bdrewery added reviewers: imp, brooks, bapt, emaste.

Minor fix

Update with increased scope. This works for META_MODE and buildworld. The
META_MODE support made me realize it was more tricky.

The goal of this is to replace the "official" way of building with ccache
with this build knob so it "just works" rather than issues like
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203107
and the one I was fixing in https://reviews.freebsd.org/D3484.

Is this still applicable, or does it need a refresh after other changes?