[zorg] r283595 - Refactored to support extra options.
Galina Kistanova via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 7 13:45:49 PDT 2016
Author: gkistanova
Date: Fri Oct 7 15:45:49 2016
New Revision: 283595
URL: http://llvm.org/viewvc/llvm-project?rev=283595&view=rev
Log:
Refactored to support extra options.
Modified:
zorg/trunk/zorg/buildbot/commands/CmakeCommand.py
Modified: zorg/trunk/zorg/buildbot/commands/CmakeCommand.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/CmakeCommand.py?rev=283595&r1=283594&r2=283595&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/CmakeCommand.py (original)
+++ zorg/trunk/zorg/buildbot/commands/CmakeCommand.py Fri Oct 7 15:45:49 2016
@@ -5,6 +5,25 @@ from zorg.buildbot.util.helpers import s
class CmakeCommand(WarningCountingShellCommand):
@staticmethod
+ def sanitize_kwargs(kwargs):
+ # kwargs we could get and must not pass through
+ # to the buildstep.RemoteShellCommand constructor.
+ # Note: This is a workaround of the buildbot design issue,
+ # thus should be removed once the original issue gets fixed.
+ consume_kwargs = [
+ "jobs",
+ "loadaverage",
+ ]
+
+ sanitized_kwargs = kwargs.copy()
+ for k in consume_kwargs:
+ if k in sanitized_kwargs.keys():
+ del sanitized_kwargs[k]
+
+ return sanitized_kwargs
+
+
+ @staticmethod
def applyRequiredOptions(options, required):
# required is a list of tuples in form of (<opt name>, <opt value>),
# where all the values are properly formatted to terminate
@@ -129,11 +148,15 @@ class CmakeCommand(WarningCountingShellC
if self.path:
command += self.path
- # Note: We will remove all the empty items from the command at start.
- kwargs['command'] = command
+ # Remove here all the kwargs any of our LLVM buildbot command could consume.
+ # Note: We will remove all the empty items from the command at start, as we
+ # still didn't get yet WithProperties rendered.
+ sanitized_kwargs = self.sanitize_kwargs(kwargs)
+
+ sanitized_kwargs["command"] = command
# And upcall to let the base class do its work
- WarningCountingShellCommand.__init__(self, **kwargs)
+ WarningCountingShellCommand.__init__(self, **sanitized_kwargs)
self.addFactoryArguments(prefixCommand=prefixCommand,
options=self.options,
More information about the llvm-commits
mailing list