From 0a9fcbbce723f2190a0a6dd527bbdb9c28b9a1a5 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 21 Sep 2019 20:08:07 +0100 Subject: [PATCH] Maintain a separate ccache directory for each target. Otherwise they interfere with each other. How did I not notice this before? --- Makefile | 11 +++++++++++ bin/buildwrap | 2 +- etc/ccache.conf | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 etc/ccache.conf diff --git a/Makefile b/Makefile index 3a3d48a..07f2d3c 100644 --- a/Makefile +++ b/Makefile @@ -583,6 +583,17 @@ $(CHECK_SCHROOT_SCRIPTS): check-script/%: .PHONY: $(addprefix check-script/,$(SCHROOT_SCRIPTS)) ###-------------------------------------------------------------------------- +### Ccache setup. + +CCACHE_CONFIGS = $(foreach r,$(ALL_CHROOTS), \ + /var/lib/sbuild/build/.ccache/$(LVPREFIX)$r/ccache.conf) +all:: $(CCACHE_CONFIGS) +$(CCACHE_CONFIGS): /var/lib/sbuild/build/.ccache/$(LVPREFIX)%/ccache.conf: \ + etc/ccache.conf + $(V_AT)mkdir -p $(dir $@) + $(call v_tag,COPY)cp $< $@.new && mv $@.new $@ + +###-------------------------------------------------------------------------- ### `/usr/local/' structure. LOCAL_COMMON_DIRS = share/ src/ diff --git a/bin/buildwrap b/bin/buildwrap index e367b1b..5b9068d 100755 --- a/bin/buildwrap +++ b/bin/buildwrap @@ -26,7 +26,7 @@ ## Set up compiler caching. This makes a big difference to build times. PATH=/usr/lib/ccache:$PATH; export PATH -CCACHE_DIR=/build/.ccache; export CCACHE_DIR +CCACHE_DIR=/build/.ccache/$SCHROOT_CHROOT_NAME; export CCACHE_DIR unset CCACHE_HARDLINK CCACHE_COMPRESS=t; export CCACHE_COMPRESS CCACHE_UMASK=002; export CCACHE_UMASK diff --git a/etc/ccache.conf b/etc/ccache.conf new file mode 100644 index 0000000..a76ac41 --- /dev/null +++ b/etc/ccache.conf @@ -0,0 +1,3 @@ +### -*-conf-*- + +max_size = 256Mi -- 2.11.0