Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315303 Details for
Bug 432062
Sharing compiler cache between the mock users seems to be a bad idea
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Do not use shared ccache caches by default
mock-ccache-nonshared-by-default.patch (text/plain), 3.95 KB, created by
Ville Skyttä
on 2008-08-28 21:47:54 UTC
(
hide
)
Description:
Do not use shared ccache caches by default
Filename:
MIME Type:
Creator:
Ville Skyttä
Created:
2008-08-28 21:47:54 UTC
Size:
3.95 KB
patch
obsolete
>diff --git a/etc/mock/site-defaults.cfg b/etc/mock/site-defaults.cfg >index f47ebbf..87737a1 100644 >--- a/etc/mock/site-defaults.cfg >+++ b/etc/mock/site-defaults.cfg >@@ -53,7 +53,9 @@ > # > # config_opts['plugin_conf']['ccache_enable'] = True > # config_opts['plugin_conf']['ccache_opts']['max_cache_size'] = '4G' >-# config_opts['plugin_conf']['ccache_opts']['dir'] = "%(cache_topdir)s/%(root)s/ccache/" >+# config_opts['plugin_conf']['ccache_opts']['dir'] = "%(cache_topdir)s/%(root)s/ccache/%(user)s/" >+# config_opts['plugin_conf']['ccache_opts']['chroot_dir'] = "/tmp/ccache/%(user)s" >+# config_opts['plugin_conf']['ccache_opts']['ccache_umask'] = None > # config_opts['plugin_conf']['yum_cache_enable'] = True > # config_opts['plugin_conf']['yum_cache_opts']['max_age_days'] = 30 > # config_opts['plugin_conf']['yum_cache_opts']['dir'] = "%(cache_topdir)s/%(root)s/yum_cache/" >diff --git a/py/mock.py b/py/mock.py >index d04c859..fc13b1c 100755 >--- a/py/mock.py >+++ b/py/mock.py >@@ -228,7 +228,8 @@ def setup_default_config_opts(config_opts, unprivUid): > 'ccache_enable': True, > 'ccache_opts': { > 'max_cache_size': "4G", >- 'dir': "%(cache_topdir)s/%(root)s/ccache/"}, >+ 'dir': "%(cache_topdir)s/%(root)s/ccache/%(user)s/", >+ 'chroot_dir': "/tmp/ccache/%(user)s"}, > 'yum_cache_enable': True, > 'yum_cache_opts': { > 'max_age_days': 30, >diff --git a/py/mock/plugins/ccache.py b/py/mock/plugins/ccache.py >index 04768f2..d0d11aa 100644 >--- a/py/mock/plugins/ccache.py >+++ b/py/mock/plugins/ccache.py >@@ -23,14 +23,16 @@ class CCache(object): > decorate(traceLog()) > def __init__(self, rootObj, conf): > self.rootObj = rootObj >- self.ccache_opts = conf >+ self.ccache_opts = conf.copy() >+ self.ccache_opts['user'] = rootObj.chrootuser > self.ccachePath = self.ccache_opts['dir'] % self.ccache_opts >+ self.ccacheChrootPath = self.ccache_opts['chroot_dir'] % self.ccache_opts > rootObj.ccacheObj = self > rootObj.preExistingDeps = rootObj.preExistingDeps + " ccache " > rootObj.addHook("prebuild", self._ccacheBuildHook) > rootObj.addHook("preinit", self._ccachePreInitHook) >- rootObj.umountCmds.append('umount -n %s' % rootObj.makeChrootPath("/tmp/ccache")) >- rootObj.mountCmds.append('mount -n --bind %s %s' % (self.ccachePath, rootObj.makeChrootPath("/tmp/ccache"))) >+ rootObj.umountCmds.append('umount -n %s' % rootObj.makeChrootPath(self.ccacheChrootPath)) >+ rootObj.mountCmds.append('mount -n --bind %s %s' % (self.ccachePath, rootObj.makeChrootPath(self.ccacheChrootPath))) > > # ============= > # 'Private' API >@@ -41,15 +43,15 @@ class CCache(object): > def _ccacheBuildHook(self): > self.rootObj.doChroot(["ccache", "-M", str(self.ccache_opts['max_cache_size'])], shell=False) > >- # basic idea here is that we add 'cc', 'gcc', 'g++' shell scripts to >- # to /tmp/ccache, which is bind-mounted from a shared location. >- # we then add this to the front of the path. >- # we also set a few admin variables used by ccache to find the shared >- # cache. >+ # basic idea here is that we point ccache to e.g. /tmp/$user/ccache inside >+ # the chroot, which is bind-mounted from a shared location. note that >+ # the cache dir might be shared - user probably wants to set ccache_umask >+ # if it is. > decorate(traceLog()) > def _ccachePreInitHook(self): > getLog().info("enabled ccache") >- mock.util.mkdirIfAbsent(self.rootObj.makeChrootPath('/tmp/ccache')) >+ mock.util.mkdirIfAbsent(self.rootObj.makeChrootPath(self.ccacheChrootPath)) > mock.util.mkdirIfAbsent(self.ccachePath) >- os.environ['CCACHE_DIR'] = "/tmp/ccache" >- os.environ['CCACHE_UMASK'] = "002" >+ os.environ['CCACHE_DIR'] = self.ccacheChrootPath >+ if self.ccache_opts.get('ccache_umask'): >+ os.environ['CCACHE_UMASK'] = self.ccache_opts['ccache_umask']
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 432062
: 315303