[Commits] (heikki) Make sure that if the build failed, we'll try building next cycle as well (previously we just did tests if there were no CVS changes). Also in the case of build failure, do realclean which should help us recover automatically when new binaries are uploaded etc.

commits at osafoundation.org commits at osafoundation.org
Thu Aug 26 16:31:35 PDT 2004


Commit by: heikki
Modified files:
hardhat/buildscripts/newchandler.py 1.31 1.32

Log message:
Make sure that if the build failed, we'll try building next cycle as well (previously we just did tests if there were no CVS changes). Also in the case of build failure, do realclean which should help us recover automatically when new binaries are uploaded etc.

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/hardhat/buildscripts/newchandler.py.diff?r1=text&tr1=1.31&r2=text&tr2=1.32

Index: hardhat/buildscripts/newchandler.py
diff -u hardhat/buildscripts/newchandler.py:1.31 hardhat/buildscripts/newchandler.py:1.32
--- hardhat/buildscripts/newchandler.py:1.31	Thu Aug 26 16:09:21 2004
+++ hardhat/buildscripts/newchandler.py	Thu Aug 26 16:31:34 2004
@@ -233,6 +233,7 @@
     log.write("Done with CVS\n")
     return (filenameChanged, changesAtAll)
 
+
 def doInstall(buildmode, workingDir, log):
     # for our purposes, we do not really do a build
     # we will update chandler from CVS, and grab new tarballs when they appear
@@ -257,13 +258,48 @@
         log.write("Build log:" + "\n")
         hardhatutil.dumpOutputList(e.outputList, log)
         log.write(separator)
+        forceBuildNextCycle(log, workingDir)
         raise e
     except Exception, e:
         print "build error"
         log.write("***Error during build***\n")
+        log.write(separator)        
         log.write("No build log!\n")
+        log.write(separator)
+        forceBuildNextCycle(log, workingDir)
         raise e
 
+
+def forceBuildNextCycle(log, workingDir):
+    doRealclean(log)
+    # We trigger build for next cycle by removing /chandler/Makefile,
+    # which will be noticed as an 'update' in the beginning of next
+    # cycle which will cause doInstall etc. to be called.
+    print 'Removing chandler/Makefile to trigger build next cycle'
+    log.write('Removing chandler/Makefile to trigger build next cycle\n')
+    chandlerMakefile = os.path.join(workingDir, mainModule, 'Makefile')
+    if os.path.exists(chandlerMakefile):
+        os.remove(chandlerMakefile)
+    
+
+def doRealclean(log):
+    try:
+        # If make install fails, it will almost certainly fail next time
+        # as well - the typical case has been bad binaries packages.
+        # So what we do here is try to do realclean which will force
+        # the build to get new binaries tarballs next time, and if fixed
+        # binaries were uploaded in the meanwhile we'll recover
+        # automatically. This will also sort us out of corrupted debug/release.
+        print "Doing make realclean\n"
+        log.write("Doing make realclean\n")
+        outputList = hardhatutil.executeCommandReturnOutput(
+         [buildenv['make'], "realclean"])
+        hardhatutil.dumpOutputList(outputList, log)
+    except:
+        print "make realclean failed\n"
+        log.write("make realclean failed\n")
+
+
 def NeedsUpdate(outputList, filename):
     """
     @return: Returns a tuple of booleans. The first is true if filename is



More information about the Commits mailing list