[Buildbot-devel] setting environment variables in build steps

Axel Hecht l10n.moz at googlemail.com
Thu Nov 22 21:54:04 UTC 2007


2007/11/22, Stefan Seefeld <seefeld at sympatico.ca>:
> Axel Hecht wrote:
>
> >> * As a workaround, I tried to use the equivalent of
> >>   'make check ALF_LIBRARY_PATH=`pwd`'. This works, if I pass the command
> >> as a string, to shell.Test(). If I pass it as a token-list, `pwd` gets
> >> passed verbatim, i.e. isn't evaluated during command invocation by the
> >> shell. I'm not sure what happens. While I'm not sure which of the two
> >> ways is considered correct, I think everybody agrees that both ways
> >> (strings, token-lists) should result in the same command issued on the
> >> slave.
> >
> > This is http://buildbot.net/trac/ticket/126, and the patch there works for us.
>
> I'm not sure we are indeed talking about the same issue here. Let's
> consider an example:
>
> shell.Test(command='make check ALF_LIBRARY_PATH=`pwd`/lib')
>
> will work fine; `pwd` gets evaluated by the shell that this build step
> runs in. In contrast,
>
> shell.Test(command=['make', 'check', 'ALF_LIBRARY_PATH=`pwd`/lib'])
>
> appears to fail, since the '`pwd`' isn't evaluated by the shell, but
> passed verbatim through to 'make' (or rather, the environment as seen by
> 'make' contains the ALF_LIBRARY_PATH variable with the un-evaluated
> string "`pwd`/lib".
>
> I'm aware of these two relevant issues:
>
> a) environment variables aren't passed through when passing BuildStep
> instances to factory.addStep (#126)
>
> b) WithProperties not being available to environment variables (#52)
>

Hrm. Right, reading helps. backticks is shell expansion stuff, that
should only work if you do

command = "make check ALF_LIBRARY_PATH=`pwd`/lib"

The fact that the list syntax doesn't go through the shell is actually
documented, http://buildbot.net/repos/release/docs/buildbot.html#ShellCommand.
The wording sounds a bit "the other way around", as you really *want*
the shell to kick in.

I guess you had to unbitrot the patch in ticket 52 to get it working.
Or subclass, with an unbitrotted version. If you do, attach a new
patch? ;-)

Schöne Grüße aus Wilmersdorf

Axel




More information about the devel mailing list