예제 #1
0
def core_factory(repourl, usedocs=False, configure=None, audit=False,
                 clean=False, nocheck = False, configure_opts=None):
    f = factory.BuildFactory()
    mode = "update"
    if clean:
        #f.addStep(MakeWritable, workdir='.')
        f.addStep(shell.ShellCommand(command = ["chmod", "-R", "+w", "."], workdir='.'))
        mode = "clobber"
    f.addStep(source.Git(repourl=repourl, mode=mode))
    if audit:
        f.addStep(shell.ShellCommand(command = ["python", 'audit.py'], workdir='build/xapian-maintainer-tools'))
        f.addStep(shell.ShellCommand(command = ["chmod", '644', 'copyright.csv', 'fixmes.csv'], workdir='build/xapian-maintainer-tools'))
        f.addStep(shell.ShellCommand(command = ["mv", 'copyright.csv', 'fixmes.csv', '/var/www/'], workdir='build/xapian-maintainer-tools'))

    f.addStep(Bootstrap())
    if configure:
        f.addStep(shell.Configure(command=configure))
    else:
        if configure_opts is None:
            configure_opts = []
        if not usedocs:
            configure_opts.append("--disable-documentation")
        if configure_opts:
            f.addStep(shell.Configure(command=["sh", "configure"] + configure_opts))
        else:
            f.addStep(shell.Configure())

    f.addStep(shell.Compile())
    if not nocheck:
        f.addStep(shell.Test(name="check", command=["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="]))
    return f
예제 #2
0
def gen_git_updated_lcov_factory(repourl, configure_opts=[]):
    """
    Factory for doing build from git master, without cleaning first, and using
    lcov to generate a coverage report.  This one is much more expensive, so
    should be run with a higher stable time.
    """
    f = factory.BuildFactory()
    f.addStep(source.Git(repourl=repourl, mode="update"))
    f.addStep(Bootstrap())
    f.addStep(
        shell.Configure(command=[
            "sh", "configure", "--enable-maintainer-mode", "--disable-shared",
            "--disable-documentation", "CXXFLAGS=-O0 --coverage", "VALGRIND=",
            "CCACHE_DISABLE=1"
        ] + configure_opts,
                        workdir="build/xapian-core"))
    f.addStep(shell.Compile(workdir="build/xapian-core"))
    f.addStep(
        shell.ShellCommand(
            command=["make", "coverage-check", "GENHTML_ARGS=--html-gzip"],
            workdir="build/xapian-core",
            haltOnFailure=True))
    f.addStep(
        shell.ShellCommand(command=["chmod", "-R", "a+rX", "lcov"],
                           workdir="build/xapian-core",
                           haltOnFailure=True))
    f.addStep(
        shell.ShellCommand(
            command=
            'NOW=`date -u +%Y-%m-%d`; cp -a lcov/. /var/www/"$NOW" && ln -sfT "$NOW" /var/www/latest',
            workdir="build/xapian-core",
            haltOnFailure=True))

    return f
예제 #3
0
def gen_git_clean_dist_factory(repourl):
    """
    Factory for doing build from a clean checkout of git master.  This build also
    performs a "make distcheck", so should catch problems with files which have
    been missed from the distribution.  This one is much more expensive, so
    should be run with a higher stable time.
    """
    f = factory.BuildFactory()
    f.addStep(MakeWritable, workdir='.')
    f.addStep(source.Git(repourl=repourl, mode="clobber"))
    f.addStep(Bootstrap())
    f.addStep(step.Configure, command = ["xapian-maintainer-tools/buildbot/scripts/configure_with_prefix.sh"])
    extraargs = (
        "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="
    )
    f.addStep(step.Compile, command = ["make",] + extraargs)
    # Don't bother running check as a separate step - all the checks will be
    # done by distcheck, anyway.  (Running it as a separate step _does_ check
    # that the tests work in a non-VPATH build, but this is tested by other
    # factories, anyway.)
    #f.addStep(step.Test, name="check", command = ["make", "check"] + extraargs)
    f.addStep(step.Test, name="distcheck", command = ["make", "distcheck"] + extraargs, workdir='build/xapian-core')
    f.addStep(step.Test, name="distcheck", command = ["make", "distcheck"] + extraargs, workdir='build/xapian-applications/omega')

    # Have to install the core for distcheck to pass on the bindings.
    f.addStep(step.Test, name="install", command = ["make", "install"] + extraargs, workdir='build/xapian-core')
    f.addStep(step.Test, name="distcheck", command = ["make", "distcheck"] + extraargs, workdir='build/xapian-bindings')
    return f
예제 #4
0
def gen_git_debug_updated_factory(repourl, opts, nocheck=False):
    """
    Make a factory for doing a debug build from git master, but without cleaning
    first.  This build is intended to catch commonly made mistakes quickly.
    """
    f = factory.BuildFactory()
    f.addStep(source.Git(repourl=repourl, mode="update"))
    f.addStep(Bootstrap())
    opts.append("--disable-documentation")
    f.addStep(shell.Configure(command = ["sh", "configure", ] + opts))
    f.addStep(shell.Compile())
    if not nocheck:
        f.addStep(shell.Test(name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain", "VALGRIND="]))
    return f
예제 #5
0
def gen_git_updated_valgrind_factory(repourl, configure_opts=[]):
    """
    Factory for doing build from git master, without cleaning first, and using
    valgrind to check.  This one is much more expensive, so should be run with
    a higher stable time.
    """
    f = factory.BuildFactory()
    f.addStep(source.Git(repourl=repourl, mode="update"))
    f.addStep(Bootstrap())
    configure_opts.append("--disable-documentation")
    f.addStep(shell.Configure(command = ["sh", "configure", "CXXFLAGS=-O0 -g"] + configure_opts))
    f.addStep(shell.Compile())

    f.addStep(shell.Test(name="check", command = ["make", "check", "XAPIAN_TESTSUITE_OUTPUT=plain"], workdir='build/xapian-core'))

    return f
예제 #6
0
 def testAllSteps(self):
     # make sure that steps can be created from the factories that they
     # return
     for s in (
             dummy.Dummy(),
             dummy.FailingDummy(),
             dummy.RemoteDummy(),
             maxq.MaxQ("testdir"),
             python.BuildEPYDoc(),
             python.PyFlakes(),
             python_twisted.HLint(),
             python_twisted.Trial(testpath=None, tests="tests"),
             python_twisted.ProcessDocs(),
             python_twisted.BuildDebs(),
             python_twisted.RemovePYCs(),
             shell.ShellCommand(),
             shell.TreeSize(),
             shell.Configure(),
             shell.Compile(),
             shell.Test(),
             source.CVS("cvsroot", "module"),
             source.SVN("svnurl"),
             source.Darcs("repourl"),
             source.Git("repourl"),
             source.Arch("url", "version"),
             source.Bazaar("url", "version", "archive"),
             source.Bzr("repourl"),
             source.Mercurial("repourl"),
             source.P4("p4base"),
             source.P4Sync(1234, "p4user", "passwd", "client", mode="copy"),
             source.Monotone("server", "branch"),
             transfer.FileUpload("src", "dest"),
             transfer.FileDownload("src", "dest"),
     ):
         try:
             self._loop(s)
         except:
             print "error checking %s" % s
             raise
예제 #7
0
def createPoclFactory(environ={},
                      repository='https://github.com/pocl/pocl.git',
                      branch='master',
                      buildICD=True,
                      llvm_dir='/usr/',
                      icd_dir='/usr/',
                      tests_dir='',
                      config_opts='',
                      pedantic=True):
    """
	Create a buildbot factory object that builds pocl.
	
	environ		Dictionary:   The environment variables to append to the build. PATH and
				LD_LIBRARY_PATH will be added from llvm_dir (if given).
	repository	String: the repo to build from. defaults to pocl on github
	branch		String: the branch in 'repository' to build from. default to master
	buildICD	Bool:	if false, the ICD extension is not built.
	llvm_dir	String: LLVM installation dir. I.e. without the 'bin/' or 'lib/'.
	icd_dir		String: ICD loader installation dir. We expect here to be a ICD loader that
				understand the OCL_ICD_VENDORS parameter, i.e. ocl-icd or patched
				Khronos loader.
	tests_dir	String: Path where the extenral testsuite packages can be copied from.
				('cp' is used, so they need to be on the same filesystem).
				NOTE: currently only a placeholder - not tested on the public buildbot
	config_opts	String: extra options to pass to ./configure
	"""

    environ['PATH'] = llvm_dir + "/bin/:${PATH}"
    environ['LD_LIBRARY_PATH'] = llvm_dir + "/lib/:${LD_LIBRARY_PATH}"

    f = factory.BuildFactory()
    f.addStep(
        source.Git(
            repourl=repository,
            #mode='update',
            #rm -rf the build tree. Have this only when changing
            #branches during releases
            mode='clobber',
            branch=branch))

    f.addStep(
        ShellCommand(command=["./autogen.sh"],
                     haltOnFailure=True,
                     name="autoconfig",
                     env=environ,
                     description="autoconfiging",
                     descriptionDone="autoconf"))

    f.addStep(
        ShellCommand(
            haltOnFailure=True,
            command=[
                "cp", "-u", tests_dir + AMD_test_pkg,
                "examples/AMD/" + AMD_test_pkg
            ],
            name="copy AMD",
            description="copying",
            descriptionDone="copied AMD",
            #kludge around 'cp' always complaining if source is missing
            decodeRC={
                0: SUCCESS,
                1: SUCCESS
            }))
    f.addStep(
        ShellCommand(haltOnFailure=False,
                     command=[
                         "cp", "-u", tests_dir + ViennaCL_test_pkg,
                         "examples/ViennaCL/" + ViennaCL_test_pkg
                     ],
                     name="copy ViennaCL",
                     description="copying",
                     descriptionDone="copied ViennaCL",
                     decodeRC={
                         0: SUCCESS,
                         1: SUCCESS
                     }))

    configOpts = config_opts.split(' ')
    if pedantic == True:
        configOpts = configOpts + ['--enable-pedantic']
    if buildICD == False:
        configOpts = configOpts + ['--disable-icd']

    f.addStep(
        ShellCommand(command=["./configure"] + configOpts,
                     haltOnFailure=True,
                     name="configure",
                     env=environ,
                     description="configureing",
                     descriptionDone="configure"))
    f.addStep(Compile(env=environ))

    #enable this later
    ttacheck = False
    if ttacheck:
        f.addStep(
            ShellCommand(command=["./tools/scripts/run_tta_tests"],
                         haltOnFailure=True,
                         name="checks",
                         env=environ,
                         description="testing",
                         descriptionDone="tests",
                         logfiles={"test.log": "tests/testsuite.log"},
                         timeout=60 * 60))
    else:
        f.addStep(
            ShellCommand(
                command=["make", "check"],
                #for beagle, contiunu to clean it up
                #haltOnFailure=True,
                name="checks",
                env=environ,
                description="testing",
                descriptionDone="tests",
                logfiles={"test.log": "tests/testsuite.log"},
                #blas3 alone takes 15-20 min.
                timeout=60 * 60))

    #Keep this here for a reference, if we want to record the benchmarking progress at some point in time
    #Benchmark only the vanilla pocl
    #if do_benchmark and baseurl=='lp:' and defaultbranch=='pocl':
    #	f.addStep(
    #		ShellCommand(
    #			haltOnFailure=True,
    #			env=environ,
    #			command=['./tools/scripts/benchmark.py', '--lightweight', '-o', 'benchmark_log.txt' ],
    #			logfiles = {'log.txt': 'benchmark_log.txt'},
    #			name = 'benchmark',
    #			description='benchmarking',
    #			descriptionDone='benchmarked',
    #			# 4hour timeout - PPC runs for a *long* time
    #			timeout=60*60*4))
    #	f.addStep(
    #		ShellCommand(
    #			command=[
    #				'scp',
    #				'benchmark_log.txt',
    #				WithProperties("marvin:/var/www/pocl_benchmarks/benchmark-"+processor+"-r%(got_revision)s.txt")],
    #			name = 'copy benchmark',
    #			description='copying',
    #			descriptionDone='copied'))

    return f