summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-02-16 17:47:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-20 12:58:19 +0000
commitc368d83bd6b34c2420c3d1d7269d8dc2edba1ce9 (patch)
treed6a905444fe2ea0f0313bc4b848430108ac17388 /bitbake/lib/bb
parenta574f293fe16612df446d3b7fef71adcab4773e9 (diff)
downloadpoky-c368d83bd6b34c2420c3d1d7269d8dc2edba1ce9.tar.gz
bitbake: toaster: bitbake cooker log saving and downloading
This patch brings in cooker log saving and proper download links. * toasterui will now write the cooker log file if running in managed mode * the BuildRequest has a new state, REQ_ARCHIVE, indicating that the build is completed, and the artifacts are ready to be grabbed * the runbuild test execution commands will gather needed artifacts, and save them to a storage directory selected during Toaster setup. * the build dashboard, project builds and all builds pages have permanent links for the cooker log [YOCTO #7220] [YOCTO #7206] (Bitbake rev: fad80e36c9da663b000cdf2cb3c75440c6431d84) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py3
-rw-r--r--bitbake/lib/bb/ui/toasterui.py29
2 files changed, 29 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 491fd1566d..1096ccf4de 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -1114,7 +1114,8 @@ class BuildInfoHelper(object):
1114 be.save() 1114 be.save()
1115 br = BuildRequest.objects.get(pk = br_id) 1115 br = BuildRequest.objects.get(pk = br_id)
1116 if errorcode == 0: 1116 if errorcode == 0:
1117 br.state = BuildRequest.REQ_COMPLETED 1117 # request archival of the project artifacts
1118 br.state = BuildRequest.REQ_ARCHIVE
1118 else: 1119 else:
1119 br.state = BuildRequest.REQ_FAILED 1120 br.state = BuildRequest.REQ_FAILED
1120 br.save() 1121 br.save()
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index a85ad5a06a..df9f362284 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -58,7 +58,12 @@ def _log_settings_from_server(server):
58 if error: 58 if error:
59 logger.error("Unable to get the value of BBINCLUDELOGS_LINES variable: %s" % error) 59 logger.error("Unable to get the value of BBINCLUDELOGS_LINES variable: %s" % error)
60 raise BaseException(error) 60 raise BaseException(error)
61 return includelogs, loglines 61 consolelogfile, error = server.runCommand(["getVariable", "BB_CONSOLELOG"])
62 if error:
63 logger.error("Unable to get the value of BB_CONSOLELOG variable: %s" % error)
64 raise BaseException(error)
65 return includelogs, loglines, consolelogfile
66
62 67
63def main(server, eventHandler, params ): 68def main(server, eventHandler, params ):
64 69
@@ -71,7 +76,7 @@ def main(server, eventHandler, params ):
71 console.setFormatter(format) 76 console.setFormatter(format)
72 logger.addHandler(console) 77 logger.addHandler(console)
73 78
74 includelogs, loglines = _log_settings_from_server(server) 79 includelogs, loglines, consolelogfile = _log_settings_from_server(server)
75 80
76 # verify and warn 81 # verify and warn
77 build_history_enabled = True 82 build_history_enabled = True
@@ -96,6 +101,16 @@ def main(server, eventHandler, params ):
96 101
97 buildinfohelper = BuildInfoHelper(server, build_history_enabled) 102 buildinfohelper = BuildInfoHelper(server, build_history_enabled)
98 103
104 if buildinfohelper.brbe is not None and consolelogfile:
105 # if we are under managed mode we have no other UI and we need to write our own file
106 bb.utils.mkdirhier(os.path.dirname(consolelogfile))
107 conlogformat = bb.msg.BBLogFormatter(format_str)
108 consolelog = logging.FileHandler(consolelogfile)
109 bb.msg.addDefaultlogFilter(consolelog)
110 consolelog.setFormatter(conlogformat)
111 logger.addHandler(consolelog)
112
113
99 while True: 114 while True:
100 try: 115 try:
101 event = eventHandler.waitEvent(0.25) 116 event = eventHandler.waitEvent(0.25)
@@ -115,8 +130,12 @@ def main(server, eventHandler, params ):
115 130
116 if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)): 131 if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):
117 buildinfohelper.update_and_store_task(event) 132 buildinfohelper.update_and_store_task(event)
133 logger.warn("Logfile for task %s" % event.logfile)
118 continue 134 continue
119 135
136 if isinstance(event, bb.build.TaskBase):
137 logger.info(event._message)
138
120 if isinstance(event, bb.event.LogExecTTY): 139 if isinstance(event, bb.event.LogExecTTY):
121 logger.warn(event.msg) 140 logger.warn(event.msg)
122 continue 141 continue
@@ -162,7 +181,12 @@ def main(server, eventHandler, params ):
162 if isinstance(event, bb.event.CacheLoadCompleted): 181 if isinstance(event, bb.event.CacheLoadCompleted):
163 continue 182 continue
164 if isinstance(event, bb.event.MultipleProviders): 183 if isinstance(event, bb.event.MultipleProviders):
184 logger.info("multiple providers are available for %s%s (%s)", event._is_runtime and "runtime " or "",
185 event._item,
186 ", ".join(event._candidates))
187 logger.info("consider defining a PREFERRED_PROVIDER entry to match %s", event._item)
165 continue 188 continue
189
166 if isinstance(event, bb.event.NoProvider): 190 if isinstance(event, bb.event.NoProvider):
167 return_value = 1 191 return_value = 1
168 errors = errors + 1 192 errors = errors + 1
@@ -229,6 +253,7 @@ def main(server, eventHandler, params ):
229 buildinfohelper.store_log_event(event) 253 buildinfohelper.store_log_event(event)
230 errors += 1 254 errors += 1
231 errorcode = 1 255 errorcode = 1
256 logger.error("Command execution failed: %s", event.error)
232 257
233 buildinfohelper.update_build_information(event, errors, warnings, taskfailures) 258 buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
234 buildinfohelper.close(errorcode) 259 buildinfohelper.close(errorcode)