[Buildbot-devel] slave can't find cvs because it's in a weird place...

Brian Warner warner-buildbot at lothar.com
Fri Jan 30 21:16:32 UTC 2004


(sorry, I'm answering my mail in reverse chronological order today :).

From: Ed Hartnett <ed at unidata.ucar.edu>

> I have a slave that can't find cvs.
> 
> f_sun_tip = QuickBuildFactory(repository, cvsmodule,
>                           configure="./configure",
>                           configureEnv={'PATH': '/opt/SUNWspro/bin:/usr/ccs/bin:/opt/gnu/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/bin',
>                                         'FC': 'f90', 'CXX':'/opt/SUNWspro/bin/CC',
>                                         'CPPFLAGS':'-Df2cFortran', 'F90':'/opt/SUNWspro/bin/f90',
>                                         'CC': '/opt/SUNWspro/bin/c89'},
>                           test="make test")
> 
> Here I am trying to set the PATH so that it includes the place where
> cvs can be found.

It's failing because the configureEnv= environment is only used for the
./configure step. In most autoconf setups, you only want to override the
initial choice of things like CFLAGS, because the configure script will add
to them. If you overrode them in later commands, you wouldn't get the
benefits of the additions and usually things break.

The best approach is to run the slave under the same environment that you (as
a human user who builds the package) would use. If you have a .cshrc or
.profile or something that establishes a PATH, have the build slave use the
same thing. If you have to source a script to set up environment variables
before you can build anything, have the slave do the same thing.

It may be useful to write a small shell script that takes a login account
from the defaults (no .profile, just logged in) to a functioning environment.
Then invoke twistd from the end of the script. My preference is to have a
brief Makefile which can invoke this script in the 'start' target. Then I use
a @reboot cron job to do a 'make -C slavedir start' and I know the slave will
be started in a consistent fashion every reboot. (if you use a cron job to
start it, be aware that cron usually provides a smaller environment to its
children.. you may not have the same PATH as you would in a login shell).

 -Brian




More information about the devel mailing list