From: Mark Wooding Date: Sat, 21 Sep 2019 19:08:07 +0000 (+0100) Subject: Maintain a separate ccache directory for each target. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-chroot/commitdiff_plain/0a9fcbbce723f2190a0a6dd527bbdb9c28b9a1a5?ds=sidebyside Maintain a separate ccache directory for each target. Otherwise they interfere with each other. How did I not notice this before? --- diff --git a/Makefile b/Makefile index 3a3d48a..07f2d3c 100644 --- a/Makefile +++ b/Makefile @@ -582,6 +582,17 @@ $(CHECK_SCHROOT_SCRIPTS): check-script/%: $(call check-symlink,WARN,/etc/schroot/setup.d/$*,$(ABSLOCAL)/etc/schroot/setup.d/$*) .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. 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