diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-06-09 15:34:46 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 15:07:39 +0100 |
commit | 3d4c64fb9ff33a074328c37c7803c13ecc95f689 (patch) | |
tree | af8bce40e09d708f8fb0ccf0eb1c1b5f46183aa3 /bitbake/lib/bb | |
parent | 7520e2264892efcd3f544b469cf8821a412ed176 (diff) | |
download | poky-3d4c64fb9ff33a074328c37c7803c13ecc95f689.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: 8ad31a3eff5cfcb7b1c462578a582dafcbc426d4)
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')
-rw-r--r-- | bitbake/lib/bb/command.py | 3 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 7 | ||||
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index ab51d8e6cd..a919f58d24 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -310,7 +310,8 @@ class CommandsSync: | |||
310 | def updateConfig(self, command, params): | 310 | def updateConfig(self, command, params): |
311 | options = params[0] | 311 | options = params[0] |
312 | environment = params[1] | 312 | environment = params[1] |
313 | command.cooker.updateConfigOpts(options, environment) | 313 | cmdline = params[2] |
314 | command.cooker.updateConfigOpts(options, environment, cmdline) | ||
314 | updateConfig.needconfig = False | 315 | updateConfig.needconfig = False |
315 | 316 | ||
316 | def parseConfiguration(self, command, params): | 317 | def parseConfiguration(self, command, params): |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 1283136b60..45b5a61c46 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 |
@@ -360,6 +362,8 @@ class BBCooker: | |||
360 | if consolelog: | 362 | if consolelog: |
361 | self.data.setVar("BB_CONSOLELOG", consolelog) | 363 | self.data.setVar("BB_CONSOLELOG", consolelog) |
362 | 364 | ||
365 | self.data.setVar('BB_CMDLINE', self.ui_cmdline) | ||
366 | |||
363 | # | 367 | # |
364 | # Copy of the data store which has been expanded. | 368 | # Copy of the data store which has been expanded. |
365 | # Used for firing events and accessing variables where expansion needs to be accounted for | 369 | # Used for firing events and accessing variables where expansion needs to be accounted for |
@@ -539,7 +543,8 @@ class BBCooker: | |||
539 | 543 | ||
540 | self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS")) | 544 | self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS")) |
541 | 545 | ||
542 | def updateConfigOpts(self, options, environment): | 546 | def updateConfigOpts(self, options, environment, cmdline): |
547 | self.ui_cmdline = cmdline | ||
543 | clean = True | 548 | clean = True |
544 | for o in options: | 549 | for o in options: |
545 | if o in ['prefile', 'postfile']: | 550 | if o in ['prefile', 'postfile']: |
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 524a2cd3d0..3d3f133d2e 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -79,7 +79,7 @@ class ConfigParameters(object): | |||
79 | "prefile", "postfile", "tracking"]: | 79 | "prefile", "postfile", "tracking"]: |
80 | options[o] = getattr(self.options, o) | 80 | options[o] = getattr(self.options, o) |
81 | 81 | ||
82 | ret, error = server.runCommand(["updateConfig", options, environment]) | 82 | ret, error = server.runCommand(["updateConfig", options, environment, sys.argv]) |
83 | if error: | 83 | if error: |
84 | raise Exception("Unable to update the server configuration with local parameters: %s" % error) | 84 | raise Exception("Unable to update the server configuration with local parameters: %s" % error) |
85 | 85 | ||