[tahoe-lafs-trac-stream] [tahoe-lafs] #1334: can't test on buildslaves that we don't depend on pywin32
tahoe-lafs
trac at tahoe-lafs.org
Sat Jul 23 17:46:36 PDT 2011
#1334: can't test on buildslaves that we don't depend on pywin32
------------------------------------+--------------------------------------
Reporter: davidsarah | Owner:
Type: defect | Status: new
Priority: major | Milestone: 1.9.0
Component: dev-infrastructure | Version: 1.8.1
Resolution: | Keywords: buildbot windows pywin32
Launchpad Bug: |
------------------------------------+--------------------------------------
Changes (by davidsarah):
* keywords: buildbot windows pywin32 review-needed => buildbot windows
pywin32
Comment:
I no longer favour the approach used in the patch of blocking loading of
pywin32 in {{{allmydata/__init__.py}}}. It's too ugly and intrusive to
install an import hook just to avoid loading a library that we don't want
to have to care about any more.
I have suggested to our win32 buildslave operators, Freestorm and Dcoder,
the following changes to their set up, that should achieve a similar
effect of only allowing pywin32 to be used by the initial buildslave
process:
----
Assume that the Python directory is {{{C:\Python27}}} (if not then adjust
the paths below). Stop the buildslave, then do:
{{{
ren C:\Python27\Lib\site-packages\pywin32.pth pywin32.pth.disabled
}}}
Edit {{{C:\Python27\Scripts\buildbot}}} (using an editor that can handle
Unix line endings). Add the following lines just after the {{{!#}}} line:
{{{
import os, sys
site = os.path.join(os.path.basename(sys.executable), 'Lib', 'site-
packages')
sys.path += [os.path.join(site, d) for d in
['win32', 'win32\\lib', 'Pythonwin']]
}}}
Similarly, in {{{C:\Python27\Scripts\buildbot_service.py}}}, after
'{{{import threading}}}' but before '{{{import pywintypes}}}', add:
{{{
site = os.path.join(os.path.basename(sys.executable), 'Lib', 'site-
packages')
sys.path += [os.path.join(site, d) for d in
['win32', 'win32\\lib', 'Pythonwin']]
}}}
(i.e. the same thing without the '{{{import os, sys}}}').
The names of the {{{buildbot}}} and {{{buildbot_service.py}}} scripts
might be different depending on the version of Buildbot. (There are some
references to a '{{{buildslave}}}' script in the docs which wasn't present
in my copy, but if it exists in yours then it will need a similar
modification.) You may want to back up the old versions of the scripts
before editing them.
To check that pywin32 can't be imported by code other than buildbot, do:
{{{
python -c "import win32api; print win32api"
}}}
That should give an {{{ImportError}}}. Now restart the buildslave and
check that it still works.
----
Freestorm and Dcoder haven't got back to me yet.
--
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1334#comment:14>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list