All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] tinfoil.py: Check if BUILDDIR or .devtoolbase exists
@ 2018-02-07 18:26 Amanda Brindle
  2018-02-07 18:27 ` [PATCH v2 1/1] " Amanda Brindle
  0 siblings, 1 reply; 2+ messages in thread
From: Amanda Brindle @ 2018-02-07 18:26 UTC (permalink / raw)
  To: bitbake-devel; +Cc: stephano.cetola

In v2, if the build environment is not initialised, raise an exception instead of printing out a message.

Also, check if .devtoolbase exists. This will determine if an sdk environment has been sourced. If .devtoolbase exists,
an exception should not be raised.

The following changes since commit 902b77bf91d96517b935bce00a11003604dc3d54:

  lib/oe/package_manager/sdk: Ensure do_populate_sdk_ext and do_populate_sdk repos don't conflict (2018-01-22 10:39:10 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib abrindle/tinfoil
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=abrindle/tinfoil

Amanda Brindle (1):
  tinfoil.py: Check if BUILDDIR  or .devtoolbase exists

 bitbake/lib/bb/tinfoil.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

-- 
2.7.4



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

* [PATCH v2 1/1] tinfoil.py: Check if BUILDDIR or .devtoolbase exists
  2018-02-07 18:26 [PATCH v2 0/1] tinfoil.py: Check if BUILDDIR or .devtoolbase exists Amanda Brindle
@ 2018-02-07 18:27 ` Amanda Brindle
  0 siblings, 0 replies; 2+ messages in thread
From: Amanda Brindle @ 2018-02-07 18:27 UTC (permalink / raw)
  To: bitbake-devel; +Cc: stephano.cetola

Check if either BUILDDIR or .devtoolbase exists in order to deterimine
if a tinfoil using script is running without having called oe-init-build-env
(or similar). If not, raise an exception that a tinfoil using application
can catch to produce an error message. Before, tinfoil would hang for 30s
before erroring out.

Fixes [YOCTO #12096]

Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com>
---
 bitbake/lib/bb/tinfoil.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py
index 368264f..013e7f6 100644
--- a/bitbake/lib/bb/tinfoil.py
+++ b/bitbake/lib/bb/tinfoil.py
@@ -54,6 +54,9 @@ class TinfoilUIException(Exception):
 class TinfoilCommandFailed(Exception):
     """Exception raised when run_command fails"""
 
+class TinfoilBuildEnvironmentException(Exception):
+    """Exception raised when build environment is not initialised"""
+
 class TinfoilDataStoreConnector:
     """Connector object used to enable access to datastore objects via tinfoil"""
 
@@ -372,6 +375,20 @@ class Tinfoil:
         """
         self.quiet = quiet
 
+        fixed_setup = False
+        basepath = os.path.dirname(os.path.abspath(__file__))
+        pth = basepath
+        while pth != '' and pth != os.sep:
+            if os.path.exists(os.path.join(pth, '.devtoolbase')):
+                fixed_setup = True
+                basepath = pth
+                break
+            pth = os.path.dirname(pth)
+        if not fixed_setup:
+            basepath = os.environ.get('BUILDDIR')
+            if not basepath:
+                raise TinfoilBuildEnvironmentException('Build environment not initialised')
+
         if self.tracking:
             extrafeatures = [bb.cooker.CookerFeatures.BASEDATASTORE_TRACKING]
         else:
-- 
2.7.4



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

end of thread, other threads:[~2018-02-07 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 18:26 [PATCH v2 0/1] tinfoil.py: Check if BUILDDIR or .devtoolbase exists Amanda Brindle
2018-02-07 18:27 ` [PATCH v2 1/1] " Amanda Brindle

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.