Bug 402881 - ccache and icecream should work together
ccache and icecream should work together
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: ccache (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-28 09:50 EST by Michal Schmidt
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-29 19:27:24 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
teach ccache about icecream (2.48 KB, patch)
2007-11-28 09:50 EST, Michal Schmidt
no flags Details | Diff

  None (edit)
Description Michal Schmidt 2007-11-28 09:50:47 EST
Description of problem:
icecream is a distributed compiler (see http://en.opensuse.org/Icecream). 
icecream is in Rawhide. If both ccache and icecream are installed, icecream is 
effectively disabled. Compilation jobs are handled by ccache, but cache misses 
are not passed to icecream.

Version-Release number of selected component (if applicable):
ccache-2.4-11

How reproducible:
always

Steps to Reproduce:
1. Install icecream on a few machines on LAN, run icecc-scheduler on one of 
them, run iceccd on all of them (including your own). Install ccache on your 
own computer.
2. Login on your machine. Notice that 'which gcc' points to ccache (that's 
fine and expected).
3. Compile a kernel or something else with -j20. Notice that your ccache cache 
is being populated, but since ccache does not know about icecream, the compile 
jobs are not distributed to the other machines.
  
Actual results:
Everything is compiled locally.

Expected results:
Compile jobs should be distributed to other nodes running iceccd.

Additional information:
The attached patch makes ccache aware of icecream.
Comment 1 Michal Schmidt 2007-11-28 09:50:47 EST
Created attachment 271341 [details]
teach ccache about icecream
Comment 2 Ville Skyttä 2007-11-28 13:30:31 EST
Looks pretty sane at first sight, some comments though.

I'm slightly worried about unconditionally overriding $PATH that way.  Wouldn't
that produce unexpected results if let's say a user wishes to use a real
compiler executable from /usr/local/bin (which comes before /usr/bin in the
default Fedora $PATH)?

Also, I'm not quite sure what the conditional in the wrapper script is for -
wouldn't it work to just always prepend $libdir/icecc/bin to $PATH?  See eg.
http://gentoo-wiki.com/HOWTO_Setup_An_ICECREAM_Compile_Cluster#Icecream_and_ccache
(There's also a link to a C wrapper on that page which could be a bit faster
than invoking the shell)

Perhaps also doing 'exec ccache $compiler "$@"' instead of 'ccache $compiler
"$@"' could be a slight optimization (if the C wrapper above would not be used)?

Does ccache need to be invoked with hardcoded full path in the wrapper rather
than just invoking it as "ccache"?
Comment 3 Michal Schmidt 2007-11-29 07:17:08 EST
Good points. I'll play with it some more and see what works best.
Comment 4 Michal Schmidt 2007-11-29 19:27:24 EST
Actually no changes in ccache are required. In my earlier testing I had the 
order of icecream and ccache in PATH reversed. This didn't work, icecc 
complained about being called recursively.

Now that I have ccache before icecream in PATH it works fine. No new wrapper 
is needed.

There was a problem with the order of scripts in profile.d. They are sourced 
in the collating order for the user's locale. To have ccache before icecream 
in PATH, I wanted to have icecream.sh sourced before ccache.sh. I tried 
renaming icecream.sh to cc-icecream.sh. This worked in C locale, but not with 
my usual cs_CZ.UTF-8. Instead, I modified icecream.sh to insert icecc after 
ccache in PATH if it finds it there. It is in icecream-0.8.0-6.20071101svn 
which I'm building in Koji right now.

Closing this bug.
Comment 5 Ville Skyttä 2007-11-30 11:46:55 EST
Thanks for the followup.  If you ask me, locale dependent order of sourcing
/etc/profile.d snippets from /etc/profile would qualify as a bug in the "setup"
package though...

Note You need to log in before you can comment on or make changes to this bug.