[Buildbot-devel] Buildbot try error

Brian Warner warner-buildbot at lothar.com
Fri Sep 29 08:22:38 UTC 2006


> I run 'buildbot try -c pb --username=ben --passwd=********* --m
> aster=linux9:5900 --vc=cvs --builder="Seneca Test Linux"' inside of the
> root of my source tree.

FYI, you can put all of those arguments into a .buildbot/options file so you
don't have to keep typing them over and over. I think there's a user's manual
section on this.. if not, please file a docs bug.

>  File "/usr/lib/python2.3/site-packages/buildbot/scripts/tryclient.py",
> line 215, in getTopdir
>    if os.path.exists(os.path.join(here, topfile)):
>  File "/usr/lib/python2.3/posixpath.py", line 60, in join
>    if b.startswith('/'):
> exceptions.AttributeError: 'NoneType' object has no attribute 'startswith'

Actually, I think it has to do with the 'topdir', rather than the 'trydir'.

The issue is this: 'buildbot try' must be able to figure out what directory
represents the top of your local workspace. Some VC systems can do this for
themselves, but CVS and SVN need help because they work on a directory at a
time rather than a whole tree. 'buildbot try' needs to know this 'topdir' so
it can run the right 'diff' command from that directory.

There are two ways to help 'buildbot try' figure this out. One way is to use
--try-topdir to set it explicitly. The other way is to set --try-topfile to
the name of a file that will only be found in the top of your tree (perhaps
ChangeLog or configure.in). When you use --try-topfile, 'buildbot try' will
crawl upwards from your current directory until it finds a file with that
name, and the directory where it files the 'topfile' is then used as the
'topdir'.

In practice, you'd use --try-topdir in a per-tree options file. For example,
I have a number of buildbot trees in use at the same time, one per feature or
bug. At this very moment, I have the following in my
~/stuff/Projects/BuildBot/trees/ directory:

 trees/TRUNK
 trees/c-steps
 trees/misc
 trees/monotone
 trees/p4strip-1555985
 trees/sharedping
 trees/svnpoller
 trees/tinderbox-1546659
 trees/waterfallrefresh
 trees/win-py2exe-1401121

If I were to use the --try-topdir approach (and if these weren't Darcs trees
which don't need topdirs anyways), I'd have something like the following:

 trees/monotone/.buildbot/options:
  try_connect = "pb"
  try_builders = [builders]
  try_vc = "cvs"
  try_host="linux9:5900"
  try_username = "warner"
  try_passwd="etc"
  try_topdir = "~/.../trees/monotone"

 trees/svnpoller/.buildbot/options:
  try_connect = "pb"
  try_builders = [builders]
  try_vc = "cvs"
  try_host="linux9:5900"
  try_username = "warner"
  try_passwd="etc"
  try_topdir = "~/.../trees/svnpoller"

and so on. With all those options in place, a bare 'buildbot try' should do
everything.

If I wanted this to be more general, I could use the buildbot's ChangeLog as
a topfile, and then have just a single .buildbot/options file in my
~/stuff/Projects/BuildBot/trees/ directory:

 trees/.buildbot/options:
  try_connect = "pb"
  try_builders = [builders]
  try_vc = "cvs"
  try_host="linux9:5900"
  try_username = "warner"
  try_passwd="etc"
  try_topfile = "ChangeLog"

That way, no matter what tree I was sitting in, when I do 'buildbot try', it
will find that shared all-buildbot-trees-wide options file, then look upwards
from whatever directory I happen to be sitting in (say
monotone/buildbot/changes/) until it found monotone/ChangeLog, conclude that
my topdir is monotone/, and then do the cvs diff operation from there.

My guess is that the exception you encountered was the result of using a
--try-vc which needed to know its topdir (i.e., CVS) but not providing either
a --try-topdir or a --try-topfile. The lack of --try-topdir caused it to
attempt the topfile-finding approach, while the lack of a --try-topfile meant
it was looking for a file named with the None object, and the various
pathname-joining functions couldn't cope with a None there.

So, in short, take a look at the try section[1] of the manual, and add a
--try-topfile argument. On the code side, we probably need a check for this
case so it can emit a more useful error message than the one that you
encountered.

cheers,
 -Brian

[1]: http://buildbot.sourceforge.net/manual-0.7.4.html#try




More information about the devel mailing list