Bug 12605

Summary: likely race in gcc-runtime's do_package_write_rpm
Product: [Build System, Metadata & Runtime] OE-Core Reporter: California Sullivan <california.l.sullivan>
Component: coreAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, richard.purdie, stephano
Version: 2.5   
Target Milestone: 2.5 M4   
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
gcc-runtime do_package_write_rpm none

Description California Sullivan 2018-03-14 14:46:44 UTC
Created attachment 4236 [details]
gcc-runtime do_package_write_rpm

During an AB run the following error occurred:

| DEBUG: Python function write_specfile finished
| DEBUG: PKGWRITEDIR: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/core2-64-poky-linux/gcc-runtime/7.3.0-r0/deploy-rpms/core2_64
| DEBUG: SITE files ['endian-little', 'common-linux', 'common-glibc', 'bit-64', 'x86_64-linux', 'common']
| DEBUG: Executing shell function BUILDSPEC
| error: failed to create directory %{_builddir}: /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work-shared/gcc-7.3.0-r0/gcc-7.3.0: File exists
| Building target platforms: core2_64-poky-linux
| Building for target core2_64-poky-linux

It appears that rpmbuild is attempting to create a directory that already exists and doesn't handle it well.

Link: https://autobuilder.yocto.io/builders/nightly-oe-selftest/builds/908/steps/Running%20oe-selftest/logs/stdio

This occurred in a mut build but I don't see anything in the branch immediately related to this.
Comment 1 Richard Purdie 2018-03-14 15:38:48 UTC
Note that this is in shared-workdir and I doubt rpms should be touching a path in work-shared as the _builddir for rpm. This could be gcc-runtime racing against libgcc for packaging.

Looking at the logs, "NOTE: recipe libgcc-7.3.0-r0: task do_package_write_rpm: Succeeded" is after the failure so this is very likely the case.
Comment 2 Richard Purdie 2018-03-14 15:42:14 UTC
May be worth trying changing the definition of _builddir in package_rpm.bbclass from S to B...
Comment 3 California Sullivan 2018-03-14 17:53:40 UTC
I tried it locally and core-image-sato was able to build and boot, but more testing should probably be done.
Comment 4 Ross Burton 2018-04-10 06:35:38 UTC
Merged in oe-core d6c13a5ff441f7076eb327c0d0b747bd7603db0f.