[Buildbot-devel] splitting master.cfg

Mark Roddy markroddy at gmail.com
Thu Nov 13 04:26:32 UTC 2008


Short Answer: if you want to use 'buildbot reconf' and your master.cfg
references external module you have to use reload( ) for the external
modules updates to be in your configuration.

Long Answer:
This issue is specific to Python and the way it handles the importing
of modules, independent of buildbot itself.

When an import statement is executed the first thing python does is
check to see if the module is in memory, if so it references the
existing in memory module without looking for the module on disk, even
though there may be changes to the module on disk.

If the module is not in memory python looks for the file on disk.
When it finds the python module on it compares any existing pyc files
to the py file and does a byte compile of the py file if it is newer.

What happens when you rerun 'buildbot reconfig' is the existing python
process re-interprets master.cfg without shutting down so the module
you import is already in memory.  For this reason, python feels no
need to check the disk to see if the .py file has been updated.  So
what you end up having to do is call reload( ) to explicitly tell
Python to re-import the module from disk which will result in your
updates being present.

You might also want to check the documentation on the reload( )
function for a more technical/in depth explanation:
http://www.python.org/doc/2.5.2/lib/built-in-funcs.html

Phew.

-Mark

On Wed, Nov 12, 2008 at 10:58 PM, Vikki Finnan <vjf04 at hampshire.edu> wrote:
> I am working with a rather complicated build setup and my master.cfg
> is rather long. If I add a module and run an import command (import
> buildsteps), the setup will work fine for the first time.
>
> If I make changes to the buildsteps.py file and run buildbot reconfig,
> everything will work fine, but the changes that I made were not
> reflected.
>
> I can get this to work if I to something like:
>
> import buildsteps
> reload(buildsteps)
> from buildsteps import *
>
> but this causes all the builders to say 'config updated' and still
> seems to sometimes have the problem of changes not being reflected.
>
> What is happening? Is there a better way to split the master.cfg into
> separate files?
>
> Thanks,
> Vikki
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>




More information about the devel mailing list