All of lore.kernel.org
 help / color / mirror / Atom feed
* [autobuilder][PATCH 1/2] GetBitbakeVersion.py: add buildstep to get the version of bitbake
@ 2015-01-21 11:08 brendan.le.foll
  2015-01-21 11:08 ` [autobuilder][PATCH 2/2] BuildImages.py: Make -w flag depend on bitbake version check brendan.le.foll
  0 siblings, 1 reply; 3+ messages in thread
From: brendan.le.foll @ 2015-01-21 11:08 UTC (permalink / raw)
  To: yocto

From: Brendan Le Foll <brendan.le.foll@intel.com>

This step allows people to use the property 'bitbakeversion' in their
buildsteps which is useful before running bitbake to check what flags will be
supported.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
---
 docs/YoctoAutobuilderDevelopersDocument.html       | 11 +++++
 .../autobuilder/buildsteps/GetBitbakeVersion.py    | 49 ++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 lib/python2.7/site-packages/autobuilder/buildsteps/GetBitbakeVersion.py

diff --git a/docs/YoctoAutobuilderDevelopersDocument.html b/docs/YoctoAutobuilderDevelopersDocument.html
index 8a2747b..e583dea 100644
--- a/docs/YoctoAutobuilderDevelopersDocument.html
+++ b/docs/YoctoAutobuilderDevelopersDocument.html
@@ -1500,6 +1500,17 @@
                 </tr>
                 <tr class="c3">
                     <td class="c24" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">GetBitbakeVersion</span></p>
+                    </td>
+                    <td class="c5" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">Gets the version of bitbake being used. This is used by BuildImages.</span></p>
+                    </td>
+                    <td class="c21" colspan="1" rowspan="1">
+                        <p class="c0"><span class="c9">&quot;bitbakeversion&quot;: string</span></p>
+                    </td>
+                </tr>
+                <tr class="c3">
+                    <td class="c24" colspan="1" rowspan="1">
                         <p class="c0"><span class="c9">GetDistroVersion</span></p>
                     </td>
                     <td class="c5" colspan="1" rowspan="1">
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/GetBitbakeVersion.py b/lib/python2.7/site-packages/autobuilder/buildsteps/GetBitbakeVersion.py
new file mode 100644
index 0000000..dc6c25b
--- /dev/null
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/GetBitbakeVersion.py
@@ -0,0 +1,49 @@
+'''
+Created on January 20th, 2015
+
+__author__ = "Brendan Le Foll"
+__copyright__ = "Copyright 2015, Intel Corp."
+__credits__ = ["Brendan Le Foll"]
+__license__ = "GPL"
+__version__ = "2.0"
+__maintainer__ = "Elizabeth Flanagan"
+__email__ = "elizabeth.flanagan at intel.com"
+'''
+from buildbot.steps.shell import ShellCommand
+from buildbot.status import progress
+from buildbot.status.results import SUCCESS, FAILURE, WARNINGS
+from buildbot.process.properties import WithProperties
+from twisted.python import log
+from autobuilder.config import *
+
+class GetBitbakeVersion(ShellCommand):
+    haltOnFailure = False
+    flunkOnFailure = False
+    name = "GetBitbakeVersion"
+    def __init__(self, factory, argdict=None, **kwargs):
+        for k, v in argdict.iteritems():
+            setattr(self, k, v)
+        self.description = "Get Bitbake Version"
+        self.workerworkdir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-worker"))
+        for k, v in argdict.iteritems():
+            setattr(self, k, v)
+        ShellCommand.__init__(self, **kwargs)
+
+    def start(self):
+        buildername=self.getProperty("buildername")
+
+        self.command = '. ./oe-init-build-env; bitbake --version'
+        ShellCommand.start(self)
+
+    def commandComplete(self, cmd):
+        result = cmd.logs['stdio'].getText()
+        
+        bitbakev= result.split()[-1]
+        log.msg("Bitbake version: " + bitbakev)
+        if cmd.didFail():
+           bitbakev = "1"
+        self.setProperty('bitbakeversion', bitbakev, "Setting Bitbake Version")
+        self.finished(SUCCESS)
+
+    def getText(self, cmd, results):
+        return ShellCommand.getText(self, cmd, results)
-- 
2.2.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [autobuilder][PATCH 2/2] BuildImages.py: Make -w flag depend on bitbake version check
  2015-01-21 11:08 [autobuilder][PATCH 1/2] GetBitbakeVersion.py: add buildstep to get the version of bitbake brendan.le.foll
@ 2015-01-21 11:08 ` brendan.le.foll
  2015-01-21 22:51   ` Saul Wold
  0 siblings, 1 reply; 3+ messages in thread
From: brendan.le.foll @ 2015-01-21 11:08 UTC (permalink / raw)
  To: yocto

From: Brendan Le Foll <brendan.le.foll@intel.com>

Because bitbake -w flag does not exist in verisons of bitbake prior to 1.25
BuildImages.py is broken for anything older like daisy, adding this check means
that -w will only be applied if the GetBitbakeVersion step has been run.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
---
 lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py b/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py
index 31a29a8..bf1ac5e 100644
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py
+++ b/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py
@@ -13,6 +13,7 @@ __email__ = "elizabeth.flanagan@intel.com"
 
 from buildbot.steps.shell import ShellCommand
 from buildbot.process.buildstep import LogLineObserver
+from distutils.version import StrictVersion
 import os
 
 class BuildImages(ShellCommand):
@@ -47,7 +48,11 @@ class BuildImages(ShellCommand):
         if self.layerversion_yoctobsp is not None and int(self.layerversion_yoctobsp) < 2 and self.machine is not None and self.machine == "genericx86-64":
             self.command = "echo 'Skipping Step.'"
         else:
-            self.command = ". ./oe-init-build-env; bitbake -w -k " + self.images
+            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 "
+            self.command = ". ./oe-init-build-env; bitbake " + bitbakeflags + self.images
             self.description = ["Building " + str(self.images)]
         ShellCommand.start(self)
 
-- 
2.2.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [autobuilder][PATCH 2/2] BuildImages.py: Make -w flag depend on bitbake version check
  2015-01-21 11:08 ` [autobuilder][PATCH 2/2] BuildImages.py: Make -w flag depend on bitbake version check brendan.le.foll
@ 2015-01-21 22:51   ` Saul Wold
  0 siblings, 0 replies; 3+ messages in thread
From: Saul Wold @ 2015-01-21 22:51 UTC (permalink / raw)
  To: brendan.le.foll, yocto


Brendan,

Just a heads up, these AB patches will be reviewed when Beth comes back 
in just over 3 weeks, you should be able to fix your local AB instance 
for now.

Thanks for your patience

Sau!


On 01/21/2015 03:08 AM, brendan.le.foll@intel.com wrote:
> From: Brendan Le Foll <brendan.le.foll@intel.com>
>
> Because bitbake -w flag does not exist in verisons of bitbake prior to 1.25
> BuildImages.py is broken for anything older like daisy, adding this check means
> that -w will only be applied if the GetBitbakeVersion step has been run.
>
> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
> ---
>   lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py b/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py
> index 31a29a8..bf1ac5e 100644
> --- a/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py
> +++ b/lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py
> @@ -13,6 +13,7 @@ __email__ = "elizabeth.flanagan@intel.com"
>
>   from buildbot.steps.shell import ShellCommand
>   from buildbot.process.buildstep import LogLineObserver
> +from distutils.version import StrictVersion
>   import os
>
>   class BuildImages(ShellCommand):
> @@ -47,7 +48,11 @@ class BuildImages(ShellCommand):
>           if self.layerversion_yoctobsp is not None and int(self.layerversion_yoctobsp) < 2 and self.machine is not None and self.machine == "genericx86-64":
>               self.command = "echo 'Skipping Step.'"
>           else:
> -            self.command = ". ./oe-init-build-env; bitbake -w -k " + self.images
> +            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 "
> +            self.command = ". ./oe-init-build-env; bitbake " + bitbakeflags + self.images
>               self.description = ["Building " + str(self.images)]
>           ShellCommand.start(self)
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-21 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-21 11:08 [autobuilder][PATCH 1/2] GetBitbakeVersion.py: add buildstep to get the version of bitbake brendan.le.foll
2015-01-21 11:08 ` [autobuilder][PATCH 2/2] BuildImages.py: Make -w flag depend on bitbake version check brendan.le.foll
2015-01-21 22:51   ` Saul Wold

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.