Bug 352

Summary: "bitbake poky-image-sdk" fails because eglibc-initial can't unpack
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Dexuan Cui <dexuan.cui>
Component: meta-yoctoAssignee: Dexuan Cui <dexuan.cui>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: High CC: jessica.zhang, ke.yu, kevin.tian, mark.hatle, poky.bs.watcher, poky.watcher, richard.purdie, sgw
Version: 0.9   
Target Milestone: 0.9 M4   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Program Management Documentation change: ---

Description Dexuan Cui 2010-09-26 23:07:30 UTC
On poky's master, when testing my 3 patches:
28abeb01b84e222501779c575b0c972157c56c46: eglibc: add FILESPATH to avoid failure on unpackdcui/eglibc Dexuan Cui 1 -0/+2 
a318064a0dba1301579f74898e507b11ef4cbfbc: trace-cmd: remove explict DEPENDS on "glibc" Dexuan Cui 1 -3/+1 
da12d03aa078765bd4fd69167b047c0f849fa972: poky-default.inc: change the hardcoded glibc-initial to ${POKYLIBC}-initial 

I always meet with the following eglibc-initial unpack failure when doing "bitbake poky-image-sdk"(I think sato also gets the same issue though I didn't try that):

tmp/work/i586-poky-linux/eglibc-initial-2.12-r7/temp/log.base_do_unpack.11606:

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
NOTE: Unpacking /home/dcui/sources/eglibc-2_12_www.eglibc.org_.svn.branches._10809_.tar.gz to /home/dcui/0927/p/build/tmp/work/i586-poky-linux/eglibc-initial-2.12-r7/

But "bitbake eglibc-initial -c unpack" can succeed...

I used the following patch to workaround the issue by disabling pseudo on unpack:

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
-   cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd)
+   cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd)

I suspect this is also a pseudo related issue.
Comment 1 Dexuan Cui 2010-09-27 08:14:20 UTC
(In reply to comment #0)
> I suspect this is also a pseudo related issue.
Sorry, I was wrong.
Now I'm trying RP's suggestion (the problem sounds very like the issue where some tarballs don't unpaack with some versions of gzip.)
Comment 2 Dexuan Cui 2010-09-27 21:36:33 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > I suspect this is also a pseudo related issue.
> Sorry, I was wrong.
> Now I'm trying RP's suggestion (the problem sounds very like the issue where
> some tarballs don't unpaack with some versions of gzip.)

Kevin and I finally got the root cause:
------------------------------------------
Recently we frequently suffer from unpack failure for eglibc-initial and gconf-dbus whose's SRC_URIs are svn repos.

Kevin and I finally got the root cause: there is race condition, e.g., after eglibc-initial's fetch succeeds, when eglibc-initial's unpack is ongoing, eglibc's fetch may be also ongoing! As a result eglibc-initial's unpack would fail. gconf-dbus and gconf-dubs-native have the same issue. More generally, PN, PN-native, PN-nativesdk have the same issue.

I suppose we'll have to consider some enhancement in bbclass. Can you please give some suggestions? Thanks!

BTW: this should be a long-standing issue. The reason why it happens so frequently may be because of the fetcher change in bitbake, which maks every build to re-generate .tar.gz file for SCM repo even when there is no rev change. We may also need to improve the fetcher change.
------------------------------------------
Comment 4 Dexuan Cui 2010-09-29 18:54:38 UTC
With Joshua's patch, I don't meet the unpack issue any longer.

Let me VERIFY the bug.