[PATCH] D69049: Updated UnifiedTreeBuilder to fully support is_legacy_mode.

Andrei Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 08:55:09 PDT 2019


andreil99 created this revision.
andreil99 added reviewers: gkistanova, aorlov, vvereschaka.
andreil99 added projects: LLVM, Zorg.
Herald added a subscriber: llvm-commits.

This allows to use the newly added LLVMBuildFactory ability to transparently use SVN or github and switch between depending on the `is_legacy_mode` attribute, and adds a github support to UnifiedTreeBuilder.


Repository:
  rL LLVM

https://reviews.llvm.org/D69049

Files:
  zorg/buildbot/builders/UnifiedTreeBuilder.py


Index: zorg/buildbot/builders/UnifiedTreeBuilder.py
===================================================================
--- zorg/buildbot/builders/UnifiedTreeBuilder.py
+++ zorg/buildbot/builders/UnifiedTreeBuilder.py
@@ -26,7 +26,11 @@
         # 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,
@@ -38,7 +42,7 @@
     # 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,
+              dir=f.llvm_srcdir if f.is_legacy_mode else f.monorepo_dir,
               haltOnFailure=False,
               flunkOnFailure=False,
               doStepIf=cleanBuildRequestedByProperty,
@@ -52,7 +56,6 @@
            obj_dir = None,
            install_dir = None,
            cleanBuildRequested = None,
-           env = None,
            **kwargs):
 
     f = getLLVMBuildFactoryAndPrepareForSourcecodeSteps(
@@ -84,6 +87,10 @@
            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[:]
@@ -104,6 +111,11 @@
               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,
@@ -157,6 +169,10 @@
            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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69049.225238.patch
Type: text/x-patch
Size: 2448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191016/ceef9e9d/attachment.bin>


More information about the llvm-commits mailing list