Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ccache removal (solved)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
b0nafide
Apprentice
Apprentice


Joined: 17 Feb 2008
Posts: 171
Location: ~/

PostPosted: Mon Nov 08, 2010 12:14 am    Post subject: ccache removal (solved) Reply with quote

Imagine my surprise when I installed my latest gentoo system and read in the gentoo handbook that ccache is actually not recommended and can break things. In the past I had emerged ccache without a second thought.

Well, seeing as I normally don't emerge the same packages over and over again, I've decided to get rid of ccache.

Is removing ccache from FEATURES in make.conf and "emerge --unmerge ccache" enough? Is there anything else that should be done before I start compiling again?

edit: things seem ok, compiling seems to work...


Last edited by b0nafide on Tue Nov 09, 2010 5:00 am; edited 3 times in total
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1191
Location: Austria

PostPosted: Mon Nov 08, 2010 7:21 am    Post subject: Reply with quote

you might want to remove /var/tmp/ccache and the /root/.ccache/ directories to have some space again. But in general, that's it.
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
b0nafide
Apprentice
Apprentice


Joined: 17 Feb 2008
Posts: 171
Location: ~/

PostPosted: Mon Nov 08, 2010 4:28 pm    Post subject: Reply with quote

Thanks, I'll do that too.

Edit: Bwahahaha! I now know why ccache -s was always reporting 0 cache hits! It wasn't that I didn't compile anything twice - Turns out I hadn't created /var/tmp/ccache but told portage that was the ccache directory... no wonder ccache didn't break anything in the past... :oops:

Probably for the best anyway...
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1191
Location: Austria

PostPosted: Mon Nov 08, 2010 7:28 pm    Post subject: Reply with quote

b0nafide wrote:
no wonder ccache didn't break anything in the past... :oops:


I have been using ccache and I am still using it. It never did break stuff here - at least if it did, it broke the things that clever that I didn't notice.

ccache -s as root reads stuff from /root/.ccache - which I have replaced with a symlink to /var/tmp/ccache/ here to have the stats.
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Mon Nov 08, 2010 8:43 pm    Post subject: Reply with quote

Quote:
I have been using ccache and I am still using it. It never did break stuff here - at least if it did, it broke the things that clever that I didn't notice.


I use ccache on all systems (30+) and will continue to do so even if the package was removed from portage.

It has broken an emerge a few times but easily I can fix that by rerunning the emerge with
Code:
FEATURES="-ccache" emerge somepackage

_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
b0nafide
Apprentice
Apprentice


Joined: 17 Feb 2008
Posts: 171
Location: ~/

PostPosted: Tue Nov 09, 2010 2:51 am    Post subject: Reply with quote

Well, now I'm not sure why ccache has a big warning on the 'portage features' documentation nowadays.

This is silly (and a different topic all of a sudden). Can anybody give an example of a situation where ccache does break compiling?
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Tue Nov 09, 2010 3:00 am    Post subject: Reply with quote

I have not kept any list or any thing. I have had 1 or 2 packages fail to build last week though and emerging with ccache off it built fine.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6749

PostPosted: Tue Nov 09, 2010 10:56 am    Post subject: Reply with quote

drescherjm wrote:
I have not kept any list or any thing. I have had 1 or 2 packages fail to build last week though and emerging with ccache off it built fine.

I think everybody has occassional error emerging a package and the re-emerge wents fine. Usually this is due to the fact that a dependency was forgotten in the build system. I would be very surprised if you find something where ccache really is the fault (except for hash collissions which can of course theoretically happen but are extremely unlikely). The only case where ccache really can cause trouble is if the cache is broken, e.g. of a sudden shutdown or kill during compilation happened to the package. Unfortunately, this can happen if e.g. you run out of memory during compilation and the kernel decides to kill ccache in an unhappy moment. But apart from such (still rather exotic) situations, I doubt that you can find something (in particular, something reproducable) where compilation with ccache fails.

Edit: In case, it is not clear: The warning that ccache can break things is indeed silly. It was an overreaction on Diego's suggestion to not enable ccache by default (which already was not a wise decision) but to recommend the opposite (even using technically incorrect arguments) was certainly not appropriate.
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Tue Nov 09, 2010 12:53 pm    Post subject: Reply with quote

For a few packages I am pretty sure ccache caused the problem as I tried rebuilding them more than once before disabiling ccache and then the build succeeded. There are not many of these however and it may be multilib (the overlay) related or similar.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
rh1
Guru
Guru


Joined: 10 Apr 2010
Posts: 501

PostPosted: Tue Nov 09, 2010 1:00 pm    Post subject: Reply with quote

This kind of explains why it's not recommended:
https://bugs.gentoo.org/327945
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6749

PostPosted: Tue Nov 09, 2010 8:44 pm    Post subject: Reply with quote

drescherjm wrote:
For a few packages I am pretty sure ccache caused the problem as I tried rebuilding them more than once before disabiling ccache

Sure, once the ccache cache gets broken (e.g. by an unexpected kill) you will never be able to emerge the package succesfully until you delete the existing cache.

Of course, if you get troubles, if you use some method which changes the compiler frontend or backend without touching the compiler executable and without explicit parameters (e.g. if you add parameters by means of a gcc spec file, ccache has no chance to see that a different result would be compiled). Proably something similar can happen on tricky cross-compile setups. However, if you do such complicated things you should be familliar with the consequences anyway.

rh1 wrote:
This kind of explains why it's not recommended:

This is what I was referring to when I spoke about overreaction: Diego's original suggestion was to remove the text passage which speaks about speed gain of factor 5-10. Here he is completely right: This is certainly not a claim you can make in general, since it depends very much on the machine you are using (on a very fast processor with lots of ram ccache is less useful - or might in some settings even slow down on average - than on a slow machine). However, except for some FUD also in this thread there was never a proof about ccache causing particular problems. (Moreover, if some package would really be known to cause troubles with ccache, the appropriate solution would be to introduce RESTRICT=ccache or something similar for that exceptional package.)
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Tue Nov 09, 2010 8:47 pm    Post subject: Reply with quote

Quote:
Sure, once the ccache cache gets broken (e.g. by an unexpected kill) you will never be able to emerge the package succesfully until you delete the existing cache.


That is certainly possible.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1191
Location: Austria

PostPosted: Tue Nov 09, 2010 9:01 pm    Post subject: Reply with quote

So it's not ccache in general that's misbehaving - it's its cache.
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6749

PostPosted: Tue Nov 09, 2010 10:25 pm    Post subject: Reply with quote

ToeiRei wrote:
So it's not ccache in general that's misbehaving - it's its cache.

No. It is whatever caused the cache to be corrupted (power loss or bad harddisk or whatever). With the same argument you could blame any filesystem to be misbehaving, because - once its files became corrupted for some reason - it reproduces to give you the broken files. If such a thing happened, you have to restore your backup (or in case of ccache simpler: clear the cache) to obtain correct data again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum