[zorg] r258949 - [zorg] Convert llvm-mips-linux builder to cmake.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 09:17:12 PST 2016


Author: dsanders
Date: Wed Jan 27 11:17:12 2016
New Revision: 258949

URL: http://llvm.org/viewvc/llvm-project?rev=258949&view=rev
Log:
[zorg] Convert llvm-mips-linux builder to cmake.

Duplicated getLLVMBuildFactory and adapted it to cmake. The original should be
removed now that autoconf is not supported but other builders still reference
it.

Drop the following arguments from cmake version since nobody uses them anymore:
* llvmgccdir
* valgrind
* examples
* expensive_checks
* enable_targets
In the case of valgrind, 'llvm-x86_64-linux-vg_leak' referenced it but this
builder is disabled.


Modified:
    zorg/trunk/buildbot/osuosl/master/config/builders.py
    zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py

Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/builders.py?rev=258949&r1=258948&r2=258949&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/builders.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py Wed Jan 27 11:17:12 2016
@@ -70,15 +70,26 @@ def _get_llvm_builders():
          'slavenames':["systemz-1"],
          'builddir':"llvm-s390x-linux1",
          'factory': LLVMBuilder.getLLVMBuildFactory("s390x-linux-gnu", jobs=4, clean=False, timeout=20, config_name='Release+Asserts')},
-
+        # We currently have to force LLVM_HOST_TRIPLE and
+        # LLVM_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value
+        # correct for the processor but it's currently not possible to emit O32
+        # code using a mips64-* triple. This is a bug and should be fixed soon.
+        # We must also force LLVM_TARGET_ARCH so that the ExecutionEngine tests
+        # run.
         {'name': "llvm-mips-linux",
          'slavenames':["mipsswbrd002"],
          'builddir':"llvm-mips-linux",
-         'factory': LLVMBuilder.getLLVMBuildFactory("mips-linux-gnu", timeout=40, config_name='Release+Asserts',
-                                                    extra_configure_args=["--with-extra-options=-mips32r2",
-                                                                          "CC=/mips/proj/build-compiler/clang-be-o32-latest/bin/clang",
-                                                                          "CXX=/mips/proj/build-compiler/clang-be-o32-latest/bin/clang++",
-                                                                          "--with-extra-ld-options=-mips32r2"])},
+         'factory': LLVMBuilder.getLLVMCMakeBuildFactory(
+                        timeout=40, config_name='Release',
+                        enable_shared=True,
+                        extra_cmake_args=["-DLLVM_HOST_TRIPLE=mips-linux-gnu",
+                                          "-DLLVM_DEFAULT_TARGET_TRIPLE=mips-linux-gnu",
+                                          "-DLLVM_TARGET_ARCH=Mips",
+                                          "-DLLVM_ENABLE_ASSERTIONS=ON",
+                                          "-DLLVM_PARALLEL_LINK_JOBS=1"],
+                        env={'CC': '/mips/proj/build-compiler/clang-be-o32-latest/bin/clang',
+                             'CXX': '/mips/proj/build-compiler/clang-be-o32-latest/bin/clang++',
+                            })},
         {'name': "llvm-aarch64-linux",
          'slavenames':["aarch64-foundation"],
          'builddir':"llvm-aarch64-linux",
@@ -692,8 +703,8 @@ def _get_sanitizer_builders():
                         extra_cmake_args=["-DLLVM_TARGETS_TO_BUILD='ARM;AArch64'"])},
 
           # Mips check-all with CMake builder
-          # We currently have to force CMAKE_HOST_TRIPLE and
-          # CMAKE_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value
+          # We currently have to force LLVM_HOST_TRIPLE and
+          # LLVM_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value
           # correct for the processor but it's currently not possible to emit O32
           # code using a mips64-* triple. This is a bug and should be fixed soon.
           # We must also force LLVM_TARGET_ARCH so that the ExecutionEngine tests
@@ -710,8 +721,8 @@ def _get_sanitizer_builders():
                            stage1_upload_directory='clang-cmake-mips',
                            env = {'BOTO_CONFIG': '/var/buildbot/llvmlab-build-artifacts.boto'})},
           # Mips check-all with CMake builder
-          # We currently have to force CMAKE_HOST_TRIPLE and
-          # CMAKE_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value
+          # We currently have to force LLVM_HOST_TRIPLE and
+          # LLVM_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value
           # correct for the processor but it's currently not possible to emit O32
           # code using a mips64-* triple. This is a bug and should be fixed soon.
           # We must also force LLVM_TARGET_ARCH so that the ExecutionEngine tests

Modified: zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py?rev=258949&r1=258948&r2=258949&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/LLVMBuilder.py Wed Jan 27 11:17:12 2016
@@ -135,3 +135,91 @@ def getLLVMBuildFactory(
                 workdir         = llvm_objdir,
                 env             = merged_env))
     return f
+
+def getLLVMCMakeBuildFactory(
+                  clean                = True,             # "clean-llvm" step is requested if true.
+                  test                 = True,             # "test-llvm" step is requested if true.
+                  jobs                 = '%(jobs)s',       # Number of concurrent jobs.
+                  timeout              = 20,               # Timeout if no activity seen (minutes).
+                  make                 = 'make',           # Make command.
+                  enable_shared        = False,            # Enable shared (-DBUILD_SHARED_LIBS=ON configure parameters added) if true.
+                  defaultBranch        = 'trunk',          # Branch to build.
+                  config_name          = 'Debug',          # Configuration name.
+                  env                  = {},               # Environmental variables for all steps.
+                  extra_cmake_args = []):                  # Extra args for the cmake step.
+    # Prepare environmental variables. Set here all env we want everywhere.
+    merged_env = {
+                   'TERM' : 'dumb'     # Make sure Clang doesn't use color escape sequences.
+                 }
+    if env is not None:
+        merged_env.update(env)  # Overwrite pre-set items with the given ones, so user can set anything.
+
+    llvm_srcdir = "llvm.src"
+    llvm_objdir = "llvm.obj"
+
+    f = buildbot.process.factory.BuildFactory()
+
+    # Determine the build directory.
+    f.addStep(
+        buildbot.steps.shell.SetProperty(
+            name        = "get_builddir",
+            command     = ["pwd"],
+            property    = "builddir",
+            description = "set build dir",
+            workdir     = ".",
+            env         = merged_env))
+
+    # Checkout sources.
+    f.addStep(
+        SVN(
+            name          = 'svn-llvm',
+            mode          = 'update', baseURL='http://llvm.org/svn/llvm-project/llvm/',
+            defaultBranch = defaultBranch,
+            workdir       = llvm_srcdir))
+
+    cmake_args = ['cmake']
+    cmake_args += ["-DCMAKE_BUILD_TYPE="+config_name],
+    if enable_shared:
+        cmake_args.append('-DBUILD_SHARED_LIBS=ON')
+    cmake_args.extend(extra_cmake_args)
+    cmake_args += ['../' + llvm_srcdir]
+    f.addStep(
+        Configure(
+            command         = cmake_args,
+            description     = ['configuring', config_name],
+            descriptionDone = ['configure',   config_name],
+            workdir         = llvm_objdir,
+            env             = merged_env))
+    if clean:
+        f.addStep(
+            WarningCountingShellCommand(
+                name            = "clean-llvm",
+                command         = [make, 'clean'],
+                haltOnFailure   = True,
+                description     = "cleaning llvm",
+                descriptionDone = "clean llvm",
+                workdir         = llvm_objdir,
+                env             = merged_env))
+    f.addStep(
+        WarningCountingShellCommand(
+            name            = "compile",
+            command         = ['nice', '-n', '10',
+                               make, WithProperties("-j%s" % jobs)],
+            haltOnFailure   = True,
+            description     = "compiling llvm",
+            descriptionDone = "compile llvm",
+            workdir         = llvm_objdir,
+            env             = merged_env,
+            timeout         = timeout * 60))
+    if test:
+        litTestArgs = '-v -j %s' % jobs
+        f.addStep(
+            LitTestCommand(
+                name            = 'test-llvm',
+                command         = [make, "check-all", "VERBOSE=1",
+                                   WithProperties("LIT_ARGS=%s" % litTestArgs)],
+                description     = ["testing", "llvm"],
+                descriptionDone = ["test",    "llvm"],
+                workdir         = llvm_objdir,
+                env             = merged_env))
+    return f




More information about the llvm-commits mailing list