[OE-core] [PATCH][master][fido][dizzy] Revert "perf: fix for rebuilding"

Robert Yang liezhi.yang at windriver.com
Wed Sep 16 09:07:13 UTC 2015



On 09/16/2015 04:57 PM, Burton, Ross wrote:
>
> On 16 September 2015 at 08:48, Robert Yang <liezhi.yang at windriver.com
> <mailto:liezhi.yang at windriver.com>> wrote:
>
>     I've figured out the reason, this is because the task's default cwd
>     is ${B}, the easier way to fix the problem is use mkdir -p rather than
>     mkdir, autotools.bbclass also has this problem, but I'd like to fix
>     exec_func, I will send a patch to bitbake-devel after more testing.
>
>
> Changing the default $B of [dirs] is not something we'll be doing post-M3. I've

Thanks, so let's simply use "mkdir -p" to fix the problem, atm ?

> a branch that changes that default and have fixed all the obvious breakage in
> oe-core already so this is something on my plan for immediately after 2.1
> branches off.

I made 2 patches just now, one is for bitbake, and one for insane.bbclass,
  maybe we are doing the similar things, I can drop them then.

     build.py: default exec_func's cwd to WORKDIR

     This can fix a few problems:
     - The ${B} was nearly always created in the past after any tak runs, for
       example, the ${B} exists after do_clean or do_cleansstate (first
       removed, then created), but ${B} is useless and confused end user in
       this case, the similar to a lot of prefuncs and postfuncs which also
       create ${B}, but not used. This patch fixes the problem.

     - This can fix race issue when we use the following commands in other
       tasks:
         rm -rf ${B}
         mkdir ${B}
       such as autotools.bbclass and perf.bb.

     When the 'dirs' or 'cleandirs' is not specified by task, which means
     that they are not important, so default to WORKDIR which is more common
     and usually existed.

     Signed-off-by: Robert Yang <liezhi.yang at windriver.com>

diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 948c395..a413c35 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -182,8 +182,9 @@ def exec_func(func, d, dirs = None):
              bb.utils.mkdirhier(adir)
          adir = dirs[-1]
      else:
-        adir = d.getVar('B', True)
-        bb.utils.mkdirhier(adir)
+        adir = d.getVar('WORKDIR', True)
+        if not os.path.exists(adir):
+            bb.utils.mkdirhier(adir)

      ispython = flags.get('python')

===================

     insane.bbclass: only do_qa_unpack warn when SRC_URI is not null

     If SRC_URI is null, then no source is needed to be unpacked, thus no
     warn.

     Signed-off-by: Robert Yang <liezhi.yang at windriver.com>

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 5c8629a..e22e8a0 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -1214,7 +1214,7 @@ python do_qa_unpack() {
      bb.note("Checking has ${S} been created")

      s_dir = d.getVar('S', True)
-    if not os.path.exists(s_dir):
+    if not os.path.exists(s_dir) and d.getVar('SRC_URI', True):
          bb.warn('%s: the directory %s (%s) pointed to by the S variable 
doesn\'t exist - please set S within the recipe to point to where the source has 
been unpacked to' % (d.getVar('PN', T
  }

// Robert
>
> Ross



More information about the Openembedded-core mailing list