[Buildbot-devel] reconfig, import and exec

Robert Helmer robert at roberthelmer.com
Fri May 11 19:15:43 UTC 2007


Geoff Wedig wrote:
> I am having a problem with reconfig which I am hoping someone might give 
> me some ideas how to fix.
>
> We have a lot of builds for various projects.  To avoid having a huge 
> master.cfg, we have broken out portions (individual projects, slave 
> management, etc) into their own .py files.  This makes the master.cfg 
> very simple:
>
> import slave_config
>
> import project1
> import project2
> .
> .
> .
>
> This works great when starting up the buildbot.  It doesn't work so well 
> when doing reconfig.  This is because, as far as I can tell, the 
> reconfig is being done using exec (see loadConfig in master.py).  This 
> exec is executing the master (verified with print statements), but is 
> not re-importing any of the scripts (again, as far as I can tell), but 
> using the original versions.  This means it doesn't see any of the 
> changes in those files.
>
> So, I can't imagine no one else has tried this, but I haven't found 
> anything in the docs to help figure out how to get around it.  Can 
> anyone help?
>   

This seems to work:

import mozbuild
reload(mozbuild)

Where "mozbuild" has our specific code (e.g. subclasses of Steps).

On the general point of splitting out the config files, I really like 
the idea. There's a feature request open to have buildbot support this 
directly:
http://buildbot.net/trac/ticket/14




More information about the devel mailing list