[Buildbot-devel] Running Shell Commands

Brandon Philips brandon at ifup.org
Wed May 11 16:12:46 UTC 2005


Brian,


The odd thing is that it doesnt fail (exit code ok) if I run the command
by hand in the terminal and do not run distclean first.

2005/05/11 01:10 PDT [Broker,client] command argv is ['/bin/sh', '-c',
'make allmodconfig > .config']
2005/05/11 01:10 PDT [-] command finished with signal None, exit code 2
2005/05/11 01:10 PDT [-] SlaveBuilder.commandComplete
<buildbot.slave.commands.SlaveShellCommand instance at 0xb77b0d8c>
2005/05/11 01:10 PDT [Broker,client]  startCommand:shell [id 3]
2005/05/11 01:10 PDT [Broker,client]   command '['make']' in dir
/home/philips/buildbot-slave/linus-gw/build (timeout 10000 secs)
2005/05/11 01:10 PDT [Broker,client]   env is: {'LESS': '-R',
'LESSOPEN': '|lesspipe.sh %s', 'SSH_CLIENT': '192.168.1.101 49918 22',
'CVS_RSH': 'ssh', 'LOGNAME': 'philips', 'USER': 'philips', 'INPUTRC':
'/etc/inputrc', 'PATH':
'/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3.5-20050130',
'HOME': '/home/philips', 'PS1': '\\[\\033[01;32m\\]\\u@\\h
\\[\\033[01;34m\\]\\W \\$ \\[\\033[00m\\]', 'MAKEFLAGS': '',
'INFOPATH':
'/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/info',
'TERM': 'rxvt', 'SHELL': '/bin/sh', 'SHLVL': '1',
'CONFIG_PROTECT_MASK': '/etc/terminfo', 'EDITOR': '/bin/nano',
'MANPATH':
'/usr/share/man:/usr/local/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.15.92.0.2/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/man',
'MFLAGS': '', 'INFODIR': '/usr/share/info', 'GCC_SPECS': '', '_':
'/usr/bin/make', 'LS_COLORS':
'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.xcf=01;35:*.pcx=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.avi=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.mov=01;35:*.qt=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.mp3=00;36:*.wav=00;36:*.mid=00;36:*.midi=00;36:*.au=00;36:*.ogg=00;36:*.flac=00;36:*.aac=00;36:',
'SSH_TTY': '/dev/pts/2', 'OLDPWD': '/home/philips', 'HOSTNAME':
'localhost', 'MAKELEVEL': '1', 'PWD': '/home/philips/buildbot-slave',
'MAIL': '/var/mail/philips', 'SSH_CONNECTION': '192.168.1.101 49918
192.168.1.104 22', 'PAGER': '/usr/bin/less'}
2005/05/11 01:10 PDT [Broker,client] command argv is ['make']
2005/05/11 01:10 PDT [-] command finished with signal None, exit code 2
2005/05/11 01:10 PDT [-] SlaveBuilder.commandComplete
<buildbot.slave.commands.SlaveShellCommand instance at 0xb77b0aac>


Thanks for helping me out with this.

-Brandon

On 08:53 Wed 11 May     , Brian Warner wrote:
> > 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://buildbot.net/pipermail/devel/attachments/20050511/57e7ecd0/attachment.bin>


More information about the devel mailing list