chiark / gitweb /
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 3a3d48a20962090f11a5f2d1c95ab2aedea2fb2a..07f2d3cf6756b26c7f0ef74915cd9beef86248a3 100644 (file)
--- 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.
 
index e367b1be98ba579c48e455c38f878ba86668a082..5b9068d5ecf7017fdfa6d8c86198fdbaea3c913f 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 dca002733ee4b69d2ebd5643d8182a4185d6d7ff..963f7d418e596662c20db24b285f2fbe136522c1 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.