[coreboot-gerrit] Change in coreboot[master]: Build system: Make jenkins target to check for changes

Martin Roth (Code Review) gerrit at coreboot.org
Sat Apr 1 02:55:10 CEST 2017


Martin Roth has uploaded a new change for review. ( https://review.coreboot.org/19035 )

Change subject: Build system: Make jenkins target to check for changes
......................................................................

Build system: Make jenkins target to check for changes

-add --timeless argument to what-jenkins-does builds
-add jenkins-compare-last makefile target that checks out the previous
commit and rebuilds all platforms, then compares the checksums of
all of the platforms looking for anything that's changed.

Change-Id: Ie603f80c6f2b2a656df22b4a569a0f82a1237636
Signed-off-by: Martin Roth <gaumless at gmail.com>
---
M Makefile
M Makefile.inc
2 files changed, 21 insertions(+), 3 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/19035/1

diff --git a/Makefile b/Makefile
index 701a146..cd85475 100644
--- a/Makefile
+++ b/Makefile
@@ -113,7 +113,7 @@
 NOCOMPILE:=1
 endif
 ifneq ($(MAKECMDGOALS),)
-ifneq ($(filter %config %clean cross% clang iasl gnumake lint% help% what-jenkins-does,$(MAKECMDGOALS)),)
+ifneq ($(filter %config %clean cross% clang iasl gnumake lint% help% what-jenkins-does jenkins-compare-last,$(MAKECMDGOALS)),)
 NOCOMPILE:=1
 endif
 ifeq ($(MAKECMDGOALS), %clean)
diff --git a/Makefile.inc b/Makefile.inc
index 5ab3524..2f77d7d 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1055,10 +1055,28 @@
 CPUS?=4
 what-jenkins-does:
 	util/lint/lint lint-stable --junit
-	util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml
-	util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD)
+	util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) -x -X $(top)/abuild-chromeos.xml -o coreboot-builds-chromeos --timeless
+	util/abuild/abuild -B -J $(if $(JENKINS_NOCCACHE),,-y) -c $(CPUS) -z -p $(JENKINS_PAYLOAD) --timeless
 	(cd payloads/libpayload; unset COREBOOT_BUILD_DIR; $(MAKE) $(if $(JENKINS_NOCCACHE),,CONFIG_LP_CCACHE=y) V=$(V) Q=$(Q) junit.xml)
 	$(foreach tool, $(TOOLLIST), $(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/ BLD="$(tool)" MFLAGS= MAKEFLAGS= MAKETARGET= junit.xml; )
 	$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/ BLD=nvramcui MFLAGS= MAKEFLAGS= MAKETARGET=all junit.xml
 	$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=payloads/ BLD=coreinfo MFLAGS= MAKEFLAGS= MAKETARGET=defaultbuild junit.xml
 	$(MAKE) CPUS=$(CPUS) V=$(V) Q=$(Q) BLD_DIR=util/ BLD=romcc MFLAGS= MAKEFLAGS= MAKETARGET=test junit.xml
+
+jenkins-compare-last: GIT=$(shell [ -e "$(top)/.git" ] && command -v git)
+jenkins-compare-last: GITCOMMIT=$(shell if [ -n "$(GIT)" ]; then $(GIT) log HEAD --format="%h" -n 1; fi )
+jenkins-compare-last: what-jenkins-does
+	if [ -z "$(GITCOMMIT)" ]; then \
+		echo "Error: Could not get previous commit to compare."; false; \
+	fi
+	echo "********** BUILDING PARENT COMMIT **********"
+	$(GIT) checkout HEAD^
+	util/abuild/abuild -B $(if $(JENKINS_NOCCACHE),,-y) -z -c $(CPUS) -p $(JENKINS_PAYLOAD) -x -o coreboot-builds-chromeos --timeless
+	util/abuild/abuild -B $(if $(JENKINS_NOCCACHE),,-y) -z -c $(CPUS) -p $(JENKINS_PAYLOAD) --timeless
+	$(GIT) checkout $(GITCOMMIT)
+	echo "********** Finished Building Parent Commit **********"
+	DIFFS="$$(sort coreboot-builds-chromeos/platform_checksums | uniq -c | grep -v '^ *2 ' | sed 's/.*coreboot-/coreboot-/' | sort | uniq; \
+		sort coreboot-builds/platform_checksums | uniq -c | grep -v '^ *2' | sed 's/.*coreboot-/coreboot-/' | sort | uniq )"
+	if [ -z "$$DIFFS" ]; then echo "All platforms unchanged"; \
+	else echo "Platforms with differences:"; echo "$$DIFFS"; \
+	fi

-- 
To view, visit https://review.coreboot.org/19035
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie603f80c6f2b2a656df22b4a569a0f82a1237636
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Martin Roth <martinroth at google.com>



More information about the coreboot-gerrit mailing list