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.
Patch queued to master-next. Happier now I understand how to reproduce this issue and what the approximate cause is.
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.
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.
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"
Thanks very much!
Fixed in bitbake ceaca281cafa662aa2385b95641bce309dce843d.