Bug 5127

Summary: base.bbclass: do_unpack failed for *.xz files if xz is not installed on host
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jackie Huang <jackie.huang>
Component: coreAssignee: Saul Wold <sgw>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: alexandrux.palalau, meta.mr.watcher, meta.watcher, richard.purdie
Version: 1.5   
Target Milestone: 1.5 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Jackie Huang 2013-09-05 10:43:19 UTC
In base.bbclass, we have:
# *.xz should depends on xz-native for unpacking
# Not endswith because of "*.patch.xz;patch=1". Need bb.decodeurl in future
if '.xz' in srcuri:
d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')

But looks like it's not working.

If xz is not installed on the host and I do:
1) $ bitbake -c cleansstate xz-native
2) $ bitbake -c unpack gstreamer1.0-plugins-base

It will always fail with:

ERROR: Function failed: Unpack failure for URL: 'http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.0.9.tar.xz'. Unpack command PATH="/buildarea/jhuang0/git/yocto/poky/scripts:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux/usr/bin/x86_64-poky-linux:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/qemux86-64/usr/bin/crossscripts:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux/usr/sbin:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux/usr/bin:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux/sbin:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux//bin:/buildarea/jhuang0/git/yocto/poky/scripts:/buildarea/jhuang0/git/yocto/poky/bitbake/bin:/folk/jhuang0/bin:/folk/jhuang0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" xz -dc /buildarea/jhuang0/yp/downloads/gst-plugins-base-1.0.9.tar.xz | tar x --no-same-owner -f - failed with return value 2
ERROR: Logfile of failure stored in: /buildarea/jhuang0/yp/y_x64_0705/tmp/work/x86_64-poky-linux/gstreamer1.0-plugins-base/1.0.9-r0/temp/log.do_unpack.8305
Log data follows:
| DEBUG: Executing python function do_unpack
| DEBUG: Executing python function base_do_unpack
| NOTE: Unpacking /buildarea/jhuang0/yp/downloads/gst-plugins-base-1.0.9.tar.xz to /buildarea/jhuang0/yp/y_x64_0705/tmp/work/x86_64-poky-linux/gstreamer1.0-plugins-base/1.0.9-r0/
| /bin/sh: xz: command not found
| tar: This does not look like a tar archive
| tar: Exiting with failure status due to previous errors
| DEBUG: Python function base_do_unpack finished
| DEBUG: Python function do_unpack finished
| ERROR: Function failed: Unpack failure for URL: 'http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.0.9.tar.xz'. Unpack command PATH="/buildarea/jhuang0/git/yocto/poky/scripts:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux/usr/bin/x86_64-poky-linux:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/qemux86-64/usr/bin/crossscripts:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux/usr/sbin:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux/usr/bin:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux/sbin:/buildarea/jhuang0/yp/y_x64_0705/tmp/sysroots/x86_64-linux//bin:/buildarea/jhuang0/git/yocto/poky/scripts:/buildarea/jhuang0/git/yocto/poky/bitbake/bin:/folk/jhuang0/bin:/folk/jhuang0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" xz -dc /buildarea/jhuang0/yp/downloads/gst-plugins-base-1.0.9.tar.xz | tar x --no-same-owner -f - failed with return value 2
NOTE: recipe gstreamer1.0-plugins-base-1.0.9-r0: task do_unpack: Failed
ERROR: Task 0 (/buildarea/jhuang0/git/yocto/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.0.9.bb, do_unpack) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /buildarea/jhuang0/git/yocto/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.0.9.bb, do_unpack
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
Comment 1 Saul Wold 2013-09-09 17:24:36 UTC
I can reproduce this with xz, but if I try unzip it works correctly, so it  
seems to be specific to xz.
Comment 3 Alexandru Palalau 2013-09-12 06:43:37 UTC
Verified on master branch.
Commit ID: 40232ed397a586a520ce6ef6e005d4db336ace03