[zorg] r225548 - This creates a Windows buildbot for LLDB

Zachary Turner zturner at google.com
Fri Jan 9 13:48:58 PST 2015


Author: zturner
Date: Fri Jan  9 15:48:57 2015
New Revision: 225548

URL: http://llvm.org/viewvc/llvm-project?rev=225548&view=rev
Log:
This creates a Windows buildbot for LLDB

1) Only builds x86.
2) Only compiles, does not run tests.
3) Uses MSVC 2013 as the compiler, with the CMake / ninja generator.

Reviewed by: Galina Kistanova
Differential Revision: http://reviews.llvm.org/D6745

Modified:
    zorg/trunk/buildbot/osuosl/master/config/builders.py
    zorg/trunk/buildbot/osuosl/master/config/slaves.py
    zorg/trunk/zorg/buildbot/builders/LLDBBuilder.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=225548&r1=225547&r2=225548&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/builders.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py Fri Jan  9 15:48:57 2015
@@ -631,6 +631,10 @@ def _get_lldb_builders():
          'factory': LLDBBuilder.getLLDBBuildFactory(triple=None, # use default
                                                     make='gmake',
                                                     extra_configure_args=['--enable-cxx11', '--enable-optimized', '--enable-assertions'])},
+        {'name': "lldb-x86-windows-msvc",
+         'slavenames': ["zturner-win2008"],
+         'builddir': "lldb-windows-x86",
+         'factory': LLDBBuilder.getLLDBWindowsCMakeBuildFactory(config='Debug')},
        ]
 
 # Offline.

Modified: zorg/trunk/buildbot/osuosl/master/config/slaves.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/slaves.py?rev=225548&r1=225547&r2=225548&view=diff
==============================================================================
--- zorg/trunk/buildbot/osuosl/master/config/slaves.py (original)
+++ zorg/trunk/buildbot/osuosl/master/config/slaves.py Fri Jan  9 15:48:57 2015
@@ -175,6 +175,9 @@ def get_build_slaves():
         create_slave('ericwf-buildslave2', properties={'jobs': 4}, max_builds=2),
         # OS X 10.10 x86_64, Intel Core 2 Duo @ 2.40GHz
         create_slave("ericwf-osx-slave", properties={'jobs': 2}, max_builds=1),
+
+        # Windows Server 2008 R2, Quad 2.6GHz Intel Xeon(R) 4GB RAM
+        create_slave("zturner-win2008", properties={'jobs': 4}, max_builds=1),
         # Defunct.
 
 #        # GCC Compile Farm Slaves, see http://gcc.gnu.org/wiki/CompileFarm

Modified: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py?rev=225548&r1=225547&r2=225548&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py (original)
+++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py Fri Jan  9 15:48:57 2015
@@ -1,4 +1,5 @@
 import os
+import subprocess
 
 import buildbot
 import buildbot.process.factory
@@ -6,8 +7,122 @@ from buildbot.steps.source import SVN
 from buildbot.steps.shell import Configure, SetProperty
 from buildbot.steps.shell import ShellCommand, WarningCountingShellCommand
 from buildbot.process.properties import WithProperties
+import zorg.buildbot.commands.BatchFileDownload as batch_file_download
 from zorg.buildbot.commands.LitTestCommand import LitTestCommand
 
+def generateVisualStudioEnvironment(vs_install_dir, target_arch):
+    arch_arg = {'x86': 'x86', 'x64': 'amd64', 'amd64': 'amd64'}.get(target_arch, None)
+    if arch_arg is None:
+        return None
+    
+    vcvars_command = "\"" + os.path.join(vs_install_dir, 'VC', 'vcvarsall.bat') + "\""
+    vcvars_command = "%s %s && set" % (vcvars_command, arch_arg)
+    process = subprocess.Popen(vcvars_command, shell = True, stdout=subprocess.PIPE, stderr = None)
+    (stdout, _) = process.communicate()
+    vars = stdout.splitlines()
+    env = {}
+    # At some point it may be worth trying to see if we can create an trimmed down whitelist of only
+    # those environment variables which are necessary in order for the parts of the toolchain that
+    # we need, such as the compiler and linker.
+    for var in vars:
+        keyval_pair = var.split('=')
+        key = keyval_pair[0]
+        value = keyval_pair[1]
+        env[key] = value
+
+    return env
+
+# CMake Windows builds
+def getLLDBWindowsCMakeBuildFactory(
+            clean=True,
+            cmake='cmake',
+            jobs="%(jobs)s",
+
+            # Source directory containing a built python
+            python_source_dir=r'C:\src\python',
+
+            # Default values for VS version and build configuration
+            vs_install_dir=r'C:\Program Files (x86)\Microsoft Visual Studio 12.0',
+            config='Release',
+            target_arch='x86',
+
+            extra_cmake_args=[]):
+
+    ############# PREPARING
+    f = buildbot.process.factory.BuildFactory()
+
+    env = generateVisualStudioEnvironment(vs_install_dir, target_arch)
+
+    # We *must* checkout at least Clang, LLVM, and LLDB.  Once we add a step to run
+    # tests (e.g. ninja check-lldb), we will also need to add a step for LLD, since
+    # MSVC LD.EXE cannot link executables with DWARF debug info.
+    f.addStep(SVN(name='svn-llvm',
+                  mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/',
+                  defaultBranch='trunk',
+                  workdir='llvm'))
+    f.addStep(SVN(name='svn-clang',
+                  mode='update', baseURL='http://llvm.org/svn/llvm-project/cfe/',
+                  defaultBranch='trunk',
+                  workdir='llvm/tools/clang'))
+    f.addStep(SVN(name='svn-lldb',
+                  mode='update', baseURL='http://llvm.org/svn/llvm-project/lldb/',
+                  defaultBranch='trunk',
+                  workdir='llvm/tools/lldb'))
+
+    ninja_cmd=['ninja', WithProperties("-j%s" % jobs)]
+
+    # Global configurations
+    build_dir='build'
+
+    ############# CLEANING
+    if clean:
+        f.addStep(ShellCommand(name='clean',
+                               command=['rmdir', '/S/Q', build_dir],
+                               warnOnFailure=True,
+                               description='Cleaning',
+                               descriptionDone='clean',
+                               workdir='.',
+                               env=env))
+
+    if config.lower() == 'release':
+        python_lib = 'python27.lib'
+        python_exe = 'python.exe'
+    elif config.lower() == 'debug':
+        python_lib = 'python27_d.lib'
+        python_exe = 'python_d.exe'
+
+    python_lib = os.path.join(python_source_dir, 'PCbuild', python_lib)
+    python_exe = os.path.join(python_source_dir, 'PCbuild', python_exe)
+    python_include = os.path.join(python_source_dir, 'Include')
+
+    # Use batch files instead of ShellCommand directly, Windows quoting is
+    # borked. FIXME: See buildbot ticket #595 and buildbot ticket #377.
+    f.addStep(batch_file_download.BatchFileDownload(name='cmakegen',
+                                command=[cmake, "-G", "Ninja", "../llvm",
+                                         "-DCMAKE_BUILD_TYPE="+config,
+                                         # Need to use our custom built version of python
+                                         '-DPYTHON_LIBRARY=' + python_lib,
+                                         '-DPYTHON_INCLUDE_DIR=' + python_include,
+                                         '-DPYTHON_EXECUTABLE=' + python_exe]
+                                         + extra_cmake_args,
+                                workdir=build_dir))
+
+    f.addStep(ShellCommand(name='cmake',
+                           command=['cmakegen.bat'],
+                           haltOnFailure=True,
+                           description='cmake gen',
+                           workdir=build_dir,
+                           env=env))
+
+    f.addStep(WarningCountingShellCommand(name='build',
+                                          command=ninja_cmd,
+                                          haltOnFailure=True,
+                                          description='ninja build',
+                                          workdir=build_dir,
+                                          env=env))
+
+    return f
+
 def getLLDBBuildFactory(
             triple,
             outOfDir=False,





More information about the llvm-commits mailing list