Bug 12464 - Failure when get_srcrev runs from fakeroot tasks
Summary: Failure when get_srcrev runs from fakeroot tasks
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 2.4
Hardware: x86 x86_64
: Medium+ minor
Target Milestone: 2.5 M2
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard: Backport 2.2.4, 2.3.4, and 2.4.2?
Depends on:
Blocks:
 
Reported: 2018-01-03 19:21 UTC by Keegan Morrow
Modified: 2018-02-05 14:19 UTC (History)
4 users (show)

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


Attachments
Patch to reproduce this issue (787 bytes, application/octet-stream)
2018-01-03 19:21 UTC, Keegan Morrow
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Keegan Morrow 2018-01-03 19:21:22 UTC
Created attachment 4164 [details]
Patch to reproduce this issue

I'm running into a situation where the bb.fetch2.get_srcrev() function will be called with pseudo.

I found a patch submitted by Peter Kjellerstedt that was submitted in 2014 to address similar behavior.
https://patchwork.openembedded.org/patch/67067/

There are a few things that seem to be necessary to create this behavior:
* SRC_URI must specify a value for tag
* SRC_URI must use protocol=ssh
* PV must contain ${SRCPV}

In practice I've only had this issue with custom recipes that were written doing all of these things, but I've created a patch that modifies the update-rc.d recipe to create the problem. This was built using the yocto-2.4 tag.

After applying the attached patch, I can run the following to create the issue:
bitbake update-rc.d
bitbake update-rc.d -fc install

When install re-runs the get_srcrev() will be run under pseudo, since do_install is a fakeroot task.

I see the same behavior with my custom recipes when fakeroot tasks need to be re-run.

Applying the patch works that Peter Kjellerstedt had submitted prevents this issue.
Comment 1 Richard Purdie 2018-01-07 12:27:34 UTC
Patch queued to master-next. Happier now I understand how to reproduce this issue and what the approximate cause is.
Comment 2 Peter Kjellerstedt 2018-01-09 17:15:51 UTC
Nice to see this finally making it onto master. I had forgotten I even sent the patch, since we have been using a workaround (which basically does the same as the patch) in our distro.conf for all these years.
Comment 3 Keegan Morrow 2018-01-09 17:22:22 UTC
Thanks for getting this in the queue Richard!

Peter - any chance that you could share the distro.conf workaround? And of course thank you for coming up with the patch.
Comment 4 Peter Kjellerstedt 2018-01-09 18:45:30 UTC
Sure. This is what we have in our configuration:

# There is a problem with BitBake that uncder certain circumstances (involving
# ${SRCPV}) can cause git to be called when pseudo is active (from
# do_package_write_rpm). Since we use ssh to access our repositories, this will
# cause ssh to hang when it tries to access the real root's configuration files
# for ssh, which of course is not allowed...
FETCHCMD_git = "export PSEUDO_DISABLED=1; git -c core.fsyncobjectfiles=0"
Comment 5 Keegan Morrow 2018-01-10 18:23:42 UTC
Thanks very much!
Comment 6 Ross Burton 2018-02-05 14:19:25 UTC
Fixed in bitbake ceaca281cafa662aa2385b95641bce309dce843d.