[Buildbot-devel] Running Shell Commands
Brian Warner
warner-buildbot at lothar.com
Wed May 11 15:53:19 UTC 2005
> On a related note I ran the command as
>
> /bin/sh -c "(make allmodconfig > .config)"
>
> in the workdir and all went well. I am not entirely sure what is going
> on where to debug it the way in which a ShellCommand gets executed is
> hard to follow.
Weird.. I wonder why that makes a difference. When you tried "make
allmodconfig > .config" (without the parens), did it seem like 'make' was
treating .config as a target? From the error message, it almost seems like it
was including .config as a Makefile, and since the contents were corrupted,
the include failed. Perhaps an "rm -f .config" beforehand?
Try adding the following patch to buildbot/slave/commands.py:
--- orig/buildbot/slave/commands.py
+++ mod/buildbot/slave/commands.py
@@ -170,7 +170,7 @@
argv = self.command
# self.stdin is handled in ShellCommandPP.connectionMade
-
+ log.msg("command argv is", argv)
self.process = reactor.spawnProcess(self.pp, argv[0], argv,
self.environ,
self.workdir,
Then look in the buildslave log when it runs the command. That should show
you the exact argv array being used (which, honestly, ShellCommand should
have been logging in the first place.. I'll go fix that). Make sure that
"make foo > .config" is turned into ["/bin/sh", "-c", "make foo > .config"].
I'll see if I can add a unit test that verifies this sort of thing works
correctly.
cheers,
-Brian
More information about the devel
mailing list