When sourcing conf/setenv the below snippet searches all your layers for a scripts directory and adds it to your path. # check for any scripts directories in the top-level of the repos and add those # to the PATH SCRIPTS=`find ${OEBASE}/sources -maxdepth 2 -name "scripts" -type d` for s in ${SCRIPTS} do PATH="${s}:$PATH" done Usually oe-core is the only layer that contains a scripts directory but it is possible for other layers to define their own especially if they plan on overriding a script contained within oe-core's scripts directory. oe-core/scripts/bitbake contains the below snippet: export PATH=`echo $PATH | sed s#[^:]*/scripts:##` This portion is meant to remove any scripts directory from the PATH temporarily. However, this assumes that only one scripts directory has been defined. In the event that more scripts directory is located in the path only once instance will be removed. For whatever reason the bitbake script freaks out and results in a recursive call to itself spawning multiple instances of itself until after a long time it crashes. The simple fix is to add the g option to the regular expression so all instances of the scripts directory within the path is removed.
Created attachment 1068 [details] Bug fix
Franklin, 1. Do you realize that conf/setenv as well as the code you cited below are specific to our own layer setup tool from the Arago Project? 2. And even with that, I don't seem to experience any problems with setup code and multiple instances of scripts/ directory...
Ok, I was able to reproduce the issue on Franklin's machine... The "find" command below is from our own setenv script, but it adds all occurrences of <layer>/scripts to the PATH variable. The order of layers is not guaranteed, so if oe-core/scripts is not the first in the list, it won't be processed by the below sed command within scripts/bitbake wrapper and filtered out from the PATH variable before re-calling the actual bitbake binary. And since it only filters out the first occurrence (which could have been e.g. meta-arago/scripts), it ends up calling bitbake wrapper from oe-core/scripts again and again.
Thanks for the patch! http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=a9608dd3e5d32a784c13d2b379d36b9046226172