All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] build.py: Be determistic about a function's cwd
@ 2011-12-01 12:03 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2011-12-01 12:03 UTC (permalink / raw)
  To: bitbake-devel

There is a subtle but nasty problem that a function's cwd can vary
depending on whether ${B} (often ${S}) exists before the funciton is
called or not. Most functions in the system can cope with this but
its bad practise and I've just witnessed build failures resulting
from this during image generation from bootimg.bbclass. I also
suspect this could explain some odd fetcher behaviour witnessed in
the past.

This change ensures we always call funcitons with a specific build
directory making things deterministic.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index ae4a962..9ad1e50 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -149,8 +149,7 @@ def exec_func(func, d, dirs = None):
         adir = dirs[-1]
     else:
         adir = data.getVar('B', d, 1)
-        if not os.path.exists(adir):
-            adir = None
+        bb.utils.mkdirhier(adir)
 
     ispython = flags.get('python')
     if flags.get('fakeroot') and not flags.get('task'):





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-01 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01 12:03 [PATCH] build.py: Be determistic about a function's cwd Richard Purdie

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.