Fixed
Created: Jul 28, 2014
Updated: Dec 3, 2018
Resolved Date: Jul 30, 2014
Previous ID: LIN5-19130
Found In Version: 6.0
Fix Version: 6.0.0.10
Severity: Severe
Applicable for: Wind River Linux 6
Component/s: Build & Config
hen enabling source code archiving and a package is in the package list that has more than one directory symlink in SRC_URI to a read-only area will the build fail:
Note that you will get the same problem if there is only one directory symlink in the SRC_URI if this link isn't the first entry in SRC_URI
Error message:
NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Error executing a python function in /archiver/layers/local/recipes-sample/test/test_1.0.bb:
CalledProcessError: Command 'tar -cf - -C /archiver/layers/local/recipes-sample/test/src/ -p . | tar -xf - -C /archiver/layers/local/recipes-sample/test/src/' returned non-zero exit status 2 with output tar: ./b: Cannot open: File exists
tar: ./a: Cannot open: File exists
tar: Exiting with failure status due to previous errors
ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR: File "do_archive_original_sources_patches", line 6, in <module>
ERROR:
ERROR: File "do_archive_original_sources_patches", line 3, in do_archive_original_sources_patches
ERROR:
ERROR: File "archiver.bbclass", line 12, in archive_sources_patches
ERROR:
ERROR: File "archiver.bbclass", line 4, in select_archive_patches
ERROR:
ERROR: File "archiver.bbclass", line 29, in get_series
ERROR:
ERROR: File "/archiver/layers/oe-core/meta/lib/oe/path.py", line 86, in copytree
ERROR: check_output(cmd, shell=True, stderr=subprocess.STDOUT)
ERROR:
ERROR: File "/archiver/layers/oe-core/meta/lib/oe/path.py", line 148, in check_output
ERROR: raise CalledProcessError(retcode, cmd, output=output)
ERROR:
ERROR: The code that was being executed was:
ERROR: 0002:def do_archive_original_sources_patches(d):
ERROR: 0003: archive_sources_patches(d,'prepatch')
ERROR: 0004:
ERROR: 0005:
ERROR: *** 0006:do_archive_original_sources_patches(d)
ERROR: 0007:
ERROR: [From file: 'do_archive_original_sources_patches', lineno: 6, function: <module>]
ERROR: 0001:
ERROR: 0002:def do_archive_original_sources_patches(d):
ERROR: *** 0003: archive_sources_patches(d,'prepatch')
ERROR: 0004:
ERROR: 0005:
ERROR: 0006:do_archive_original_sources_patches(d)
ERROR: 0007:
ERROR: [From file: 'do_archive_original_sources_patches', lineno: 3, function: do_archive_original_sources_patches]
ERROR: 0008:
ERROR: 0009: source_tar_name = archive_sources(d,stage_name)
ERROR: 0010: if stage_name == "prepatch":
ERROR: 0011: if d.getVar('PATCHES_ARCHIVE_WITH_SERIES',True).upper() == 'TRUE':
ERROR: *** 0012: patch_tar_name = select_archive_patches(d,"all")
ERROR: 0013: elif d.getVar('PATCHES_ARCHIVE_WITH_SERIES',True).upper() == 'FALSE':
ERROR: 0014: patch_tar_name = select_archive_patches(d,"applying")
ERROR: 0015: else:
ERROR: 0016: bb.fatal("Please define 'PATCHES_ARCHIVE_WITH_SERIES' is strings 'True' or 'False' ")
ERROR: [From file: 'archiver.bbclass', lineno: 12, function: archive_sources_patches]
ERROR: 0001:def select_archive_patches(d,option):
ERROR: 0002: '''select to archive all patches including non-applying and series or applying patches '''
ERROR: 0003: if option == "all":
ERROR: *** 0004: patchdir = get_series(d)
ERROR: 0005: elif option == "applying":
ERROR: 0006: patchdir = get_applying_patches(d)
ERROR: 0007: try:
ERROR: 0008: os.rmdir(patchdir)
ERROR: [From file: 'archiver.bbclass', lineno: 4, function: select_archive_patches]
ERROR: 0025: shutil.copy(patch,dest)
ERROR: 0026: except IOError:
ERROR: 0027: if os.path.isdir(patch):
ERROR: 0028: bb.mkdirhier(os.path.join(dest,patch))
ERROR: *** 0029: oe.path.copytree(patch, os.path.join(dest,patch))
ERROR: 0030: return dest
ERROR: 0031:
ERROR: [From file: 'archiver.bbclass', lineno: 29, function: get_series]
ERROR: Function failed: do_archive_original_sources_patches
ERROR: Logfile of failure stored in: /archiver/bitbake_build/tmp/work/x86_64-wrs-linux/test-1.0-r1/temp/do_unpack/log.do_unpack.28413
ERROR: Task 0 (/archiver/layers/local/recipes-sample/test/test_1.0.bb, do_unpack) failed with exit code '1'
NOTE: Tasks Summary: Attempted 300 tasks of which 119 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:
Reproduced on RHEL 6.4 and 6.5
1. configure a project with:
--enable-board=qemux86-64 --enable-rootfs=glibc-small --enable-kernel=standard --enable-jobs=9 --enable-parallel-pkgbuilds=9 --with-rcpl-version=0015
2. edit local.conf and append at the end:
ARCHIVER_MODE ?= "original"
ARCHIVER_CLASS = "${@'archive-${ARCHIVER_MODE}-source' if ARCHIVER_MODE != 'none' else ''}"
INHERIT += "${ARCHIVER_CLASS}"
SOURCE_ARCHIVE_PACKAGE_TYPE = "tar"
3. create a readonly location on the local disk, to mirror the following setting:
find /work/xxxxx/ro* -ls
81920003 4 dr-xr-xr-x 4 xxxxx users 4096 iul 9 16:13 /work/xxxxx/ro
81920004 4 dr-xr-xr-x 2 xxxxx users 4096 iul 9 16:26 /work/xxxxx/ro/src
81926621 0 lrwxrwxrwx 1 root root 3 iul 9 16:26 /work/xxxxx/ro/src/src -> src
81920006 0 -r--r--r-- 1 xxxxx users 0 iul 9 16:08 /work/xxxxx/ro/src/b
81920005 0 -r--r--r-- 1 xxxxx users 0 iul 9 16:08 /work/xxxxx/ro/src/a
82066598 4 dr-xr-xr-x 2 xxxxx users 4096 iul 9 16:13 /work/xxxxx/ro/src2
82066600 0 -r--r--r-- 1 xxxxx users 0 iul 9 16:13 /work/xxxxx/ro/src2/d
82066599 0 -r--r--r-- 1 xxxxx users 0 iul 9 16:13 /work/xxxxx/ro/src2/c
four dummy files a,b,c,d found in two different directories: src and src2 with read only rights.
4. under layers/local/recipes-sample, create a new directory called test in which:
- copy the hello.c source file from the hello example
- create two symlinks src and src2 pointing to the readonly directories
- and a .bb file containing:
DESCRIPTION = "Test prog to test archiver with multiple symlinks"
LICENSE = "windriver"
LICENSE_FLAGS = "commercial_windriver"
LIC_FILES_CHKSUM = "file://hello.c;beginline=1;endline=3;md5=3e8f741b049bec8146c81a2667ab4b45"
SECTION = "sample"
PR = "r1"
SRC_URI = " \
file://src/ \
file://src2/ \
file://hello.c \
"
S = "${WORKDIR}"
do_compile() {
${CC} ${CFLAGS} -o hello hello.c
}
do_install() {
install -d ${D}${bindir}
install -m 0755 hello ${D}${bindir}
install -m 0755 ${S}/src/a ${D}${bindir}
install -m 0755 ${S}/src/b ${D}${bindir}
install -m 0755 ${S}/src2/c ${D}${bindir}
install -m 0755 ${S}/src2/d ${D}${bindir}
}
the layers/local/recipes-sample/test directory should look like:
ls -al
total 16
drwxr-xr-x 2 user user 4096 Jul 3 11:47 .
drwxrwxrwx 49 root root 4096 Jul 9 12:12 ..
-rw-r--r-- 1 user user 108 Jul 3 11:39 hello.c
lrwxrwxrwx 1 user user 7 Jul 3 14:09 src -> /ro/src
lrwxrwxrwx 1 user user 8 Jul 3 14:09 src2 -> /ro/src2
-rw-r--r-- 1 user user 661 Jul 3 11:40 test_1.0.bb
5. add the package and build it:
make -C build test.addpkg && make -C build test