Bug 13171 - archiver rpm mode is broken
Summary: archiver rpm mode is broken
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: 2.7
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.7
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-02-05 13:26 UTC by Richard Purdie
Modified: 2019-02-09 18:42 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2019-02-05 13:26:03 UTC
There are several problems:

Nothing ever cleans ARCHIVER_TOPDIR when tasks rerun

do_package_write_rpm writes to ARCHIVER_TOPDIR which isn't captured by that task's sstate. If that task were restored from sstate the archive would be missing which would be silently ignored.

The inverse issue is also present, other tasks may be skipped on subsequent runs meaning incomplete files may be present.

| error: create archive failed on file /media/build1/poky/build/tmp/work/all-poky-linux/xcursor-transparent-theme/0.1.1+gitAUTOINC+23c8af5ba4-r0/deploy-sources/allarch-poky-linux/xcursor-transparent-theme-0.1.1+gitAUTOINC+23c8af5ba4-r0/xcursor-transparent-theme-0.1.1+git0+23c8af5ba4-r0.src.rpm: cpio: read failed - No such file or directory
| Building target platforms: noarch-poky-linux
| Building for target noarch-poky-linux

This is caused by:

$ cat log.task_order

do_cleansstate (24289): log.do_cleansstate.24289
do_deploy_archives_setscene (24395): log.do_deploy_archives_setscene.24395
do_fetch (24407): log.do_fetch.24407
[..]
do_package_write_rpm (25448): log.do_package_write_rpm.25448
do_package_qa (25451): log.do_package_qa.25451

So do_deploy_archives can from sstate, created a .src.rpm in WORKDIR/deploy-sources, then it was removed when rpm was running.

A quick fix is:
            source_list = os.listdir(ar_outdir)
            source_number = 0
            for source in source_list:
+                if source.endswith(".rpm"):
+                    continue

in package_rpm.bbclass however this just hacks around the problem.

Not sure how to fix the problems with the current codebase :(
Comment 1 Richard Purdie 2019-02-09 18:42:48 UTC
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=251ded90d4ad75da5e110e916068050f15ace07c fixes the worst problems in the rpm section of things,