summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-06-09 15:34:46 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-21 17:20:11 +0100
commit30613467d864130202d90e8460f7bbfa4db98397 (patch)
tree4c3ae8a547dc9201158dd2aa59b61343e6f6bacb /bitbake/lib/bb/cooker.py
parente9834ba34b7d4df8b0ecf1bec683684525a699b5 (diff)
downloadpoky-30613467d864130202d90e8460f7bbfa4db98397.tar.gz
bitbake: cooker: add BB_CMDLINE to enable access to UI command line with memres
In OpenEmbedded's buildhistory class we want access to the bitbake command line that launched the build, and up to now we were simply using sys.argv from within the event handler to get that. Unfortunately that doesn't work in memory resident mode, since the event handler is naturally executing within the server and thus will give you the command that launched the bitbake server which is much less interesting. Add a dynamic variable BB_CMDLINE to provide access to this, set from sys.argv within the UI process in updateToServer(). (Note that BB_CMDLINE isn't currently passed through to the worker, so this is only really readable from event handlers plus any explicit getVariable calls - in theory an observe-only UI could read it for example.) Part of the fix for [YOCTO #11634]. (Bitbake rev: 85596c9af3bb6407159c6c8de229cbe275aa74ea) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 7521ae878c..3c9e88cd24 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -192,6 +192,8 @@ class BBCooker:
192 bb.parse.__mtime_cache = {} 192 bb.parse.__mtime_cache = {}
193 bb.parse.BBHandler.cached_statements = {} 193 bb.parse.BBHandler.cached_statements = {}
194 194
195 self.ui_cmdline = None
196
195 self.initConfigurationData() 197 self.initConfigurationData()
196 198
197 # we log all events to a file if so directed 199 # we log all events to a file if so directed
@@ -366,6 +368,8 @@ class BBCooker:
366 if consolelog: 368 if consolelog:
367 self.data.setVar("BB_CONSOLELOG", consolelog) 369 self.data.setVar("BB_CONSOLELOG", consolelog)
368 370
371 self.data.setVar('BB_CMDLINE', self.ui_cmdline)
372
369 # 373 #
370 # Copy of the data store which has been expanded. 374 # Copy of the data store which has been expanded.
371 # Used for firing events and accessing variables where expansion needs to be accounted for 375 # Used for firing events and accessing variables where expansion needs to be accounted for
@@ -543,7 +547,8 @@ class BBCooker:
543 547
544 self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS")) 548 self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS"))
545 549
546 def updateConfigOpts(self, options, environment): 550 def updateConfigOpts(self, options, environment, cmdline):
551 self.ui_cmdline = cmdline
547 clean = True 552 clean = True
548 for o in options: 553 for o in options:
549 if o in ['prefile', 'postfile']: 554 if o in ['prefile', 'postfile']: