[zorg] r302075 - Refactored ABITestsuitBuilder to use UnifiedTreeBuilder, so it could track the changes in all dependent projects.
Galina Kistanova via llvm-commits
llvm-commits at lists.llvm.org
Wed May 3 13:25:24 PDT 2017
Author: gkistanova
Date: Wed May 3 15:25:23 2017
New Revision: 302075
URL: http://llvm.org/viewvc/llvm-project?rev=302075&view=rev
Log:
Refactored ABITestsuitBuilder to use UnifiedTreeBuilder, so it could track the changes in all dependent projects.
Modified:
zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py
Modified: zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py?rev=302075&r1=302074&r2=302075&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/ABITestsuitBuilder.py Wed May 3 15:25:23 2017
@@ -1,21 +1,18 @@
from buildbot.process.properties import WithProperties
from buildbot.steps.source import SVN
-from zorg.buildbot.builders import ClangBuilder
+from zorg.buildbot.builders import UnifiedTreeBuilder
+from zorg.buildbot.commands.CmakeCommand import CmakeCommand
+from zorg.buildbot.commands.NinjaCommand import NinjaCommand
from zorg.buildbot.commands.LitTestCommand import LitTestCommand
def getABITestsuitBuildFactory(
- always_clean=True,
- test=False,
- useTwoStage=False,
- cmake='cmake',
- extra_cmake_args=[], # Extra CMake args for all stages.
- jobs=None,
-
- env={}, # Environmental variables for all steps.
-
- stage1_config='Release',
- stage2_config='Release'):
+ clean = True,
+ depends_on_projects = None,
+ extra_configure_args = None, # Extra CMake args for all stages.
+ jobs = None, # Restrict a degree of parallelism if needed.
+ env = None, # Environmental variables for all steps.
+ **kwargs):
# Prepare environmental variables. Set here all env we want for all steps.
merged_env = {
@@ -25,26 +22,38 @@ def getABITestsuitBuildFactory(
# Overwrite pre-set items with the given ones, so user can set anything.
merged_env.update(env)
- source_dir = 'llvm' # Should match the one used in getClangCMakeBuildFactory.
- stage1_build_dir = 'stage1' # Should match the one defined in getClangCMakeBuildFactory.
- stage2_build_dir = 'stage2' # Should match the one defined in getClangCMakeBuildFactory.
+ if depends_on_projects:
+ depends_on_projects = list(depends_on_projects)
+ else:
+ depends_on_projects = ['llvm', 'clang', 'clang-tools-extra', 'compiler-rt', 'lld']
- if useTwoStage:
- clang_build_dir = stage2_build_dir
+ if extra_configure_args is None:
+ cmake_args = list()
else:
- clang_build_dir = stage1_build_dir
+ cmake_args = list(extra_configure_args)
- # Build clang first.
- f = ClangBuilder.getClangCMakeBuildFactory(
- clean=always_clean,
- test=test,
- cmake=cmake,
- extra_cmake_args=extra_cmake_args,
- jobs=jobs,
+ # Some options are required for this build no matter what.
+ CmakeCommand.applyRequiredOptions(cmake_args, [
+ ('-G', 'Ninja'),
+ ])
+
+ f = UnifiedTreeBuilder.getCmakeBuildFactory(
+ depends_on_projects=depends_on_projects,
+ llvm_srcdir="llvm",
+ obj_dir="build",
+ clean=clean,
+ extra_configure_args=cmake_args,
env=merged_env,
- useTwoStage=useTwoStage,
- stage1_config=stage1_config,
- stage2_config=stage2_config)
+ **kwargs) # Pass through all the extra arguments.
+
+
+ f.addStep(NinjaCommand(name="build-unified-tree",
+ haltOnFailure=False, ##
+ description=["Build", "unified", "tree"],
+ env=merged_env,
+ workdir=f.obj_dir,
+ **kwargs # Pass through all the extra arguments.
+ ))
# Checkout the test-suite.
f.addStep(SVN(name='svn-test-suite',
@@ -54,14 +63,14 @@ def getABITestsuitBuildFactory(
# Run the ABI test.
abi_test_env = {
- 'PYTHONPATH' : WithProperties("%(workdir)s/" + source_dir + "/utils/lit:${PYTHONPATH}"),
- 'PATH' : WithProperties("%(workdir)s/" + clang_build_dir + "/bin:${PATH}"),
+ 'PYTHONPATH' : WithProperties("%(workdir)s/" + f.llvm_srcdir + "/utils/lit:${PYTHONPATH}"),
+ 'PATH' : WithProperties("%(workdir)s/" + f.obj_dir + "/bin:${PATH}"),
}
merged_env.update(abi_test_env)
abi_test_cmd = ["python", "linux-x86.py", "clang", "test", "-v"]
if jobs:
- abi_test_cmd.append("-j"+str(jobs))
+ abi_test_cmd.append("-j" + str(jobs))
f.addStep(LitTestCommand(name='abi-test-suite',
command=abi_test_cmd,
More information about the llvm-commits
mailing list