[Buildbot-devel] setting environment variables in build steps

Stefan Seefeld seefeld at sympatico.ca
Sat Dec 8 21:49:19 UTC 2007


Brian Warner wrote:
> On Fri, 23 Nov 2007 07:43:49 -0500
> Stefan Seefeld <seefeld at sympatico.ca> wrote:
> 
>> Axel Hecht wrote:
>>
>>> So, by default, buildername, buildnumber, branch, revision,  and
>>> slavename are set properties, see
>>> http://buildbot.net/trac/browser/buildbot/process/base.py#L258.
>> Yes, I have seen that list. (I'm a bit surprised to find such rather
>> domain-specific variables available in general. Not all builds rely on
>> revision control. Or may be they do...)
>>
>> I was actually thinking that a set of variables including workdir are
>> common enough to be useful to expose, too.
> 
> Yeah, I think having workdir in the per-BuildStep property list could be
> pretty useful. It's worthwhile to remember, however, that the master's
> concept of "workdir" is only relative: it does not know what directory the
> buildslave is running in, so it couldn't create an absolute pathname for the
> workdir, which is (I think) what you'd probably want. A relative pathname for
> the workdir doesn't sound too useful to me.

You are right, and I have been wondering how to use symbolic assignments
in a way to resolve to the desired values. This sounds pretty hard, at
least if this is to be solved as a generic issue.

> The full derivation is:
> 
>  buildslave's base directory (specified when the buildslave is created)
>  + builder directory (specified in master.cfg)
>  + workdir (specified by the BuildStep arguments)
> 
> and the buildmaster never learns of the buildslave's basedir.
> 
> 
> Remember, the workdir stuff is mostly there to be overridden in source
> checkout steps, to allow CVS to run from "." (and create or populate
> "build/") and then have all other steps run inside "build/". The supporting
> code is still in the "one project at a time" mindset, so having different
> steps running in different workdirs is probably not going to be as easy as
> you'd like.

OK. Well, the solution here might just be what you already suggest
elsewhere: integrate more logic into the build system, instead of into
the buildbot harness. It seems easy enough to integrate the definition
of environment variables into a Makefile, such that build sub-processes
see them.

Thanks,
		Stefan


-- 

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




More information about the devel mailing list