All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] improve recovery when something goes horribly wrong
@ 2013-11-20  0:31 Peter Seebach
  2013-11-20  0:31 ` [PATCH 1/2] build.py: add single-quotes around already-expanded directory name Peter Seebach
  2013-11-20  0:31 ` [PATCH 2/2] data_smart.py: Add isTracking() to datasmart Peter Seebach
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Seebach @ 2013-11-20  0:31 UTC (permalink / raw)
  To: bitbake-devel

Certain early failures can result in things going wrong in ways that
prevent "bitbake -e" from running, creating strange or cryptic failures,
and even when they're not all that cryptic, lack of include tracking
or variable history tracking can be a significant disadvantage.

These patches address one of the failure modes, and make it possible for
an oe-core change to address another.

The first patch makes run.* scripts work even when the path name generated
contains unexpanded variable names, by quoting the argument to cd. The
second provides an isTracking() to DataSmart to allow the sanity checks
to be normal errors rather than fatal errors when trying to run with
tracking enabled (which only occurs when you want to dump the results of
the tracking).

The following changes since commit a66ee0994645aa5658b2f5ea134ed17d89f8751a:

  fetch2: Fix handling of SCM mirrors in MIRRORS (2013-11-19 13:22:10 +0000)

are available in the git repository at:
  git://git.yoctoproject.org/poky-contrib seebs/warning_helper
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/warning_helper

Peter Seebach (2):
  build.py: add single-quotes around already-expanded directory name
  data_smart.py: Add isTracking() to datasmart

 lib/bb/build.py      |    2 +-
 lib/bb/data_smart.py |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)



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

* [PATCH 1/2] build.py: add single-quotes around already-expanded directory name
  2013-11-20  0:31 [PATCH 0/2] improve recovery when something goes horribly wrong Peter Seebach
@ 2013-11-20  0:31 ` Peter Seebach
  2013-11-20  0:31 ` [PATCH 2/2] data_smart.py: Add isTracking() to datasmart Peter Seebach
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Seebach @ 2013-11-20  0:31 UTC (permalink / raw)
  To: bitbake-devel

If the computed name of a directory contains an undefined variable
reference, bitbake dutifully creates a directory with a name that has
${...} in it. However, the actual task script created then tries to cd
to that directory, and the cd command fails, because no such directory
exists -- because the shell has helpfully removed the ${...} which did
not match any actual variables.

Since we want the name to be used exactly-as-is, add single quotes around
the name so this doesn't cause strange failures running tasks, which
allows us to progress past such failures and get to a point where they
can be diagnosed.

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
---
 lib/bb/build.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index f9aca42..92c45a3 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -288,7 +288,7 @@ set -e
         if bb.msg.loggerVerboseLogs:
             script.write("set -x\n")
         if cwd:
-            script.write("cd %s\n" % cwd)
+            script.write("cd '%s'\n" % cwd)
         script.write("%s\n" % func)
         script.write('''
 # cleanup
-- 
1.7.1



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

* [PATCH 2/2] data_smart.py: Add isTracking() to datasmart
  2013-11-20  0:31 [PATCH 0/2] improve recovery when something goes horribly wrong Peter Seebach
  2013-11-20  0:31 ` [PATCH 1/2] build.py: add single-quotes around already-expanded directory name Peter Seebach
@ 2013-11-20  0:31 ` Peter Seebach
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Seebach @ 2013-11-20  0:31 UTC (permalink / raw)
  To: bitbake-devel

It would be awesome to have "bitbake -e" work even when sanity failures
occur. But you can't do that if you can't tell whether tracking is
enabled. We add a trivial accessor.

Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
---
 lib/bb/data_smart.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index a1cbaba..4ff2717 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -309,6 +309,9 @@ class DataSmart(MutableMapping):
     def disableTracking(self):
         self._tracking = False
 
+    def isTracking(self):
+        return self._tracking
+
     def expandWithRefs(self, s, varname):
 
         if not isinstance(s, basestring): # sanity check
-- 
1.7.1



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

end of thread, other threads:[~2013-11-20  0:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-20  0:31 [PATCH 0/2] improve recovery when something goes horribly wrong Peter Seebach
2013-11-20  0:31 ` [PATCH 1/2] build.py: add single-quotes around already-expanded directory name Peter Seebach
2013-11-20  0:31 ` [PATCH 2/2] data_smart.py: Add isTracking() to datasmart Peter Seebach

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.