bug 1286934 - sccache2 logging hacks
authorTed Mielczarek <ted@mielczarek.org>
Thu, 28 Jul 2016 15:44:18 -0400
changeset 830330 d85cde80d23b140434a4bcd852a8cd6def3ab053
parent 830329 ef4c80f50cf756d93e44845e2922445497100323
child 830331 6e640d0c39969d803a4edd29691d664e7278eb0d
push id141073
push usertmielczarek@mozilla.com
push dateThu, 25 Aug 2016 19:59:36 +0000
treeherdertry@5b1ce231ee6c [default view] [failures only]
bugs1286934
milestone51.0a1
bug 1286934 - sccache2 logging hacks MozReview-Commit-ID: 6SqpzSSZRVx
build/sccache.mk
client.mk
config/config.mk
configure.in
dumpsccachelog.sh
--- a/build/sccache.mk
+++ b/build/sccache.mk
@@ -6,13 +6,14 @@ ifdef OBJDIR
 BASE_DIR = $(OBJDIR)
 else
 # OSX Universal builds only do upload in the first MOZ_BUILD_PROJECTS
 BASE_DIR = $(MOZ_OBJDIR)/$(firstword $(MOZ_BUILD_PROJECTS))
 endif
 
 preflight_all:
 	# Terminate any sccache server that might still be around
-	-$(TOPSRCDIR)/sccache/sccache --stop-server > /dev/null 2>&1
+	-$(TOPSRCDIR)/sccache2/sccache --stop-server > /dev/null 2>&1
+	-cd $(TOPSRCDIR) && SCCACHE2_LOG_LEVEL=debug $(TOPSRCDIR)/sccache2/sccache --start-server
 
 postflight_all:
 	# Terminate sccache server. This prints sccache stats.
-	-$(TOPSRCDIR)/sccache/sccache --stop-server 2>&1 | gzip > $(BASE_DIR)/dist/sccache.log.gz
+	-$(TOPSRCDIR)/sccache2/sccache --stop-server 2>&1 | gzip > $(BASE_DIR)/dist/sccache.log.gz
--- a/client.mk
+++ b/client.mk
@@ -370,18 +370,17 @@ ifdef FOUND_MOZCONFIG
 endif
 
 configure:: $(configure-preqs)
 	$(call BUILDSTATUS,TIERS configure)
 	$(call BUILDSTATUS,TIER_START configure)
 	@echo cd $(OBJDIR);
 	@echo $(CONFIGURE) $(CONFIGURE_ARGS)
 	@cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
-	  || ( echo '*** Fix above errors and then restart with\
-               "$(MAKE) -f client.mk build"' && exit 1 )
+	  || ( $(TOPSRCDIR)/dumpsccachelog.sh && exit 1 )
 	@touch $(OBJDIR)/Makefile
 	$(call BUILDSTATUS,TIER_FINISH configure)
 
 ifneq (,$(MAKEFILE))
 $(OBJDIR)/Makefile: $(OBJDIR)/config.status
 
 $(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
 else
@@ -405,17 +404,17 @@ ifdef MOZ_PREFLIGHT
 	  $(MAKE) -f $(TOPSRCDIR)/$$mkfile preflight TOPSRCDIR=$(TOPSRCDIR) OBJDIR=$(OBJDIR) MOZ_OBJDIR=$(MOZ_OBJDIR); \
 	done
 endif
 
 ####################################
 # Build it
 
 realbuild::  $(OBJDIR)/Makefile $(OBJDIR)/config.status
-	+$(MOZ_MAKE)
+	+$(MOZ_MAKE) || ($(TOPSRCDIR)/dumpsccachelog.sh && exit 1)
 
 ####################################
 # Other targets
 
 # Pass these target onto the real build system
 $(OBJDIR_TARGETS):: $(OBJDIR)/Makefile $(OBJDIR)/config.status
 	+$(MOZ_MAKE) $@
 
--- a/config/config.mk
+++ b/config/config.mk
@@ -12,16 +12,18 @@
 #
 
 # Define an include-at-most-once flag
 ifdef INCLUDED_CONFIG_MK
 $(error Do not include config.mk twice!)
 endif
 INCLUDED_CONFIG_MK = 1
 
+export RUST_LOG=trace
+
 EXIT_ON_ERROR = set -e; # Shell loops continue past errors without this.
 
 ifndef topsrcdir
 topsrcdir	= $(DEPTH)
 endif
 
 ifndef INCLUDED_AUTOCONF_MK
 include $(DEPTH)/config/autoconf.mk
--- a/configure.in
+++ b/configure.in
@@ -16,10 +16,11 @@
 # autoconf, but doesn't call any autoconf macros. The `divert` line
 # below ensures the script that follows is output by autoconf.
 : "divert(0)dnl"
 #!/bin/sh
 
 SRCDIR=$(dirname $0)
 TOPSRCDIR="$SRCDIR"
 export OLD_CONFIGURE="$SRCDIR"/old-configure
+export RUST_LOG=trace
 
 which python2.7 > /dev/null && exec python2.7 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
new file mode 100755
--- /dev/null
+++ b/dumpsccachelog.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+$(dirname $0)/sccache2/sccache --stop-server
+sleep 1
+echo "sccache2 log:"
+echo "======================="
+cat $(dirname $0)/sccache2.log
+echo "======================="