Bug 13337

Summary: Error with rmt when image depends on both tar-native and cpio-native
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Ernst Persson <ernstp>
Component: meta-yoctoAssignee: Armin Kuster <akuster>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher, randy.macleod
Version: 2.5.3   
Target Milestone: 2.5.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
adjusted cherry-pick for sumo none

Description Ernst Persson 2019-05-07 14:31:32 UTC
myimage depended on tar-native from before, yocto 2.5.3 brought in cpio-native as a dependency also.
That gives the following error. The error only seems to happen on clean builds. If you try again it seems to continue.

ERROR: myimage-core-dev-1.0-r0 do_image_tar: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:extend_recipe_sysroot(d)
     0003:
File: '/home/ernsjo/code/cu1/meta/poky/meta/classes/staging.bbclass', lineno: 545, function: extend_recipe_sysroot
     0541:                    dest = newmanifest[l]
     0542:                    if l.endswith("/"):
     0543:                        staging_copydir(l, targetdir, dest, seendirs)
     0544:                        continue
 *** 0545:                    staging_copyfile(l, targetdir, dest, postinsts, seendirs)
     0546:
     0547:    bb.note("Installed into sysroot: %s" % str(msg_adding))
     0548:    bb.note("Skipping as already exists in sysroot: %s" % str(msg_exists))
     0549:
File: '/home/ernsjo/code/cu1/meta/poky/meta/classes/staging.bbclass', lineno: 151, function: staging_copyfile
     0147:        os.symlink(linkto, dest)
     0148:        #bb.warn(c)
     0149:    else:
     0150:        try:
 *** 0151:            os.link(c, dest)
     0152:        except OSError as err:
     0153:            if err.errno == errno.EXDEV:
     0154:                bb.utils.copyfile(c, dest)
     0155:            else:
Exception: FileExistsError: [Errno 17] File exists: '/home/ernsjo/code/cu1/build/tmp/sysroots-components/x86_64/tar-native/sbin/rmt' -> '/home/ernsjo/code/cu1/build/tmp/work/lev_2-fslc-linux-gnueabi/myimage-core-dev/1.0-r0/recipe-sysroot-native/sbin/rmt'

ERROR: myimage-core-dev-1.0-r0 do_image_tar: Function failed: extend_recipe_sysroot
Comment 1 Ernst Persson 2019-05-07 14:32:36 UTC
I copied this snippet from image_types.bbclass to my image for tar-native:

do_image_tar[depends] += "tar-replacement-native:do_populate_sysroot"
EXTRANATIVEPATH += "tar-native"
Comment 3 Armin Kuster 2019-05-09 01:19:26 UTC
back ported to warrior-nmut
Comment 4 Ernst Persson 2019-05-10 11:42:42 UTC
Created attachment 4513 [details]
adjusted cherry-pick for sumo
Comment 5 Armin Kuster 2019-08-08 14:31:49 UTC
not in sumo. no plans on backporting