aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalina Kistanova <gkistanova@gmail.com>2019-10-17 17:32:48 +0000
committerGalina Kistanova <gkistanova@gmail.com>2019-10-17 17:32:48 +0000
commit56ae66e147c945f240718a70ddf2b64424ce37e9 (patch)
tree9201de4ee8475525604c0554874cc94a6922a154
parent133fa9a2a7247cc980cb5812e60b86b6220b2097 (diff)
Reverted r375035 and r375036 to fix the commit message and author name.
git-svn-id: https://llvm.org/svn/llvm-project/zorg/trunk@375139 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--zorg/buildbot/builders/UnifiedTreeBuilder.py20
-rw-r--r--zorg/buildbot/process/factory.py108
2 files changed, 9 insertions, 119 deletions
diff --git a/zorg/buildbot/builders/UnifiedTreeBuilder.py b/zorg/buildbot/builders/UnifiedTreeBuilder.py
index 9601fed4..a1ed6fd0 100644
--- a/zorg/buildbot/builders/UnifiedTreeBuilder.py
+++ b/zorg/buildbot/builders/UnifiedTreeBuilder.py
@@ -26,11 +26,7 @@ def getLLVMBuildFactoryAndPrepareForSourcecodeSteps(
# We want a clean checkout only if requested by the property.
cleanBuildRequested = cleanBuildRequestedByProperty
- # By default UnifiedTreeBuilder works in the legacy mode yet.
- is_legacy_mode = kwargs.pop('is_legacy_mode', True)
-
f = LLVMBuildFactory(
- is_legacy_mode=is_legacy_mode,
depends_on_projects=depends_on_projects,
llvm_srcdir=llvm_srcdir,
obj_dir=obj_dir,
@@ -42,7 +38,7 @@ def getLLVMBuildFactoryAndPrepareForSourcecodeSteps(
# TODO: Some Windows slaves do not handle RemoveDirectory command well.
# So, consider running "rmdir /S /Q <dir>" if the build runs on Windows.
f.addStep(RemoveDirectory(name='clean-src-dir',
- dir=f.llvm_srcdir if f.is_legacy_mode else f.monorepo_dir,
+ dir=f.llvm_srcdir,
haltOnFailure=False,
flunkOnFailure=False,
doStepIf=cleanBuildRequestedByProperty,
@@ -56,6 +52,7 @@ def getLLVMBuildFactoryAndSourcecodeSteps(
obj_dir = None,
install_dir = None,
cleanBuildRequested = None,
+ env = None,
**kwargs):
f = getLLVMBuildFactoryAndPrepareForSourcecodeSteps(
@@ -87,10 +84,6 @@ def addCmakeSteps(
stage_name = None,
**kwargs):
- # Consume is_legacy_mode if given.
- # TODO: Remove this once legacy mode gets dropped.
- kwargs.pop('is_legacy_mode', None)
-
# Make a local copy of the configure args, as we are going to modify that.
if extra_configure_args:
cmake_args = extra_configure_args[:]
@@ -111,11 +104,6 @@ def addCmakeSteps(
doStepIf=cleanBuildRequested,
))
- if not f.is_legacy_mode:
- CmakeCommand.applyRequiredOptions(cmake_args, [
- ('-DLLVM_ENABLE_PROJECTS=', ";".join(f.depends_on_projects)),
- ])
-
if install_dir:
install_dir_rel = LLVMBuildFactory.pathRelativeToBuild(
install_dir,
@@ -169,10 +157,6 @@ def addNinjaSteps(
stage_name = None,
**kwargs):
- # Consume is_legacy_mode if given.
- # TODO: Remove this once legacy mode gets dropped.
- kwargs.pop('is_legacy_mode', None)
-
# Build the unified tree.
if stage_name:
step_name = "%s-" % stage_name
diff --git a/zorg/buildbot/process/factory.py b/zorg/buildbot/process/factory.py
index c2242fbb..93d60504 100644
--- a/zorg/buildbot/process/factory.py
+++ b/zorg/buildbot/process/factory.py
@@ -1,7 +1,7 @@
from collections import OrderedDict
from buildbot.process.factory import BuildFactory
-from buildbot.steps.source import SVN, Git
+from buildbot.steps.source import SVN
from buildbot.steps.shell import WithProperties
# NOTE: svn_repos is deprecated and will be removed.
@@ -39,30 +39,14 @@ class LLVMBuildFactory(BuildFactory):
# By default LLVMBuildFactory works in the legacy mode.
self.is_legacy_mode = kwargs.pop('is_legacy_mode', True)
- # Directories.
- self.llvm_srcdir = kwargs.pop('llvm_srcdir', None)
- self.obj_dir = kwargs.pop('llvm_srcdir', None)
- self.install_dir = kwargs.pop('llvm_srcdir', None)
-
- # Preserve the rest of the given extra attributes if any, so we could
+ # Preserve all the given extra attributes if any, so we could
# expand the factory later.
for k,v in kwargs.items():
setattr(self, k, v)
- if self.is_legacy_mode:
- self.llvm_srcdir = self.llvm_srcdir or "llvm"
- self.obj_dir = self.obj_dir or "build"
- else:
- self.monorepo_dir = self.llvm_srcdir or "llvm-project"
- self.llvm_srcdir = \
- "%(monorepo_dir)s/llvm" % {'monorepo_dir' : self.monorepo_dir}
- self.obj_dir = \
- self.obj_dir or \
- "%(monorepo_dir)s/build" % {'monorepo_dir' : self.monorepo_dir}
-
- # Repourl could be specified per builder. Otherwise we use github.
- self.repourl = kwargs.pop('repourl', 'https://github.com/llvm/llvm-%s.git')
-
+ # Default source code directory.
+ if kwargs.get('llvm_srcdir', None) is None:
+ self.llvm_srcdir = "llvm"
# Default build directory.
if kwargs.get('obj_dir', None) is None:
@@ -75,28 +59,7 @@ class LLVMBuildFactory(BuildFactory):
# The path is absolute. Don't touch it.
return path
else:
- # Remove "current dir" placeholders if any.
- path_nodes = list(filter(lambda x: x != ".", path.split('/')))
- buildPath_nodes = list(filter(lambda x: x != ".", buildPath.split('/')))
-
- # Handle edge cases.
- if len(buildPath_nodes) == 0:
- return "/".join(path_nodes)
- if len(path_nodes) == 0:
- return "."
-
- # Skip a common part of the two paths.
- for i in range(0, min(len(path_nodes), len(buildPath_nodes))):
- if path_nodes[i] != buildPath_nodes[i]:
- rel_path = \
- "../" * (len(buildPath_nodes) - i) + \
- "/".join(path_nodes[i:])
- break
- else:
- # Everything matches.
- rel_path = '.'
-
- return rel_path
+ return "../" * (buildPath.count("/") + 1) + path
# llvm_srcdir - Path to the root of the unified source tree.
@@ -123,62 +86,5 @@ class LLVMBuildFactory(BuildFactory):
baseURL=WithProperties(baseURL),
**kwargs))
-
def addGetSourcecodeSteps(self, **kwargs):
- # Remove 'is_legacy_mode' if it leaked in to kwargs.
- kwargs.pop('is_legacy_mode', None)
-
- # Bail out if we are in the legacy mode and SVN checkout is required.
- if self.is_legacy_mode:
- self.addSVNSteps(**kwargs)
- return
-
- # Checkout the monorepo.
- _repourl = self.repourl
- if '%' in _repourl:
- _repourl = _repourl % 'project'
- self.addStep(
- Git(name='Checkout the source code',
- repourl=_repourl,
- progress=True,
- workdir=WithProperties(self.monorepo_dir),
- **kwargs))
-
-
- # Checkout a given LLVM project to the given directory.
- # TODO: Handle clean property and self.clean attribute.
- def addGetSourcecodeForProject(self, project, srcdir=None, **kwargs):
- # Bail out if we are in the legacy mode and SVN checkout is required.
- if self.is_legacy_mode:
- workdir, baseURL = svn_repos[project]
-
- # Check out to the given directory if any.
- # Otherwise this is a part of the unified source tree.
- if srcdir is None:
- srcdir = workdir % {'llvm_srcdir' : self.llvm_srcdir}
-
- self.addStep(
- SVN(name='svn-%s' % project,
- workdir=workdir % {'llvm_srcdir' : srcdir},
- baseURL=WithProperties(baseURL),
- **kwargs))
- else:
- # project contains a repo name which is not a part of the monorepo.
- # We do not enforce it here, though.
- _repourl = kwargs.pop('repourl', self.repourl)
- if '%' in _repourl:
- _repourl = _repourl % project
-
- # Check out to the given directory if any.
- # Otherwise this is a part of the unified source tree.
- if srcdir is None:
- srcdir = 'llvm-%s' % project
-
- # Ignore workdir if given. We check out to srcdir.
- kwargs.pop('workdir', None)
-
- self.addStep(
- Git(name='Checkout the %s' % project,
- progress=True,
- workdir=WithProperties(srcdir),
- **kwargs)) \ No newline at end of file
+ self.addSVNSteps(**kwargs)