Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497624 - media-tv/xbmc - add USE="ccache"
Summary: media-tv/xbmc - add USE="ccache"
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Xbox project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-01-09 13:29 UTC by Anthony Ryan
Modified: 2014-01-09 21:25 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed patch (file_497624.txt,1.96 KB, patch)
2014-01-09 13:35 UTC, Anthony Ryan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Ryan 2014-01-09 13:29:30 UTC
While ccache doesn't make sense for point releases which will change dramatically from one release to the next, it makes a lot of sense in the 9999 ebuild. Particularly since low-powered ARM machines are often used for XBMC.

As such I propose making ccache a USE flag as several other ebuilds in the portage tree currently do. 

Reproducible: Always
Comment 1 Anthony Ryan 2014-01-09 13:35:13 UTC
Created attachment 367484 [details, diff]
proposed patch

It may be preferable to move ccache into alphabetical order with the other use_enable's.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-01-09 13:36:56 UTC
The only packages that have IUSE=ccache actually interact with ccache at run time, whereas it seems you propose to restrict using ccache in the xbmc ebuilds - that is something no ebuild in the tree should do, as it a portage feature (set in FEATURES, see make.conf(5)).

Also, why would you want to build packages on low powered ARM machines, when you could much easier cross-emerge them, especially in light of building from a live repository?
Comment 3 Anthony Ryan 2014-01-09 14:11:45 UTC
Thank you for the explanation.
Comment 4 hal 2014-01-09 21:25:06 UTC
References:
[0]: https://blog.flameeyes.eu/2010/07/debunking-ccache-myths-redux
[1]: https://bugs.gentoo.org/show_bug.cgi?id=327945

* * *

Quote from [0]:
«Okay now there are some cases where you might care about ccache because you are rebuilding the same package; that includes patch-testing and live ebuilds. In these cases you should not simply set FEATURES=ccache, but you can instead make use of the per-package environment files. You can then choose two options: you can do what Portage does (setting PATH so that the ccache wrappers are found before the compilers themselves) or you can simply re-set the CC variable, such as export CC="ccache gcc". Just set it in /etc/portage/env/$CATEGORY/$PN and you’re done.»

According to Diego's post and bug report we should

- use ccache for live ebuilds and patch testing at the most.
- not use `FEATURES=ccache` globally in `make.conf`.
- use ccache per package.

Thus I created `/etc/portage/env/media-tv/xbmc` in order try out a couple of possibilities. Based on the default econf setup `--disable-ccache` and without having set ccache in make.conf `FEATURES` I tried a couple of things:

1. Tried what was suggested in Diego's post
2. `FEATURES="${FEATURES} ccache"`

Unfortunately neither of the above enabled ccache. Looks like econf has the highest priority.
What worked was setting the following environment variable inside `/etc/portage/env/media-tv/xbmc`:

`EXTRA_ECONF="--enable-ccache"`

As it appends the string to the variable it will override the first ccache flag (`--disable-ccache`).

Now the possibilities are:
1. Let the ebuild use its default `--disable-ccache` flag and re-enable it explicitly on a per package setup.
2. Since configure detects ccache automatically shouldn't it be safe to remove the ccache option from the live ebuild econf section completly?
According to Diego's post it rather makes sense to use ccache on live ebuilds. Thus we could let configure detect ccache. If it is desireable to not use ccache then disable it manually in `/etc/portage/env/media-tv/xbmc` by setting `EXTRA_ECONF="--disable-ccache"`.

What's the best route to go in that case? Personally I tend to use option (2) since it is a live ebuild and configure detects ccache automatically.