[zorg] r375139 - Reverted r375035 and r375036 to fix the commit message and author name.

Galina Kistanova via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 10:32:48 PDT 2019


Author: gkistanova
Date: Thu Oct 17 10:32:48 2019
New Revision: 375139

URL: http://llvm.org/viewvc/llvm-project?rev=375139&view=rev
Log:
Reverted r375035 and r375036 to fix the commit message and author name.

Modified:
    zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py
    zorg/trunk/zorg/buildbot/process/factory.py

Modified: zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py?rev=375139&r1=375138&r2=375139&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/UnifiedTreeBuilder.py Thu Oct 17 10:32:48 2019
@@ -26,11 +26,7 @@ def getLLVMBuildFactoryAndPrepareForSour
         # 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 getLLVMBuildFactoryAndPrepareForSour
     # 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 getLLVMBuildFactoryAndSourcecodeStep
            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

Modified: zorg/trunk/zorg/buildbot/process/factory.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/process/factory.py?rev=375139&r1=375138&r2=375139&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/process/factory.py (original)
+++ zorg/trunk/zorg/buildbot/process/factory.py Thu Oct 17 10:32:48 2019
@@ -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)




More information about the llvm-commits mailing list