[pypy-svn] r35680 - in pypy/dist/pypy/tool/build: . bin builds test
guido at codespeak.net
guido at codespeak.net
Wed Dec 13 16:26:59 CET 2006
Author: guido
Date: Wed Dec 13 16:26:57 2006
New Revision: 35680
Removed:
pypy/dist/pypy/tool/build/builds/
Modified:
pypy/dist/pypy/tool/build/ (props changed)
pypy/dist/pypy/tool/build/bin/client
pypy/dist/pypy/tool/build/config.py
pypy/dist/pypy/tool/build/test/test_pypybuilder.py
Log:
Some cleanups (e.g. builds is now removed and added to svn:ignore), added
checker for svn url (to not have the clients do checkouts of other stuff),
moved compilation to a function (should become sandboxed later to allow
importing from a freshly updated pypy checkout).
Modified: pypy/dist/pypy/tool/build/bin/client
==============================================================================
--- pypy/dist/pypy/tool/build/bin/client (original)
+++ pypy/dist/pypy/tool/build/bin/client Wed Dec 13 16:26:57 2006
@@ -5,7 +5,6 @@
import random
import traceback
from pypy.tool.build import config as buildconfig
-from pypy.interpreter.error import OperationError
from py.execnet import SshGateway, PopenGateway
from pypy.tool.build.client import init, zip_result, OutputBuffer
@@ -13,6 +12,7 @@
from pypy.config.config import to_optparse, Config
from pypy.config import pypyoption
+from pypy.interpreter.error import OperationError
from pypy.translator.goal import targetpypystandalone
from pypy.translator.driver import TranslationDriver
from pypy.tool.udir import udir
@@ -27,6 +27,12 @@
path=buildconfig.path,
port=buildconfig.port)
+def compile(config):
+ driver = TranslationDriver.from_targetspec(
+ targetpypystandalone.__dict__, config=config,
+ default_goal='compile')
+ driver.proceed(['compile'])
+
print channel.receive() # welcome message
try:
try:
@@ -50,8 +56,13 @@
)
accepting = True
for checker in buildconfig.client_checkers:
- if not checker(request.sysinfo, request.compileinfo):
- print 'request refused by checker', checker.func_name
+ if not checker(request):
+ if hasattr(checker, 'im_func'):
+ name = '%s.%s' % (checker.im_class.__name__,
+ checker.im_func.func_name)
+ else:
+ name = checer.func_name
+ print 'request refused by checker', name
accepting = False
break
channel.send(accepting)
@@ -67,16 +78,11 @@
sys.stdout = buffer
sys.stderr = buffer
exception_occurred = False
+
try:
try:
- driver = TranslationDriver.from_targetspec(
- targetpypystandalone.__dict__, config=config,
- default_goal='compile')
- driver.proceed(['compile'])
+ compile(config)
except Exception, e:
- if isinstance(e, OperationError):
- print dir(e)
- print repr(e.msg)
exception_occurred = True
exc, e, tb = sys.exc_info()
print '=' * 79
Modified: pypy/dist/pypy/tool/build/config.py
==============================================================================
--- pypy/dist/pypy/tool/build/config.py (original)
+++ pypy/dist/pypy/tool/build/config.py Wed Dec 13 16:26:57 2006
@@ -33,12 +33,23 @@
# settings for the tests
testpath = [str(py.magic.autopath().dirpath().dirpath())]
-# when considering a compile job, the checkers below will be called (args
-# sysinfo, compileinfo), if one of them returns False the compilation will
+# this var is only used below
+svnroot = 'http://codespeak.net/svn/pypy'
+
+# when considering a compile job, the checkers below will be called (with
+# request as only arg), if one of them returns False the compilation will
# not be accepted
-client_checkers = []
+def check_svnroot(req):
+ if not req.svnurl.startswith(svnroot):
+ return False
+ return True
+
+client_checkers = [check_svnroot]
# function to turn SVN paths into full URLs
def svnpath_to_url(p):
- return 'http://codespeak.net/svn/pypy/%s' % (p,)
+ root = svnroot
+ if root.endswith('/'):
+ root = root[:-1]
+ return '%s/%s' % (root, p)
Modified: pypy/dist/pypy/tool/build/test/test_pypybuilder.py
==============================================================================
--- pypy/dist/pypy/tool/build/test/test_pypybuilder.py (original)
+++ pypy/dist/pypy/tool/build/test/test_pypybuilder.py Wed Dec 13 16:26:57 2006
@@ -23,6 +23,8 @@
if not py.test.pypybuilder_option.functional:
py.test.skip('skipping functional test, use --functional to run it')
+ config.checkers = []
+
# XXX this one is a bit messy, it's a quick functional test for the whole
# system, but for instance contains time.sleep()s to make sure all threads
# get the time to perform tasks and such...
More information about the Pypy-commit
mailing list