Merge branch 'master' into deploy
authorMark Wooding <mdw@distorted.org.uk>
Sat, 21 Sep 2019 21:35:34 +0000 (22:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 21 Sep 2019 21:35:34 +0000 (22:35 +0100)
* master:
  etc/sbuild.conf.in: Keep failed build trees for diagnostics.
  Maintain a separate ccache directory for each target.

Makefile
bin/buildwrap
etc/ccache.conf [new file with mode: 0644]
etc/sbuild.conf.in

index 3a3d48a..07f2d3c 100644 (file)
--- 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/
index e367b1b..5b9068d 100755 (executable)
@@ -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 (file)
index 0000000..a76ac41
--- /dev/null
@@ -0,0 +1,3 @@
+### -*-conf-*-
+
+max_size = 256Mi
index dca0027..963f7d4 100644 (file)
@@ -61,6 +61,11 @@ $build_environment = {
 ## Actually resolve alternatives properly.
 $resolve_alternatives = 1;
 
+## Leave debris for diagnostics.
+$purge_build_deps = "successful";
+$purge_build_directory = "successful";
+$purge_session = "successful";
+
 ## Don't do anything clever if the build dependencies fail.  The clever thing
 ## doesn't work on older distributions.  Also, it takes extra time, and
 ## that's not desirable.