[coreboot-gerrit] Change in coreboot[master]: util/docker: Use common .ccache for local builds

Patrick Georgi (Code Review) gerrit at coreboot.org
Fri Nov 16 11:06:05 CET 2018


Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/29457 )

Change subject: util/docker: Use common .ccache for local builds
......................................................................

util/docker: Use common .ccache for local builds

Bind a volume for .ccache to the `docker-run-local` targets. By default
the current user's $(HOME)/.ccache will be used, it can be overridden
via the DOCKER_CCACHE variable.

Also rearrange some docker parameters to keep the target readable.

Change-Id: I7d0bdb3861ac56361cacfa74aaf8b45c4f135e5c
Signed-off-by: Nico Huber <nico.h at gmx.de>
Reviewed-on: https://review.coreboot.org/29457
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi at google.com>
---
M util/docker/Makefile
1 file changed, 13 insertions(+), 4 deletions(-)

Approvals:
  build bot (Jenkins): Verified
  Patrick Georgi: Looks good to me, approved



diff --git a/util/docker/Makefile b/util/docker/Makefile
index 32714fc..eb43c98 100644
--- a/util/docker/Makefile
+++ b/util/docker/Makefile
@@ -31,6 +31,9 @@
 # Commit id to build from
 export DOCKER_COMMIT?=$(shell git log -n 1 --pretty=%h)
 
+# .ccache dir to use
+export DOCKER_CCACHE?=$(HOME)/.ccache
+
 # SDK architecture
 export COREBOOT_CROSSGCC_PARAM?=all_without_gdb
 
@@ -95,11 +98,17 @@
 		$(DOCKER) rmi $$($(DOCKER) images | grep -v "REPOSITORY" | tr -s ' ' | cut -f3 -d ' '); \
 	fi
 
-docker-run-local: test-docker
-	$(DOCKER) run -u root -it -v $(top):/home/coreboot/coreboot \
+$(DOCKER_CCACHE):
+	@mkdir -p $@
+
+docker-run-local: test-docker $(DOCKER_CCACHE)
+	$(DOCKER) run -it --rm \
+		--volume $(DOCKER_CCACHE):/home/coreboot/.ccache \
+		--volume $(top):/home/coreboot/coreboot \
+		--env HOME=/home/coreboot \
 		--user $(UID):$(GID) \
-		--rm coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) \
-		/bin/bash -c "cd /home/coreboot/coreboot && $(DOCKER_RUN_LOCAL)"
+		coreboot/coreboot-sdk:$(COREBOOT_CONTAINER_VERSION) \
+		/bin/bash -c 'cd $${HOME}/coreboot && $(DOCKER_RUN_LOCAL)'
 
 docker-build-coreboot: docker-run-local
 docker-build-coreboot: override DOCKER_RUN_LOCAL := \

-- 
To view, visit https://review.coreboot.org/29457
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7d0bdb3861ac56361cacfa74aaf8b45c4f135e5c
Gerrit-Change-Number: 29457
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
Gerrit-Reviewer: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181116/4737ad65/attachment.html>


More information about the coreboot-gerrit mailing list