[Buildbot-devel] setting environment variables in build steps

Stefan Seefeld seefeld at sympatico.ca
Thu Nov 22 18:53:51 UTC 2007


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)


Thanks,
		Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...




More information about the devel mailing list