diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -21,6 +21,7 @@ from zorg.buildbot.builders import FuchsiaBuilder from zorg.buildbot.builders import XToolchainBuilder from zorg.buildbot.builders import TestSuiteBuilder +from zorg.buildbot.builders import BOLTBuilder from zorg.buildbot.builders import HtmlDocsBuilder from zorg.buildbot.builders import DoxygenDocsBuilder @@ -2284,4 +2285,19 @@ ])}, + # BOLT builder managed by Meta + {'name': "bolt-x86_64-ubuntu", + 'tags': ["bolt"], + 'collapseRequests': False, + 'workernames':["bolt-worker2"], + 'builddir': "bolt-x86_64-ubuntu-bolttests", + 'factory' : BOLTBuilder.getBOLTCmakeBuildFactory( + bolttests=True, + extra_configure_args=[ + "-DLLVM_CCACHE_BUILD=ON", + "-DLLVM_ENABLE_PROJECTS=clang;lld;bolt", + "-DLLVM_TARGETS_TO_BUILD=X86;AArch64", + ], + )}, + ] diff --git a/buildbot/osuosl/master/config/workers.py b/buildbot/osuosl/master/config/workers.py --- a/buildbot/osuosl/master/config/workers.py +++ b/buildbot/osuosl/master/config/workers.py @@ -270,4 +270,7 @@ # OpenMP on AMDGPU, Ubuntu 18.04.5, Intel(R) Xeon(R) Gold 5218 @ 2.30GHz with 64GB Memory, 1 Vega20 GPU with 16GB Memory create_worker("omp-vega20-0", properties={'jobs': 32}, max_builds=1), create_worker("omp-vega20-1", properties={'jobs': 32}, max_builds=1), + + # BOLT worker + create_worker("bolt-worker2"), ] diff --git a/zorg/buildbot/builders/BOLTBuilder.py b/zorg/buildbot/builders/BOLTBuilder.py new file mode 100644 --- /dev/null +++ b/zorg/buildbot/builders/BOLTBuilder.py @@ -0,0 +1,72 @@ +from buildbot.plugins import steps +from zorg.buildbot.commands.CmakeCommand import CmakeCommand +from zorg.buildbot.builders.UnifiedTreeBuilder import getLLVMBuildFactoryAndSourcecodeSteps, addCmakeSteps, addNinjaSteps +from zorg.buildbot.process.factory import LLVMBuildFactory + +def getBOLTCmakeBuildFactory( + clean = False, + bolttests = False, + extra_configure_args = None, + env = None, + **kwargs): + + if env is None: + env = dict() + + bolttests_dir = "bolt-tests" + + cleanBuildRequested = lambda step: clean or step.build.getProperty("clean", default=step.build.getProperty("clean_obj")) + cleanBuildRequestedByProperty = lambda step: step.build.getProperty("clean") + + checks = ['check-bolt'] + extra_steps = [] + + f = getLLVMBuildFactoryAndSourcecodeSteps( + depends_on_projects=['bolt'], + **kwargs) # Pass through all the extra arguments. + + if bolttests: + checks += ['check-large-bolt'] + extra_configure_args += [ + '-DLLVM_EXTERNAL_PROJECTS=bolttests', + '-DLLVM_EXTERNAL_BOLTTESTS_SOURCE_DIR=' + LLVMBuildFactory.pathRelativeTo(bolttests_dir, f.monorepo_dir), + ] + # Clean checkout of bolt-tests if cleanBuildRequested + f.addSteps([ + steps.RemoveDirectory(name="BOLT tests: clean", + dir=bolttests_dir, + haltOnFailure=True, + warnOnFailure=True, + doStepIf=cleanBuildRequestedByProperty), + + steps.Git(name="BOLT tests: checkout", + description="fetching", + descriptionDone="fetch", + descriptionSuffix="BOLT Tests", + repourl='https://github.com/rafaelauler/bolt-tests.git', + workdir=bolttests_dir, + doStepIf=cleanBuildRequestedByProperty, + alwaysUseLatest=True), + ]) + + # Some options are required for this build no matter what. + CmakeCommand.applyRequiredOptions(extra_configure_args, [ + ('-G', 'Ninja'), + ]) + + addCmakeSteps( + f, + cleanBuildRequested=cleanBuildRequested, + extra_configure_args=extra_configure_args, + obj_dir=None, + env=env, + **kwargs) + + addNinjaSteps( + f, + targets = ['bolt'], + checks=checks, + env=env, + **kwargs) + + return f