New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 681961 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

EC: make clobber should clear ccache

Project Member Reported by shchen@google.com, Jan 17 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36

Steps to reproduce the problem:
1. make buildall -j builds SUPER slow
2. 
3. 

What is the expected behavior?
it should complete within a minute according to ec guys

What went wrong?
after running ccache -c, the build completed much faster

Did this work before? N/A 

Chrome version: 55.0.2883.95  Channel: stable
OS Version: OS X 10.12.2
Flash Version:
 

Comment 1 by shchen@chromium.org, Jan 17 2017

Cc: rspangler@chromium.org aaboagye@chromium.org sha...@chromium.org
Components: OS>Firmware>EC
Labels: -OS-Mac -Via-Wizard-Other OS-Chrome
Status: Available (was: Unconfirmed)
Owner: aaboagye@chromium.org
Status: Started (was: Available)
I'm wondering if it's a bit *rude* to clear the entire ccache? This is because ccache can be used by any repo. I wish there were a way to just remove the EC related cache entries.

I guess it's less of an issue if you're building within the chroot as it depends on how many other projects are using ccache. 

It's interesting that '-c' helped. The ccache manpage says the following about that option:

       -c, --cleanup
           Clean up the cache by removing old cached files until the specified file number and cache size limits are not exceeded. This also recalculates
           the cache file count and size totals. Normally, there is no need to initiate cleanup manually as ccache keeps the cache below the specified
           limits at runtime and keeps statistics up to date on each compilation. Forcing a cleanup is mostly useful if you manually modify the cache
           contents or believe that the cache size statistics may be inaccurate.

Maybe running the cleanup in `make clobber` wouldn't hurt, not necessarily clearing the entire cache. (That is, use '-c' and not '-C') I wouldn't have guessed from that description that '-c' actually removes cache entries, even though the limits had not been exceeded. My config file doesn't specify a file limit, but it does specify the max cache size (1.1GB) which wasn't exceeded. Here's an example that I just ran with 'make clobber' cleaning the cache as well.


(cr) ((5f67f2c...)) aaboagye@lithium ~/trunk/src/platform/ec $ ccache -s                                                                                         
cache directory                     /home/aaboagye/.ccache
primary config                      /home/aaboagye/.ccache/ccache.conf
secondary config      (readonly)    /etc/ccache.conf
cache hit (direct)                359346
cache hit (preprocessed)           54807
cache miss                        433780
called for link                    73335
called for preprocessing               2
multiple source files              17406
compile failed                       886
ccache internal error                  3
preprocessor error                   444
can't use precompiled header       17943
couldn't find the compiler             1
cache file missing                   793
unsupported source language        49180
no input file                      72765
files in cache                     76625
cache size                         822.5 MB
max cache size                       1.1 GB
(cr) ((5f67f2c...)) aaboagye@lithium ~/trunk/src/platform/ec $ make clobber
rm -rf build TAGS cscope.files cscope.out
/usr/bin/ccache -c
Cleaned cache
(cr) ((5f67f2c...)) aaboagye@lithium ~/trunk/src/platform/ec $ ccache -s
cache directory                     /home/aaboagye/.ccache
primary config                      /home/aaboagye/.ccache/ccache.conf
secondary config      (readonly)    /etc/ccache.conf
cache hit (direct)                359346
cache hit (preprocessed)           54807
cache miss                        433780
called for link                    73335
called for preprocessing               2
multiple source files              17406
compile failed                       886
ccache internal error                  3
preprocessor error                   444
can't use precompiled header       17944
couldn't find the compiler             1
cache file missing                   793
unsupported source language        49180
no input file                      72769
files in cache                     48212
cache size                         506.2 MB
max cache size                       1.1 GB
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/1f52e64ae6b3876746bbd6339a6282f5f3ab5818

commit 1f52e64ae6b3876746bbd6339a6282f5f3ab5818
Author: Aseda Aboagye <aaboagye@google.com>
Date: Thu Jan 26 01:31:00 2017

Makefile.rules: Clean ccache cache for 'clobber'.

In the chroot, we use ccache to speed up compilation.  However, it's
possible for this cache to become corrupt which could lead to slower
builds.  In order to keep things fresh, 'make clobber' should clean up
that ccache cache as well.  This commit makes it so.

Note, this is NOT *clearing* the cache entirely.

BUG= chromium:681961 
BRANCH=None
TEST=make clobber; verify that ccache is cleaned.

Change-Id: I8ccd7df4858c445485ed740843f3126af0abd33a
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/433108
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>

[modify] https://crrev.com/1f52e64ae6b3876746bbd6339a6282f5f3ab5818/Makefile.rules

Status: Verified (was: Started)
Merged; verified locally in CL.

Sign in to add a comment