Bug 11801

Summary: rpmbuild fails randomly when try to build a spec file
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Aníbal Limón <anibal.limon>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED OBSOLETE QA Contact:
Severity: normal    
Priority: Medium CC: alex.kanavin, liezhi.yang, mark.hatle, mark.hatle, meta.mr.watcher, meta.watcher, richard.purdie
Version: 2.4   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
rpmbuild
none
oe-selftest run 8 threads
none
oe-selftest run 4 threads none

Description Aníbal Limón 2017-07-17 20:29:20 UTC
Created attachment 3874 [details]
rpmbuild

I found that in some cases rpmbuild fails trying to build a SPEC file, see attached log.

I was running oe-selftest,

$ oe-selftest -r  buildoptions.ArchiverTest.test_arch_work_dir_and_export_source

And causes the test to fail, i suspect that is some kind of race because if i modified package_rpm.bbclass adding verbosity -vv to the rpmbuild command and the test passes.
Comment 1 Aníbal Limón 2017-07-18 15:32:33 UTC
I'm using a modified version of oe-selftest that allows to use more than 1 thread to execute unittests, this consume a lot of cpu/memory and may be the error is shown because that.

Using 8 threads for execute unittests other packages starts to fail building rpm,

ERROR: nativesdk-patchelf-0.9-r0 do_package_write_rpm: Function failed: BUILDSPEC
ERROR: libtool-2.4.6-r0 do_package_write_rpm: Function failed: BUILDSPEC 

Search for that in the attached log.
Comment 2 Aníbal Limón 2017-07-18 15:33:18 UTC
Created attachment 3878 [details]
oe-selftest run 8 threads
Comment 3 Aníbal Limón 2017-07-18 17:21:59 UTC
(In reply to comment #1)
> I'm using a modified version of oe-selftest that allows to use more than 1
> thread to execute unittests, this consume a lot of cpu/memory and may be the
> error is shown because that.
> 
> Using 8 threads for execute unittests other packages starts to fail building
> rpm,
> 
> ERROR: nativesdk-patchelf-0.9-r0 do_package_write_rpm: Function failed:
> BUILDSPEC
> ERROR: libtool-2.4.6-r0 do_package_write_rpm: Function failed: BUILDSPEC 
> 
> Search for that in the attached log.

My theory seems to be true using 4 pythreads for unittest execution the failures building the RPM's didn't happen.
Comment 4 Aníbal Limón 2017-07-18 17:24:05 UTC
Created attachment 3879 [details]
oe-selftest run 4 threads
Comment 5 Richard Purdie 2021-09-23 15:37:46 UTC
This is with a modified oe-selftest using threading and is likely an issue in that threading code. We now have parallelism in ie-selftest with the -j option and don't see this issue.