Bug 12194

Summary: Toaster server lost "toaster.conf" environment, user settings lost
Product: [Build System, Metadata & Runtime] Toaster Reporter: David Reyna <david.reyna>
Component: toasterAssignee: David Reyna <david.reyna>
Status: RESOLVED FIXED QA Contact: Libertad <libertad.gonzalez.de.la.cruz>
Severity: normal    
Priority: High CC: jessica.zhang, poky.bs.watcher, poky.watcher, stanciux.mihail
Version: 2.4   
Target Milestone: 2.4 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description David Reyna 2017-10-05 19:58:05 UTC
The builds run by Toaster are missing the crucial "toaster.conf" and "toaster-bblayers.conf", and thus lose all customer settings.

Toaster had been passing in these files when the bb server was started in '--server-only' mode, and prior to the recent server changes those environment settings were preserved when the subsequent build call was made.

Apparently now either those environment settings are no longer persistent, or when Toaster connects to the server the second time with the new port number, that resulting environment is un-connected to the original environment.

The problem was not observed prior to now since there were no build failures, just silent errors as all user changes (like MACHINE) were ignored.
Comment 1 David Reyna 2017-10-05 20:00:14 UTC
Here is the proposed patch:

diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/l
index a2ca95b..ab9d9c0 100644
--- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
+++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -381,9 +381,10 @@ class LocalhostBEController(BuildEnvironmentController):
         local_bitbake = os.path.join(os.path.dirname(os.getenv('BBBASEDIR')),
                                      'bitbake')
         self._shellcmd(['bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:%s" '
-                        '%s %s -u toasterui --token="" >>%s 2>&1;'
+                        '%s %s -u toasterui  --read %s --read %s --token="" >>%
                         'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:%s %s -m)&\"' \
-                        % (brbe, self.be.bbport, local_bitbake, bbtargets, log,
+                        % (brbe, self.be.bbport, local_bitbake, bbtargets, conf
+                        self.be.bbport, bitbake,)],
                         builddir, nowait=True)
 
         logger.debug('localhostbecontroller: Build launched, exiting. '
Comment 2 David Reyna 2017-10-06 03:35:48 UTC
Paul Eggleton has confirmed that the change in behaviour was intentional - bitbake will clear out any prefiles specified in a previous invocation even if that was the invocation that started the server. 

This behaviour wasn't well-defined and so it was working by accident beforehand.
Comment 3 David Reyna 2017-10-09 17:59:49 UTC
commit 3eb62b0d700a05c923c5cd96f0c3377202c1e0da
    
(Bitbake rev: fa767d85f19a7af92a44fe11fdfb38633009ad71)