Bug 13022

Summary: tmp/hosttools is not recreated if tmp is removed while a bitbake server is active
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Peter Kjellerstedt <peter.kjellerstedt>
Component: oe-core otherAssignee: Robert Yang <liezhi.yang>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: liezhi.yang, randy.macleod, sjolley.yp.pm
Version: 2.5.2   
Target Milestone: 2.7 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 13023    

Description Peter Kjellerstedt 2018-11-13 22:41:06 UTC
If the bitbake server is active and tmp is removed/moved away, then tmp/hosttools is not recreated the next time bitbake is run (as long as the server is still active). This is because tmp/hosttools is only created due to the bb.event.ConfigParsed event, which is not fired when an active bitbake server is reused.

Steps to reproduce:

* Enable the bitbake server, e.g., by adding BB_SERVER_TIMEOUT = "600" to local.conf.
* Run `bitbake m4-native`.
* Move away tmp
* Run `bitbake m4-native` again.

Eventually it will fail with "ERROR: Error running gcc  --version:" because gcc cannot be found in $PATH.

A possible solution would be to trigger the creation of tmp/hosttools also on the bb.event.ParseStarted event.
Comment 1 Robert Yang 2019-01-28 08:55:59 UTC
We can't use both bb.event.ConfigParsed and bb.event.ParseStarted for hosttools creation at the same time, otherwise, it would make it create twice. I will send a patch to change it to bb.event.ParseStarted.
Comment 2 Robert Yang 2019-02-14 02:43:30 UTC
We can't use bb.event.ParseStarted to replace bb.event.ConfigParsed for hosttools since it would break fresh build:


ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Please install the following missing utilities: GNU make,C Compiler (gcc ),C++ Compiler (g++ ),patch,diffstat,makeinfo,git,bzip2,tar,gzip,gawk,chrpath,wget,cpio,perl,file,which


I've sent another patch to mailing list to fix the issue:

http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/ht