From fb3954f9ea444100be70f175bbedb685e397c540 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 5 Sep 2014 19:00:17 -0600 Subject: buildman: Correct counting of build failures on retry When a build is to be performed, buildman checks to see if it has already been done. In most cases it will not bother trying again. However, it was not reading the return code from the 'done' file, so if the result was a failure, it would not be counted. This depresses the 'failure' count stats that buildman prints in this case. Fix this bug by always reading the return code. Signed-off-by: Simon Glass --- tools/buildman/builderthread.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'tools/buildman/builderthread.py') diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 0246375bfad..261919f127f 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -138,16 +138,17 @@ class BuilderThread(threading.Thread): result.already_done = os.path.exists(done_file) will_build = (force_build or force_build_failures or not result.already_done) - if result.already_done and will_build: + if result.already_done: # Get the return code from that build and use it with open(done_file, 'r') as fd: result.return_code = int(fd.readline()) - err_file = self.builder.GetErrFile(commit_upto, brd.target) - if os.path.exists(err_file) and os.stat(err_file).st_size: - result.stderr = 'bad' - elif not force_build: - # The build passed, so no need to build it again - will_build = False + if will_build: + err_file = self.builder.GetErrFile(commit_upto, brd.target) + if os.path.exists(err_file) and os.stat(err_file).st_size: + result.stderr = 'bad' + elif not force_build: + # The build passed, so no need to build it again + will_build = False if will_build: # We are going to have to build it. First, get a toolchain -- cgit v1.2.3 From f3d015cb4a84e4a7bb37e9963e4e8e97b48b7d68 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 19 Aug 2014 10:22:39 +0200 Subject: buildman: Create parent directories as necessary When creating build directories also create parents as necessary. This fixes a failure when building a hierarchical branch (i.e. foo/bar). Signed-off-by: Thierry Reding Acked-by: Simon Glass Tested-by: Tom Rini --- tools/buildman/builderthread.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/buildman/builderthread.py') diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 261919f127f..a9cf68a8016 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -12,14 +12,17 @@ import threading import command import gitutil -def Mkdir(dirname): +def Mkdir(dirname, parents = False): """Make a directory if it doesn't already exist. Args: dirname: Directory to create """ try: - os.mkdir(dirname) + if parents: + os.makedirs(dirname) + else: + os.mkdir(dirname) except OSError as err: if err.errno == errno.EEXIST: pass -- cgit v1.2.3