1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 13:49:49 +00:00

bitbake: toasterui: Create per-build logs

Rather than relying on bug 8411, which is conveniently creating
separate log files for each of our builds, create our own
log file for each build.

The log files are created in the same tmp directories that
bitbake users, but are timestamped to the millisecond to avoid
name collisions.

Each log file is opened on a ParseStarted event (for builds
triggered by Toaster) or BuildStarted event (for builds on the
command line: Toaster doesn't get the ParseStarted event
for command-line builds).

The log file is closed on the BuildCompleted event, or if the
build fails.

Because we start logging on ParseStarted for Toaster builds,
we're able to capture the "Build Configuration" section which
bitbake writes to output.

[YOCTO #8373]

(Bitbake rev: 7974203cd8bc66dff1fcc55f8723dedefaf72840)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Elliot Smith
2015-10-29 13:59:44 +02:00
committed by Richard Purdie
parent 290534d3ff
commit a0791c19db
2 changed files with 94 additions and 30 deletions
+4 -4
View File
@@ -784,7 +784,7 @@ class BuildInfoHelper(object):
## methods to convert event/external info into objects that the ORM layer uses
def _get_build_information(self, consolelogfile):
def _get_build_information(self, build_log_path):
build_info = {}
# Generate an identifier for each new build
@@ -793,7 +793,7 @@ class BuildInfoHelper(object):
build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
build_info['started_on'] = timezone.now()
build_info['completed_on'] = timezone.now()
build_info['cooker_log_path'] = consolelogfile
build_info['cooker_log_path'] = build_log_path
build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
@@ -934,9 +934,9 @@ class BuildInfoHelper(object):
logger.warn("buildinfohelper: cannot identify layer exception:%s ", nee)
def store_started_build(self, event, consolelogfile):
def store_started_build(self, event, build_log_path):
assert '_pkgs' in vars(event)
build_information = self._get_build_information(consolelogfile)
build_information = self._get_build_information(build_log_path)
build_obj = self.orm_wrapper.create_build_object(build_information, self.brbe, self.project)