All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua G Lock <joshua.g.lock@linux.intel.com>
To: Bill Randle <william.c.randle@intel.com>, yocto@yoctoproject.org
Subject: Re: [yocto-autobuilder][PATCH 2/4] BuildImages.py: build toaster eventlog only when requested
Date: Fri, 15 Jul 2016 22:37:12 +0100	[thread overview]
Message-ID: <1468618632.3500.12.camel@linux.intel.com> (raw)
In-Reply-To: <1468515952-12949-3-git-send-email-william.c.randle@intel.com>

On Thu, 2016-07-14 at 10:05 -0700, Bill Randle wrote:
> Qualify creation of the toaster eventlog based on the setting of the
> new
> 'custom_create_eventlog' property. Place the eventlog in
> build/tmp/log,
> instead of build and add a timestamp to the eventlog filename since
> multiple event logs can be generated during a multi-image buildset
> and
> otherwise only the last one would otherwise be saved.
> 
> [YOCTO #9884]
> 
> Signed-off-by: Bill Randle <william.c.randle@intel.com>
> ---
>  .../autobuilder/buildsteps/BuildImages.py          | 24
> +++++++++++++++++-----
>  1 file changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/python2.7/site-
> packages/autobuilder/buildsteps/BuildImages.py b/lib/python2.7/site-
> packages/autobuilder/buildsteps/BuildImages.py
> index 7ef8aab..9ea350f 100644
> --- a/lib/python2.7/site-
> packages/autobuilder/buildsteps/BuildImages.py
> +++ b/lib/python2.7/site-
> packages/autobuilder/buildsteps/BuildImages.py
> @@ -15,7 +15,7 @@ from buildbot.steps.shell import ShellCommand
>  from buildbot.process.buildstep import LogLineObserver
>  from distutils.version import StrictVersion
>  from buildbot.status.results import SUCCESS, SKIPPED
> -import os
> +import os, datetime
>  
>  from lib.buildsteps import BitbakeShellCommand
>  
> @@ -47,8 +47,23 @@ class BuildImages(BitbakeShellCommand):
>              self.deploycheck =
> self.getProperty('custom_deploy_artifacts')
>          except:
>              self.deploycheck = "True"
> +
> +        # the eventlog capability exists only in bitbake 1.25 and
> newer
> +        self.create_eventlog = "False"
> +        if self.getProperty('bitbakeversion') \
> +           and StrictVersion(self.getProperty('bitbakeversion')) >=
> StrictVersion("1.25"):
> +            try:
> +                self.create_eventlog =
> self.getProperty("custom_create_eventlog")
> +                if self.create_eventlog == "True":
> +                    timestamp =
> datetime.datetime.now().strftime("%Y%m%d%H%M%S")
> +                    self.eventlog_name = "tmp/log/bitbake_eventlog-
> %s.json" % timestamp
> +            except:
> +                pass

Do we really want to catch all exceptions here and ignore them? What
exception might be thrown by the above code?

> +
>          if self.images == "#TOASTER":
> -            bitbakeflags = "-k -w 'bitbake_eventlog.json' "
> +            bitbakeflags = "-k "
> +            if self.create_eventlog == "True":
> +                bitbakeflags += "-w '" + self.eventlog_name + "' "
>              self.images=self.getProperty("custom_images")
>              self.command = ". ./oe-init-build-env; bitbake " +
> bitbakeflags + self.images
>              self.description = ["Building " + str(self.images)]
> @@ -130,9 +145,8 @@ class BuildImages(BitbakeShellCommand):
>                  self.description = ["Skipping Build. No Images to be
> built"]
>              else:
>                  bitbakeflags = "-k "
> -                # -w only exists in bitbake 1.25 and newer, use
> distroversion string and make sure we're on poky >1.7
> -                if self.getProperty('bitbakeversion') and
> StrictVersion(self.getProperty('bitbakeversion')) >=
> StrictVersion("1.25"):
> -                    bitbakeflags += "-w 'bitbake_eventlog.json' "
> +                if self.create_eventlog == "True":
> +                    bitbakeflags += "-w '" + self.eventlog_name + "'
> "
>                  if self.minnowExists is None or self.minnowExists ==
> "True":
>                      self.command = ". ./oe-init-build-env; bitbake "
> + bitbakeflags + self.images
>                      self.description = ["Building " +
> str(self.images)]


  reply	other threads:[~2016-07-15 21:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 17:05 [yocto-autobuilder][PATCH 0/4] autobuilder: make toaster eventlog creation optional Bill Randle
2016-07-14 17:05 ` [yocto-autobuilder][PATCH 1/4] remote_kick.py: add default entry for new 'create_eventlog' property Bill Randle
2016-07-14 17:05 ` [yocto-autobuilder][PATCH 2/4] BuildImages.py: build toaster eventlog only when requested Bill Randle
2016-07-15 21:37   ` Joshua G Lock [this message]
2016-07-15 23:54     ` Randle, William C
2016-07-16 14:45       ` Randle, William C
2016-07-14 17:05 ` [yocto-autobuilder][PATCH 3/4] UploadToasterEventlog.py: handle multiple eventlog files Bill Randle
2016-07-14 17:05 ` [yocto-autobuilder][PATCH 4/4] buildset-config.controller: add new 'create_eventlog' forced build property Bill Randle
2016-07-19 15:42 ` [yocto-autobuilder][PATCH 0/4] autobuilder: make toaster eventlog creation optional Beth 'pidge' Flanagan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468618632.3500.12.camel@linux.intel.com \
    --to=joshua.g.lock@linux.intel.com \
    --cc=william.c.randle@intel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.