Skip to contentSkip to conversation

buildman: Deal more nicely with invalid build-status file

PATCH New Simon Glass 1 participant 2 messages Apr 27, 2019 – May 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildman: Deal more nicely with invalid build-status file

The 'done' files created by buildman may end up being empty if buildman runs out of disk space while writing them. At present buildman dies with an exception when using -s to check the build status. Fix this.

Seriesl-cc: trini

---

 tools/buildman/builder.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tools/buildman/builder.py +6 -1
index 6a6c83bf336..fbb236676c7 100644
@@ -673,7 +673,12 @@ class Builder:
         environment = {}
         if os.path.exists(done_file):
             with open(done_file, 'r') as fd:
-                return_code = int(fd.readline())
+                try:
+                    return_code = int(fd.readline())
+                except ValueError:
+                    # The file may be empty due to running out of disk space.
+                    # Try a rebuild
+                    return_code = 1
                 err_lines = []
                 err_file = self.GetErrFile(commit_upto, target)
                 if os.path.exists(err_file):
Signature · 1 line
2.21.0.593.g511ec345e18-goog
#1 lore raw

PATCH 1/1 buildman: Deal more nicely with invalid build-status file

Quoted 5 lines · Simon Glass

The 'done' files created by buildman may end up being empty if buildman runs out of disk space while writing them. At present buildman dies with an exception when using -s to check the build status. Fix this.

Quoted 7 lines

Seriesl-cc: trini

---

 tools/buildman/builder.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!