[Buildbot-devel] Some questions/problems running latest build bot source on Windows

Brian Warner warner-buildbot at lothar.com
Mon Nov 8 19:57:07 UTC 2004


> I'm attaching trial.log and _trial_temp/test.log. I'm happy to re-run or try
> patches to help narrow down or solve any of these failures.

Ok, I think I fixed the test_mailparse issues: the various Change-accepting
classes now take a "sep" argument, which defaults to "/". As long as the CVS
repository (or other VC server) is running with unix-style path-separators,
that default is correct. If you manage to get a CVS server running on a
windows box, then you'll need to flip it to "\\".

About half of the remaining failures boil down to an atomic-rename technique
that apparently doesn't work on windows:

            pickle.dump(self, open(tmpfilename, "w"), -1)
            os.rename(tmpfilename, filename)

The os.rename fails.. it would seem that windows wants you to delete the old
file first.

What's the windows idiom for this technique? I want to minimize the window
during which you could lose builder state. Worst case I can add an
'os.unlink(filename)' when running under windows (or if the os.rename raises
an OSError), but I'd prefer a better way.


I think the other half of the failures are from ShellCommands that can't be
run. This boils down to twisted's spawnProcess() running "python" to execute
a local test script (needed for a buildslave, but not by the buildmaster). I
think this has worked on other windows boxes. I'm guessing it's either a PATH
issue or something about the way python is being invoked. Should I maybe be
using sys.executable instead of a hardwired "python" string? I've attached a
patch for test_slavecommand.py .. let me know if it fixes anything?

cheers,
 -Brian


-------------- next part --------------
Index: buildbot/test/test_slavecommand.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slavecommand.py,v
retrieving revision 1.6
diff -u -r1.6 test_slavecommand.py
--- buildbot/test/test_slavecommand.py	14 Oct 2004 17:28:34 -0000	1.6
+++ buildbot/test/test_slavecommand.py	8 Nov 2004 19:56:51 -0000
@@ -11,7 +11,7 @@
     import sys
     startLogging(sys.stdout)
 
-import re, time
+import re, time, sys
 import signal
 
 from buildbot.slave.commands import SlaveShellCommand
@@ -115,7 +115,7 @@
         self.assertEquals(got, expected)
         
     def testShell1(self):
-        cmd = "python emit.py 0"
+        cmd = sys.executable + " emit.py 0"
         args = {'command': cmd, 'workdir': '.', 'timeout': 5}
         failed = self.doTest(SlaveShellCommand, args)
         self.failIf(failed)
@@ -124,7 +124,7 @@
         self.checkrc(0)
 
     def testShell2(self):
-        cmd = "python emit.py 1"
+        cmd = sys.executable + " emit.py 1"
         args = {'command': cmd, 'workdir': '.', 'timeout': 5}
         failed = self.doTest(SlaveShellCommand, args)
         self.failIf(failed)
@@ -133,7 +133,7 @@
         self.checkrc(1)
 
     def testShell3(self):
-        cmd = "python emit.py 0"
+        cmd = sys.executable + " emit.py 0"
         args = {'command': cmd, 'workdir': '.',
                 'env': {'EMIT_TEST': "envtest"}, 'timeout': 5}
         failed = self.doTest(SlaveShellCommand, args)
@@ -145,7 +145,7 @@
         self.checkrc(0)
 
     def testShell4(self):
-        cmd = "python emit.py 0"
+        cmd = sys.executable + " emit.py 0"
         args = {'command': cmd, 'workdir': "subdir", 'timeout': 5}
         failed = self.doTest(SlaveShellCommand, args)
         self.failIf(failed)


More information about the devel mailing list