Tools: speed up builds and report build time per build

This commit is contained in:
Andrew Tridgell 2019-06-03 17:53:30 +10:00
parent 9f6b48b743
commit 0b321eb84c

View File

@ -100,7 +100,7 @@ class build_binaries(object):
"--recursive",
"-f"])
def checkout(self, vehicle, ctag, cboard=None, cframe=None):
def checkout(self, vehicle, ctag, cboard=None, cframe=None, submodule_update=True):
'''attempt to check out a git tree. Various permutations are
attempted based on ctag - for examplle, if the board is avr and ctag
is bob we will attempt to checkout bob-AVR'''
@ -131,7 +131,8 @@ is bob we will attempt to checkout bob-AVR'''
try:
self.progress("Trying branch %s" % branch)
self.run_git(["checkout", "-f", branch])
self.run_git_update_submodules()
if submodule_update:
self.run_git_update_submodules()
self.run_git(["log", "-1"])
return True
except subprocess.CalledProcessError:
@ -336,7 +337,7 @@ is bob we will attempt to checkout bob-AVR'''
framesuffix = ""
else:
framesuffix = "-%s" % frame
if not self.checkout(vehicle, tag, board, frame):
if not self.checkout(vehicle, tag, board, frame, submodule_update=False):
msg = ("Failed checkout of %s %s %s %s" %
(vehicle, board, tag, frame,))
self.progress(msg)
@ -344,6 +345,7 @@ is bob we will attempt to checkout bob-AVR'''
continue
if self.skip_board_waf(board):
continue
self.progress("Building %s %s %s binaries %s" %
(vehicle, tag, board, frame))
ddir = os.path.join(self.binaries,
@ -356,11 +358,17 @@ is bob we will attempt to checkout bob-AVR'''
if self.skip_frame(board, frame):
continue
# we do the submodule update after the skip_board_waf check to avoid doing it on
# builds we will not be running
self.run_git_update_submodules()
if os.path.exists(self.buildroot):
shutil.rmtree(self.buildroot)
self.remove_tmpdir()
t0 = time.time()
self.progress("Configuring for %s in %s" %
(board, self.buildroot))
try:
@ -384,6 +392,10 @@ is bob we will attempt to checkout bob-AVR'''
self.error_strings.append(msg)
continue
t1 = time.time()
self.progress("Building %s %s %s %s took %u seconds" %
(vehicle, tag, board, frame, t1-t0))
bare_path = os.path.join(self.buildroot,
board,
"bin",