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 test_getLegacySummary_unrendered_WithProperties_list(self): step = shell.ShellCommand( command=['x', properties.WithProperties(''), 'y']) step.rendered = True self.assertLegacySummary(step, "'x y'")
def test_getLegacySummary_unrendered_WithProperties(self): step = shell.ShellCommand(command=properties.WithProperties('')) step.rendered = True self.assertLegacySummary(step, None)
def test_describe_unrendered_WithProperties(self): step = shell.ShellCommand(command=properties.WithProperties('')) self.assertEqual((step.describe(), step.describe(done=True)), (['???'], ) * 2)
def test_describe_unrendered_WithProperties_list(self): step = shell.ShellCommand( command=['x', properties.WithProperties(''), 'y']) self.assertEqual((step.describe(), step.describe(done=True)), (["'x", "y'"], ) * 2)
def getLibcxxAndAbiBuilder(f=None, env={}, additional_features=set(), cmake_extra_opts={}, lit_extra_opts={}, lit_extra_args=[], check_libcxx_abilist=False): if f is None: f = buildbot.process.factory.BuildFactory() # Determine the build directory. f.addStep(buildbot.steps.shell.SetProperty( name="get_builddir", command=["pwd"], property="builddir", description="set build dir", workdir=".")) src_root = properties.WithProperties('%(builddir)s/llvm') build_path = properties.WithProperties('%(builddir)s/build') f = getLibcxxWholeTree(f, src_root) # Specify the max number of threads using properties so LIT doesn't use # all the threads on the system. litTestArgs = '-sv --show-unsupported --show-xfail --threads=%(jobs)s' if lit_extra_args: litTestArgs += ' ' + ' '.join(lit_extra_args) if additional_features: litTestArgs += (' --param=additional_features=' + ','.join(additional_features)) for key in lit_extra_opts: litTestArgs += (' --param=' + key + '=' + lit_extra_opts[key]) cmake_opts = [properties.WithProperties('-DLLVM_LIT_ARGS='+litTestArgs)] for key in cmake_extra_opts: cmake_opts.append('-D' + key + '=' + cmake_extra_opts[key]) # FIXME: The libc++ abilist's are generated in release mode with debug # symbols Other configurations may contain additional non-inlined symbols. if check_libcxx_abilist and not 'CMAKE_BUILD_TYPE' in cmake_extra_opts: cmake_opts.append('-DCMAKE_BUILD_TYPE=RELWITHDEBINFO') # Nuke/remake build directory and run CMake f.addStep(buildbot.steps.shell.ShellCommand( name='rm.builddir', command=['rm', '-rf', build_path], haltOnFailure=False, workdir=src_root)) f.addStep(buildbot.steps.shell.ShellCommand( name='make.builddir', command=['mkdir', build_path], haltOnFailure=True, workdir=src_root)) f.addStep(buildbot.steps.shell.ShellCommand( name='cmake', command=['cmake', src_root] + cmake_opts, haltOnFailure=True, workdir=build_path, env=env)) # Build libcxxabi jobs_flag = properties.WithProperties('-j%(jobs)s') f.addStep(buildbot.steps.shell.ShellCommand( name='build.libcxxabi', command=['make', jobs_flag, 'cxxabi'], haltOnFailure=True, workdir=build_path)) # Build libcxx f.addStep(buildbot.steps.shell.ShellCommand( name='build.libcxx', command=['make', jobs_flag, 'cxx'], haltOnFailure=True, workdir=build_path)) # Test libc++abi f.addStep(LitTestCommand( name = 'test.libcxxabi', command = ['make', 'check-libcxxabi'], description = ['testing', 'libcxxabi'], descriptionDone = ['test', 'libcxxabi'], workdir = build_path)) # Test libc++ f.addStep(LitTestCommand( name = 'test.libcxx', command = ['make', 'check-libcxx'], description = ['testing', 'libcxx'], descriptionDone = ['test', 'libcxx'], workdir = build_path)) if check_libcxx_abilist: f.addStep(buildbot.steps.shell.ShellCommand( name = 'test.libcxx.abilist', command = ['make', 'check-cxx-abilist'], description = ['testing', 'libcxx', 'abi'], descriptionDone = ['test', 'libcxx', 'abi'], workdir = build_path)) return f
def getLibcxxAndAbiBuilder(f=None, env={}, additional_features=set(), cmake_extra_opts={}, lit_extra_opts={}): if f is None: f = buildbot.process.factory.BuildFactory() # Determine the build directory. f.addStep( buildbot.steps.shell.SetProperty(name="get_builddir", command=["pwd"], property="builddir", description="set build dir", workdir=".")) src_root = properties.WithProperties('%(builddir)s/llvm') build_path = properties.WithProperties('%(builddir)s/build') f = getLibcxxWholeTree(f, src_root) # Specify the max number of threads using properties so LIT doesn't use # all the threads on the system. litTestArgs = '-sv --show-unsupported --show-xfail --threads=%(jobs)s' if additional_features: litTestArgs += (' --param=additional_features=' + ','.join(additional_features)) for key in lit_extra_opts: litTestArgs += (' --param=' + key + '=' + lit_extra_opts[key]) cmake_opts = [properties.WithProperties('-DLLVM_LIT_ARGS=' + litTestArgs)] for key in cmake_extra_opts: cmake_opts.append('-D' + key + '=' + cmake_extra_opts[key]) # Nuke/remake build directory and run CMake f.addStep( buildbot.steps.shell.ShellCommand(name='rm.builddir', command=['rm', '-rf', build_path], haltOnFailure=False, workdir=src_root)) f.addStep( buildbot.steps.shell.ShellCommand(name='make.builddir', command=['mkdir', build_path], haltOnFailure=True, workdir=src_root)) f.addStep( buildbot.steps.shell.ShellCommand(name='cmake', command=['cmake', src_root] + cmake_opts, haltOnFailure=True, workdir=build_path, env=env)) # Build libcxxabi jobs_flag = properties.WithProperties('-j%(jobs)s') f.addStep( buildbot.steps.shell.ShellCommand( name='build.libcxxabi', command=['make', jobs_flag, 'cxxabi'], haltOnFailure=True, workdir=build_path)) # Build libcxx f.addStep( buildbot.steps.shell.ShellCommand(name='build.libcxx', command=['make', jobs_flag, 'cxx'], haltOnFailure=True, workdir=build_path)) # Test libc++abi f.addStep( LitTestCommand(name='test.libcxxabi', command=['make', 'check-libcxxabi'], description=['testing', 'libcxxabi'], descriptionDone=['test', 'libcxxabi'], workdir=build_path)) # Test libc++ f.addStep( LitTestCommand(name='test.libcxx', command=['make', 'check-libcxx'], description=['testing', 'libcxx'], descriptionDone=['test', 'libcxx'], workdir=build_path)) return f
def getLibcxxAndAbiBuilder(f=None, env=None, cmake_extra_opts=None, lit_extra_opts=None, lit_extra_args=None, check_libcxx_abilist=False, check_libcxx_benchmarks=None, depends_on_projects=None, use_cache=None, **kwargs): if env is None: env = {} if cmake_extra_opts is None: cmake_extra_opts = {} if lit_extra_opts is None: lit_extra_opts = {} if lit_extra_args is None: lit_extra_args = [] if depends_on_projects is None: depends_on_projects = ['libcxx','libcxxabi','libunwind'] src_root = 'llvm' build_path = 'build' if f is None: f = UnifiedTreeBuilder.getLLVMBuildFactoryAndSourcecodeSteps( depends_on_projects=depends_on_projects, llvm_srcdir=src_root, obj_dir=build_path, **kwargs) # Pass through all the extra arguments. rel_src_dir = LLVMBuildFactory.pathRelativeToBuild(f.llvm_srcdir, build_path) # Specify the max number of threads using properties so LIT doesn't use # all the threads on the system. litTestArgs = '-vv --show-unsupported --show-xfail --threads=%(jobs)s' if lit_extra_args: litTestArgs += ' ' + ' '.join(lit_extra_args) for key in lit_extra_opts: litTestArgs += (' --param=' + key + '=' + lit_extra_opts[key]) cmake_opts = [properties.WithProperties('-DLLVM_LIT_ARGS='+litTestArgs)] for key in cmake_extra_opts: cmake_opts.append('-D' + key + '=' + cmake_extra_opts[key]) if use_cache: libcxx_cache_dir = '%s/../libcxx/cmake/caches' % rel_src_dir cache = '%s/%s' % (libcxx_cache_dir, use_cache) cmake_opts.append('-C' + cache) # FIXME: The libc++ abilist's are generated in release mode with debug # symbols Other configurations may contain additional non-inlined symbols. if check_libcxx_abilist and not 'CMAKE_BUILD_TYPE' in cmake_extra_opts: cmake_opts.append('-DCMAKE_BUILD_TYPE=RELWITHDEBINFO') # Force libc++ to use the in-tree libc++abi unless otherwise specified. if 'LIBCXX_CXX_ABI' not in cmake_extra_opts: cmake_opts.append('-DLIBCXX_CXX_ABI=libcxxabi') # Nuke/remake build directory and run CMake f.addStep(buildbot.steps.shell.ShellCommand( name='rm.builddir', command=['rm', '-rf', build_path], workdir=".", haltOnFailure=False)) CmakeCommand.applyRequiredOptions(cmake_opts, [ ('-DLLVM_ENABLE_PROJECTS=', ";".join(f.depends_on_projects)), ]) f.addStep(buildbot.steps.shell.ShellCommand( name='cmake', command=['cmake', rel_src_dir] + cmake_opts, haltOnFailure=True, workdir=build_path, env=env)) # Build libcxxabi jobs_flag = properties.WithProperties('-j%(jobs)s') f.addStep(buildbot.steps.shell.ShellCommand( name='build.libcxxabi', command=['make', jobs_flag, 'cxxabi'], haltOnFailure=True, workdir=build_path)) # Build libcxx f.addStep(buildbot.steps.shell.ShellCommand( name='build.libcxx', command=['make', jobs_flag, 'cxx'], haltOnFailure=True, workdir=build_path)) # Test libc++abi f.addStep(LitTestCommand( name = 'test.libcxxabi', command = ['make', jobs_flag, 'check-cxxabi'], description = ['testing', 'libcxxabi'], descriptionDone = ['test', 'libcxxabi'], workdir = build_path)) # Test libc++ f.addStep(LitTestCommand( name = 'test.libcxx', command = ['make', jobs_flag, 'check-cxx'], description = ['testing', 'libcxx'], descriptionDone = ['test', 'libcxx'], workdir = build_path)) if check_libcxx_abilist: f.addStep(buildbot.steps.shell.ShellCommand( name = 'test.libcxx.abilist', command = ['make', 'check-cxx-abilist'], description = ['testing', 'libcxx', 'abi'], descriptionDone = ['test', 'libcxx', 'abi'], workdir = build_path)) if check_libcxx_benchmarks: # Build the libc++ benchmarks f.addStep(buildbot.steps.shell.ShellCommand( name='build.libcxx.benchmarks', command=['make', jobs_flag, 'cxx-benchmarks'], haltOnFailure=True, workdir=build_path)) # Run the benchmarks f.addStep(LitTestCommand( name = 'test.libcxx.benchmarks', command = ['make', jobs_flag, 'check-cxx-benchmarks'], description = ['testing', 'libcxx', 'benchmarks'], descriptionDone = ['test', 'libcxx', 'benchmarks'], workdir = build_path)) return f
def getLibCXXBuilder(f=None, source_path=None, lit_dir=None): if f is None: f = buildbot.process.factory.BuildFactory() # Find the build directory. We assume if f is passed in that the build # directory has already been found. f = phased_builder_utils.getBuildDir(f) # Grab the sources if we are not passed in any. if source_path is None: source_path = 'sources' src_url = 'http://llvm.org/svn/llvm-project/libcxx/trunk' f = phased_builder_utils.SVNCleanupStep(f, source_path) f.addStep( svn.SVN(name='pull.src', mode='full', repourl=src_url, workdir=source_path, method='fresh', alwaysUseLatest=False, retry=(60, 5), description='pull.src')) # Grab the artifacts for our build. f = artifacts.GetCompilerArtifacts(f) host_compiler_dir = properties.WithProperties('%(builddir)s/host-compiler') f = artifacts.GetCCFromCompilerArtifacts(f, host_compiler_dir) f = artifacts.GetCXXFromCompilerArtifacts(f, host_compiler_dir) # Build libcxx. CC = properties.WithProperties('%(cc_path)s') CXX = properties.WithProperties('%(cxx_path)s') HEADER_INCLUDE = \ properties.WithProperties('-I %s' % os.path.join('%(builddir)s', source_path, 'include')) SOURCE_LIB = \ properties.WithProperties(os.path.join('%(builddir)s', source_path, 'lib', 'libc++.1.dylib')) f.addStep( buildbot.steps.shell.ShellCommand(name='build.libcxx', command=['./buildit'], haltOnFailure=True, workdir=os.path.join( source_path, 'lib'), env={ 'CC': CC, 'CXX': CXX, 'TRIPLE': '-apple-' })) # Get the 'lit' sources if we need to. if lit_dir is None: lit_dir = 'lit.src' f.addStep( svn.SVN( name='pull.lit', mode='incremental', method='fresh', repourl='http://llvm.org/svn/llvm-project/llvm/trunk/utils/lit', workdir=lit_dir, alwaysUseLatest=False)) # Install a copy of 'lit' in a virtualenv. f.addStep( buildbot.steps.shell.ShellCommand(name='venv.lit.clean', command=['rm', '-rf', 'lit.venv'], workdir='.', haltOnFailure=True)) f.addStep( buildbot.steps.shell.ShellCommand( name='venv.lit.make', command=['/usr/local/bin/virtualenv', 'lit.venv'], workdir='.', haltOnFailure=True)) f.addStep( buildbot.steps.shell.ShellCommand( name='venv.lit.install', command=[ properties.WithProperties('%(builddir)s/lit.venv/bin/python'), 'setup.py', 'install' ], workdir=lit_dir, haltOnFailure=True)) # Run the tests with the system's dylib f.addStep( lit_test_command.LitTestCommand( name='test.libcxx.system', command=[ properties.WithProperties('%(builddir)s/lit.venv/bin/lit'), '-v', '--show-xfail', '--show-unsupported', properties.WithProperties( '--param=cxx_under_test=%(cxx_path)s'), '--param=use_system_lib=true', 'sources/test' ], workdir='.')) # Run the tests with the newly built dylib f.addStep( lit_test_command.LitTestCommand( name='test.libcxx.new', command=[ properties.WithProperties('%(builddir)s/lit.venv/bin/lit'), '-v', '--show-xfail', '--show-unsupported', properties.WithProperties( '--param=cxx_under_test=%(cxx_path)s'), '--param=use_system_lib=false', 'sources/test' ], workdir='.')) return f