Skip to content

Commit 362ffa8

Browse files
authored
Merge pull request #184 from stkw0/master
Add ccache support
2 parents 049ed50 + dc8b085 commit 362ffa8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ebuildtester/docker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ def _create_container(self, docker_image, local_portage, overlays):
162162
for s in options.options.storage_opt:
163163
docker_args += ["--storage-opt", "%s" % s]
164164

165+
ccache = options.options.ccache
166+
if ccache:
167+
docker_args += ["--volume=%s:/var/tmp/ccache" % ccache]
168+
165169
for o in overlays:
166170
docker_args += ["--volume=%s:%s" % o]
167171

@@ -229,6 +233,8 @@ def _tweak_settings(self):
229233
self.execute(("echo */* PYTHON_TARGETS: %s" %
230234
(options.options.python_targets)) +
231235
" >> /etc/portage/package.use/python")
236+
if options.options.ccache:
237+
self.execute("emerge --verbose dev-util/ccache")
232238

233239
def _get_repo_names(self, overlay_dirs):
234240
"""Get repo names from local overlay settings."""

ebuildtester/parse.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ def parse_commandline(args):
130130
"--show-options",
131131
help="Show currently selected options and defaults",
132132
action="store_true")
133+
parser.add_argument(
134+
"--ccache",
135+
help="Ccache path to mount into docker container")
133136

134137
if '--complete' in args:
135138
print('Suggesting')
@@ -160,6 +163,9 @@ def parse_commandline(args):
160163
if options.binhost:
161164
options.features.append("getbinpkg")
162165

166+
if options.ccache:
167+
options.features.append("ccache")
168+
163169
if options.with_vnc:
164170
options.atom += ["net-misc/tigervnc", "x11-wm/icewm"]
165171

0 commit comments

Comments
 (0)