def getLibcxxWholeTree(f, src_root): llvm_path = src_root libcxx_path = properties.WithProperties( '%(builddir)s/llvm/projects/libcxx') libcxxabi_path = properties.WithProperties( '%(builddir)s/llvm/projects/libcxxabi') libunwind_path = properties.WithProperties( '%(builddir)s/llvm/projects/libunwind') f = phased_builder_utils.SVNCleanupStep(f, llvm_path) f.addStep(SVN(name='svn-llvm', mode='full', baseURL='http://llvm.org/svn/llvm-project/llvm/', defaultBranch='trunk', workdir=llvm_path)) f.addStep(SVN(name='svn-libcxx', mode='full', baseURL='http://llvm.org/svn/llvm-project/libcxx/', defaultBranch='trunk', workdir=libcxx_path)) f.addStep(SVN(name='svn-libcxxabi', mode='full', baseURL='http://llvm.org/svn/llvm-project/libcxxabi/', defaultBranch='trunk', workdir=libcxxabi_path)) f.addStep(SVN(name='svn-libunwind', mode='full', baseURL='http://llvm.org/svn/llvm-project/libunwind/', defaultBranch='trunk', workdir=libunwind_path)) return f
def checkout(self, workdir, url, branch): repo_url = '%s/%s' % (url, branch) self.add_step(SVN( mode='full', method='clean', repourl=repo_url, workdir=workdir))
def __init__(self, svnurl, configure=None, configureEnv={}, compile="make all", test="make check"): source = SVN(svnurl=svnurl, mode="incremental") GNUAutoconf.__init__(self, source, configure=configure, configureEnv=configureEnv, compile=compile, test=test)
def __init__(self, svnurl, configure=None, configureEnv=None, compile="make all", test="make check"): if configureEnv is None: configureEnv = {} source = SVN(svnurl=svnurl, mode="incremental") super().__init__(source, configure=configure, configureEnv=configureEnv, compile=compile, test=test)
def addRepository(self, factory, project=None, repository=None, branch=None, **kwargs): kwargs = dict(kwargs) branch = branch or "trunk" kwargs.update( dict( baseURL=repository, defaultBranch=branch, username=self.username, password=self.password, codebase=project, haltOnFailure=True, flunkOnFailure=True, )) factory.addStep(SVN(**kwargs))
def AddLNTTestsToFactory(f, nt_flags, cc_path, cxx_path, **kwargs): """ Add the buildbot steps necessary to run an LNT driven test of a compiler. This assumes at a minimum that the factory has already been set up to contain a builddir property which points at the full path to the build directory. """ parallel = kwargs.pop('parallel', False) jobs = kwargs.pop('jobs', '$(jobs)s') submitURL = kwargs.pop('submitURL', None) package_cache = kwargs.pop('package_cache', 'http://lab.llvm.org/packages') testerName = kwargs.pop('testerName', None) reportBuildslave = kwargs.pop('reportBuildslave', True) env = kwargs.pop('env', {}) # Create variables to refer to the compiler-under-test. # # We assume any relative paths are relative to the build directory (which # prior steps will have presumably populated with a compiler). cc_path = WithProperties(os.path.join('%(builddir)s', cc_path)) cxx_path = WithProperties(os.path.join('%(builddir)s', cxx_path)) # Add --liblto-path if necessary. We assume it will be in a lib directory # adjacent to cc_path. # # FIXME: This is currently only going to work on Darwin. if '-flto' in nt_flags: base_directory = os.path.dirname(os.path.dirname(cc_path)) nt_flags.extend([ '--liblto-path', WithProperties( os.path.join('%(builddir)s', base_directory, 'lib', 'libLTO.dylib')) ]) # Get the LNT sources. f.addStep( SVN(name='pull.lnt', mode='incremental', method='fresh', baseURL='http://llvm.org/svn/llvm-project/lnt/', defaultBranch='trunk', workdir='lnt', alwaysUseLatest=True)) # Get the LLVM test-suite sources. f.addStep( SVN(name='pull.test-suite', mode='incremental', method='fresh', baseURL='http://llvm.org/svn/llvm-project/test-suite/', defaultBranch='trunk', workdir='test-suite', alwaysUseLatest=False)) # Create the LNT virtual env. f.addStep( buildbot.steps.shell.ShellCommand( name='venv.lnt.clean', command=['rm', '-rf', 'lnt.venv'], haltOnFailure=True, description=['clean', 'LNT', 'venv'], workdir=WithProperties('%(builddir)s'))) f.addStep( buildbot.steps.shell.ShellCommand( name='venv.lnt.create', command=['virtualenv', 'lnt.venv'], haltOnFailure=True, description=['create', 'LNT', 'venv'], workdir=WithProperties('%(builddir)s'), env={'PATH': '${PATH}:/usr/local/bin'})) f.addStep( buildbot.steps.shell.ShellCommand( name='venv.lnt.install', haltOnFailure=True, command=[ WithProperties('%(builddir)s/lnt.venv/bin/pip'), 'install', '--no-index', '--find-links', package_cache, '-e', '.' ], description=['install', 'LNT'], workdir='lnt', env={'ARCHFLAGS': '-arch i386 -arch x86_64'})) # Clean up the sandbox dir. f.addStep( buildbot.steps.shell.ShellCommand( name='lnt.nightly-test.clean', command=['rm', '-rf', 'nt'], haltOnFailure=True, description=['clean', 'LNT', 'sandbox'], workdir='tests')) if reportBuildslave: reportName = '%(slavename)s' if testerName: reportName += '__' + testerName reportName = WithProperties(reportName) else: reportName = testerName # Run the nightly test. args = [ WithProperties('%(builddir)s/lnt.venv/bin/python'), WithProperties('%(builddir)s/lnt.venv/bin/lnt'), 'runtest', 'nt', '--verbose' ] # Only submit if a URL has been specified if submitURL is not None: if type(submitURL) != type([]): submitURL = [submitURL] for url in submitURL: args.extend(['--submit', url]) args.extend([ '--commit=1', '--sandbox', 'nt', '--no-timestamp', '--cc', cc_path, '--cxx', cxx_path, '--without-llvm', '--test-suite', WithProperties('%(builddir)s/test-suite'), '--no-machdep-info', reportName ]) if parallel: args.extend(['-j', WithProperties(jobs)]) args.extend(nt_flags) f.addStep( zorg.buildbot.commands.LitTestCommand.LitTestCommand( name='lnt.nightly-test', command=args, haltOnFailure=True, description=['nightly test'], workdir='tests', logfiles={ 'configure.log': 'nt/build/configure.log', 'build-tools.log': 'nt/build/build-tools.log', 'test.log': 'nt/build/test.log', 'report.json': 'nt/build/report.json' }, env=env)) return f
def CreateLNTNightlyFactory(nt_flags, cc_path=None, cxx_path=None, parallel=False, jobs='%(jobs)s', db_url=None, external_URL=None): # Paramaters used by this method: # nt_flags : a list of flags passed to the lnt process # cc_path : explicit path to c compiler # cxx_path : explicit path to c++ compiler # parallel : set to True if using multiple cores for faster turnaround # set to False if measuring performance # db_url : set to the submission URL for an LNT database when measuring # performance # external_URL : Used to pull additional tests from a separate svn # repository # Properties set externally but used by this method: # builddir : This property is set below # jobs : This property is set by the slave, it indicates the number of # cores availble to use. # revision : This property should be set by an upstream builder. # slavename : This property is set by the slave # buildername : This property is set by the master f = buildbot.process.factory.BuildFactory() # Determine the build directory. f = getBuildDir(f) f = GetCompilerRoot(f) if cc_path: cc_command = ['echo', cc_path] else: cc_command = ['find', 'host-compiler', '-name', 'clang'] f.addStep( buildbot.steps.shell.SetProperty( name='find.cc', command=cc_command, extract_fn=_get_cc, workdir=WithProperties('%(builddir)s'))) if cxx_path: cc_command = ['echo', cxx_path] else: cc_command = ['find', 'host-compiler', '-name', 'clang++'] f.addStep( buildbot.steps.shell.SetProperty( name='find.cxx', command=cc_command, extract_fn=_get_cxx, workdir=WithProperties('%(builddir)s'))) f.addStep( buildbot.steps.shell.ShellCommand( name='sanity.test', haltOnFailure=True, command=[WithProperties('%(builddir)s/%(cc_path)s'), '-v'], description=['sanity test'])) args = [ WithProperties('%(builddir)s/lnt.venv/bin/python'), WithProperties('%(builddir)s/lnt.venv/bin/lnt'), 'runtest', '--verbose' ] if db_url: f.addStep( buildbot.steps.shell.SetProperty( name='db_url', command=[ 'echo', db_url, ':', WithProperties('%(buildername)s') ], extract_fn=_get_db_url, workdir=WithProperties('%(builddir)s'))) args.extend(['--submit', WithProperties('%(db_url)s')]) # Add --liblto-path if necessary. if '-flto' in nt_flags: f.addStep( buildbot.steps.shell.SetProperty( name='find.liblto', command=['find', 'host-compiler', '-name', 'libLTO.dylib'], extract_fn=_get_liblto, workdir=WithProperties('%(builddir)s'))) nt_flags.extend( ['--liblto-path', WithProperties('%(builddir)s/%(lto_path)s')]) # Get the LNT sources. f.addStep( buildbot.steps.shell.ShellCommand(name='svn.clean.lnt', command=['svn', 'cleanup'], haltOnFailure=False, flunkOnFailure=False, description=['svn clean lnt'], workdir='lnt')) f.addStep( SVN(name='pull.lnt', mode='full', method='fresh', repourl='http://llvm.org/svn/llvm-project/lnt/trunk', haltOnFailure=False, flunkOnFailure=False, workdir='lnt', alwaysUseLatest=True, retry=(60, 5), description='pull.lnt')) # Get the LLVM test-suite sources. f.addStep( buildbot.steps.shell.ShellCommand(name='svn.clean.tests', command=['svn', 'cleanup'], haltOnFailure=False, flunkOnFailure=False, description=['svn clean test-suite'], workdir='test-suite')) f.addStep( SVN(name='pull.test-suite', mode='full', method='fresh', repourl='http://llvm.org/svn/llvm-project/test-suite/trunk', haltOnFailure=False, flunkOnFailure=False, workdir='test-suite', retry=(60, 5), description='pull.test-suite')) if external_URL: external_dir = WithProperties('%(builddir)s/test-suite-externals') f.addStep( buildbot.steps.shell.ShellCommand( name='svn.clean.externals', command=['svn', 'cleanup'], haltOnFailure=False, flunkOnFailure=False, description=['svn clean externals'], workdir='test-suite-externals')) f.addStep( SVN(name='pull.test-suite-externals', mode='full', repourl=external_URL, retry=(60, 5), method='fresh', workdir='test-suite-externals', alwaysUseLatest=True, haltOnFailure=False, flunkOnFailure=False, description='pull.test-suite-externals', timeout=300)) # Buildbot uses got_revision instead of revision to identify builds. # The previous step will set it incorrectly # We set it to the correct value in th following step setProperty(f, 'got_revision', WithProperties('%(revision)s')) # Create the LNT virtual env. f.addStep( buildbot.steps.shell.ShellCommand( name='venv.lnt.clean', command=['rm', '-rfv', 'lnt.venv'], haltOnFailure=True, description=['clean', 'LNT', 'venv'], workdir=WithProperties('%(builddir)s'))) f.addStep( buildbot.steps.shell.ShellCommand( name='venv.lnt.create', command=['virtualenv', 'lnt.venv'], haltOnFailure=True, description=['create', 'LNT', 'venv'], workdir=WithProperties('%(builddir)s'), env={'PATH': '${PATH}:/usr/local/bin'})) f.addStep( buildbot.steps.shell.ShellCommand( name='venv.lnt.install', haltOnFailure=True, command=[ WithProperties('%(builddir)s/lnt.venv/bin/pip'), 'install', '--index-url', package_url, '-e', '.' ], description=['install', 'LNT'], workdir='lnt')) # Clean up the sandbox dir. f.addStep( buildbot.steps.shell.ShellCommand( name='lnt.nightly-test.clean', command=['rm', '-rfv', 'nt'], haltOnFailure=True, description=['clean', 'LNT', 'sandbox'], workdir='tests')) # Run the nightly test. nick = '%(slavename)s-%(buildername)s' args.extend([ 'nt', '--sandbox', 'nt', '--cc', WithProperties('%(builddir)s/%(cc_path)s'), '--cxx', WithProperties('%(builddir)s/%(cxx_path)s'), '--without-llvm', '--test-suite', WithProperties('%(builddir)s/test-suite'), '--no-timestamp', '--no-machdep-info', '--no-auto-name', '--no-configure' ]) if external_URL: args.extend(['--test-externals', external_dir]) if parallel: args.extend(['-j', WithProperties(jobs)]) args.extend(nt_flags) f.addStep( zorg.buildbot.commands.LitTestCommand.LitTestCommand( name='lnt.nightly-test', command=args, haltOnFailure=True, description=['nightly test'], workdir='tests', logfiles={ 'configure.log': 'nt/build/configure.log', 'build-tools.log': 'nt/build/build-tools.log', 'test.log': 'nt/build/test.log', 'report.json': 'nt/build/report.json' })) return f
'lucid', 'lucid64', 'win32', 'win32-legacy', 'macosx', 'macosx-legacy', 'source', 'ppa', 'ppa-dev', 'obs', 'obs-dev', 'precise', 'precise64', 'release', 'beta' ]), SingleBranchScheduler(name='trunk', change_filter=ChangeFilter(branch=None), treeStableTimer=60, builderNames=[ 'lucid', 'lucid64', 'win32', 'source', 'precise', 'precise64' ]) ] svn_co = [ SVN(mode='full', method='clobber', repourl='https://schat.googlecode.com/svn/trunk/'), ] svn_co_legacy = [ SVN(mode='full', method='clobber', repourl='https://schat.googlecode.com/svn/branches/0.8/'), ] def MakeDebBuilder(): f = BuildFactory() f.addSteps(svn_co) f.addStep( ShellCommand(