Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 1 | import os |
| 2 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 3 | import buildbot |
| 4 | import buildbot.process.factory |
| 5 | from buildbot.steps.source import SVN |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 6 | from buildbot.steps.shell import Configure, ShellCommand |
| 7 | from buildbot.steps.shell import WarningCountingShellCommand |
| 8 | from buildbot.steps.transfer import FileDownload |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 9 | from buildbot.process.properties import WithProperties |
| 10 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 11 | from zorg.buildbot.commands.ClangTestCommand import ClangTestCommand |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 12 | from zorg.buildbot.commands.BatchFileDownload import BatchFileDownload |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 13 | from zorg.buildbot.commands import DejaGNUCommand |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 14 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 15 | from Util import getConfigArgs |
| 16 | |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 17 | def getClangBuildFactory(triple=None, clean=True, test=True, package_dst=None, |
| 18 | run_cxx_tests=False, examples=False, valgrind=False, |
Daniel Dunbar | a1bebce | 2010-03-21 01:24:00 +0000 | [diff] [blame] | 19 | valgrindLeakCheck=False, outOfDir=False, useTwoStage=False, |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 20 | completely_clean=False, always_install=False, |
| 21 | make='make', jobs="%(jobs)s", |
Daniel Dunbar | 7e33e04 | 2010-07-14 20:34:16 +0000 | [diff] [blame] | 22 | stage1_config='Debug+Asserts', |
| 23 | stage2_config='Release+Asserts', |
Daniel Dunbar | f4e23eb | 2010-09-20 21:13:02 +0000 | [diff] [blame] | 24 | extra_configure_args=[], use_pty_in_tests=False, |
| 25 | checkout_compiler_rt=False): |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 26 | # Don't use in-dir builds with a two stage build process. |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 27 | inDir = not outOfDir and not useTwoStage |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 28 | if inDir: |
| 29 | llvm_srcdir = "llvm" |
| 30 | llvm_1_objdir = "llvm" |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 31 | if always_install: |
| 32 | llvm_1_installdir = "llvm.install" |
| 33 | else: |
| 34 | llvm_1_installdir = None |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 35 | else: |
| 36 | llvm_srcdir = "llvm.src" |
| 37 | llvm_1_objdir = "llvm.obj" |
| 38 | llvm_1_installdir = "llvm.install.1" |
| 39 | llvm_2_objdir = "llvm.obj.2" |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 40 | llvm_2_installdir = "llvm.install" |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 41 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 42 | f = buildbot.process.factory.BuildFactory() |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 43 | |
| 44 | # Determine the build directory. |
| 45 | f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir", |
| 46 | command=["pwd"], |
| 47 | property="builddir", |
| 48 | description="set build dir", |
| 49 | workdir=".")) |
| 50 | |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 51 | # Blow away completely, if requested. |
| 52 | if completely_clean: |
| 53 | f.addStep(ShellCommand(name="rm-llvm.src", |
| 54 | command=["rm", "-rf", llvm_srcdir], |
| 55 | haltOnFailure=True, |
| 56 | description=["rm src dir", "llvm"], |
| 57 | workdir=".")) |
| 58 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 59 | # Checkout sources. |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 60 | f.addStep(SVN(name='svn-llvm', |
Daniel Dunbar | f4e23eb | 2010-09-20 21:13:02 +0000 | [diff] [blame] | 61 | mode='update', |
| 62 | baseURL='http://llvm.org/svn/llvm-project/llvm/', |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 63 | defaultBranch='trunk', |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 64 | workdir=llvm_srcdir)) |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 65 | f.addStep(SVN(name='svn-clang', |
Daniel Dunbar | f4e23eb | 2010-09-20 21:13:02 +0000 | [diff] [blame] | 66 | mode='update', |
| 67 | baseURL='http://llvm.org/svn/llvm-project/cfe/', |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 68 | defaultBranch='trunk', |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 69 | workdir='%s/tools/clang' % llvm_srcdir)) |
Daniel Dunbar | f4e23eb | 2010-09-20 21:13:02 +0000 | [diff] [blame] | 70 | if checkout_compiler_rt: |
| 71 | f.addStep(SVN(name='svn-compiler-rt', |
| 72 | mode='update', |
| 73 | baseURL='http://llvm.org/svn/llvm-project/compiler-rt/', |
| 74 | defaultBranch='trunk', |
Daniel Dunbar | eb68fd2 | 2010-09-21 05:00:06 +0000 | [diff] [blame] | 75 | workdir='%s/projects/compiler-rt' % llvm_srcdir)) |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 76 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 77 | # Clean up llvm (stage 1); unless in-dir. |
| 78 | if clean and llvm_srcdir != llvm_1_objdir: |
| 79 | f.addStep(ShellCommand(name="rm-llvm.obj.stage1", |
| 80 | command=["rm", "-rf", llvm_1_objdir], |
| 81 | haltOnFailure=True, |
| 82 | description=["rm build dir", "llvm"], |
| 83 | workdir=".")) |
| 84 | |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 85 | # Force without llvm-gcc so we don't run afoul of Frontend test failures. |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 86 | base_configure_args = [WithProperties("%%(builddir)s/%s/configure" % llvm_srcdir), |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 87 | '--disable-bindings'] |
| 88 | base_configure_args += extra_configure_args |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 89 | if triple: |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 90 | base_configure_args += ['--build=%s' % triple, |
| 91 | '--host=%s' % triple, |
| 92 | '--target=%s' % triple] |
| 93 | args = base_configure_args + ["--without-llvmgcc", "--without-llvmgxx"] |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 94 | args.append(WithProperties("--prefix=%%(builddir)s/%s" % llvm_1_installdir)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 95 | args += getConfigArgs(stage1_config) |
| 96 | f.addStep(Configure(command=args, |
| 97 | workdir=llvm_1_objdir, |
| 98 | description=['configuring',stage1_config], |
| 99 | descriptionDone=['configure',stage1_config])) |
| 100 | |
| 101 | # Make clean if using in-dir builds. |
| 102 | if clean and llvm_srcdir == llvm_1_objdir: |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 103 | f.addStep(WarningCountingShellCommand(name="clean-llvm", |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 104 | command=[make, "clean"], |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 105 | haltOnFailure=True, |
| 106 | description="cleaning llvm", |
| 107 | descriptionDone="clean llvm", |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 108 | workdir=llvm_1_objdir)) |
| 109 | |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 110 | f.addStep(WarningCountingShellCommand(name="compile", |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 111 | command=['nice', '-n', '10', |
| 112 | make, WithProperties("-j%s" % jobs)], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 113 | haltOnFailure=True, |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 114 | description=["compiling", stage1_config], |
| 115 | descriptionDone=["compile", stage1_config], |
| 116 | workdir=llvm_1_objdir)) |
Daniel Dunbar | 256fed4 | 2009-11-25 21:11:08 +0000 | [diff] [blame] | 117 | |
| 118 | if examples: |
| 119 | f.addStep(WarningCountingShellCommand(name="compile.examples", |
| 120 | command=['nice', '-n', '10', |
| 121 | make, WithProperties("-j%s" % jobs), |
| 122 | "BUILD_EXAMPLES=1"], |
| 123 | haltOnFailure=True, |
| 124 | description=["compilinge", stage1_config, "examples"], |
| 125 | descriptionDone=["compile", stage1_config, "examples"], |
| 126 | workdir=llvm_1_objdir)) |
| 127 | |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 128 | clangTestArgs = llvmTestArgs = '-v -j %s' % jobs |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 129 | if valgrind: |
Daniel Dunbar | 89184b9 | 2010-04-18 19:09:32 +0000 | [diff] [blame] | 130 | clangTestArgs += ' --vg' |
Daniel Dunbar | a1bebce | 2010-03-21 01:24:00 +0000 | [diff] [blame] | 131 | if valgrindLeakCheck: |
| 132 | clangTestArgs += ' --vg-leak' |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 133 | clangTestArgs += ' --vg-arg --suppressions=%(builddir)s/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp' |
| 134 | extraTestDirs = '' |
| 135 | if run_cxx_tests: |
| 136 | extraTestDirs += '%(builddir)s/llvm/tools/clang/utils/C++Tests' |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 137 | if test: |
| 138 | f.addStep(ClangTestCommand(name='test-llvm', |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 139 | command=[make, "check-lit", "VERBOSE=1", |
| 140 | WithProperties("LIT_ARGS=%s" % llvmTestArgs)], |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 141 | description=["testing", "llvm"], |
| 142 | descriptionDone=["test", "llvm"], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 143 | workdir=llvm_1_objdir, |
| 144 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 145 | f.addStep(ClangTestCommand(name='test-clang', |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 146 | command=[make, 'test', WithProperties('TESTARGS=%s' % clangTestArgs), |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 147 | WithProperties('EXTRA_TESTDIRS=%s' % extraTestDirs)], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 148 | workdir='%s/tools/clang' % llvm_1_objdir, |
| 149 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 150 | |
| 151 | # Install llvm and clang. |
| 152 | if llvm_1_installdir: |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 153 | f.addStep(ShellCommand(name="rm-install.clang.stage1", |
| 154 | command=["rm", "-rf", llvm_1_installdir], |
| 155 | haltOnFailure=True, |
| 156 | description=["rm install dir", "clang"], |
| 157 | workdir=".")) |
| 158 | f.addStep(WarningCountingShellCommand(name="install.clang.stage1", |
| 159 | command = ['nice', '-n', '10', |
| 160 | make, 'install-clang'], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 161 | haltOnFailure=True, |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 162 | description=["install", "clang", |
| 163 | stage1_config], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 164 | workdir=llvm_1_objdir)) |
| 165 | |
| 166 | if not useTwoStage: |
| 167 | return f |
| 168 | |
| 169 | # Clean up llvm (stage 2). |
| 170 | if clean: |
| 171 | f.addStep(ShellCommand(name="rm-llvm.obj.stage2", |
| 172 | command=["rm", "-rf", llvm_2_objdir], |
| 173 | haltOnFailure=True, |
| 174 | description=["rm build dir", "llvm", "(stage 2)"], |
| 175 | workdir=".")) |
| 176 | |
| 177 | # Configure llvm (stage 2). |
| 178 | args = base_configure_args + ["--without-llvmgcc", "--without-llvmgxx"] |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 179 | args.append(WithProperties("--prefix=%(builddir)s/" + llvm_2_installdir)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 180 | args += getConfigArgs(stage2_config) |
| 181 | f.addStep(Configure(name="configure.llvm.stage2", |
| 182 | command=args, |
| 183 | env={'CC' : WithProperties("%%(builddir)s/%s/bin/clang" % llvm_1_installdir), |
| 184 | 'CXX' : WithProperties("%%(builddir)s/%s/bin/clang++" % llvm_1_installdir),}, |
| 185 | haltOnFailure=True, |
| 186 | workdir=llvm_2_objdir, |
| 187 | description=["configure", "llvm", "(stage 2)", |
| 188 | stage2_config])) |
| 189 | |
| 190 | # Build llvm (stage 2). |
| 191 | f.addStep(WarningCountingShellCommand(name="compile.llvm.stage2", |
| 192 | command=['nice', '-n', '10', |
| 193 | make, WithProperties("-j%s" % jobs)], |
| 194 | haltOnFailure=True, |
| 195 | description=["compiling", "(stage 2)", |
| 196 | stage2_config], |
| 197 | descriptionDone=["compile", "(stage 2)", |
| 198 | stage2_config], |
| 199 | workdir=llvm_2_objdir)) |
| 200 | |
| 201 | if test: |
| 202 | f.addStep(ClangTestCommand(name='test-llvm', |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 203 | command=[make, "check-lit", "VERBOSE=1", |
| 204 | WithProperties("LIT_ARGS=%s" % llvmTestArgs)], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 205 | description=["testing", "llvm"], |
| 206 | descriptionDone=["test", "llvm"], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 207 | workdir=llvm_2_objdir, |
| 208 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 209 | f.addStep(ClangTestCommand(name='test-clang', |
| 210 | command=[make, 'test', WithProperties('TESTARGS=%s' % clangTestArgs), |
| 211 | WithProperties('EXTRA_TESTDIRS=%s' % extraTestDirs)], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 212 | workdir='%s/tools/clang' % llvm_2_objdir, |
| 213 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 214 | |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 215 | # Install clang (stage 2). |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 216 | f.addStep(ShellCommand(name="rm-install.clang.stage2", |
| 217 | command=["rm", "-rf", llvm_2_installdir], |
| 218 | haltOnFailure=True, |
| 219 | description=["rm install dir", "clang"], |
| 220 | workdir=".")) |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 221 | f.addStep(WarningCountingShellCommand(name="install.clang.stage2", |
| 222 | command = ['nice', '-n', '10', |
| 223 | make, 'install-clang'], |
| 224 | haltOnFailure=True, |
| 225 | description=["install", "clang", |
| 226 | "(stage 2)"], |
| 227 | workdir=llvm_2_objdir)) |
| 228 | |
| 229 | if package_dst: |
| 230 | name = WithProperties( |
| 231 | "%(builddir)s/" + llvm_2_objdir + |
| 232 | "/clang-r%(got_revision)s-b%(buildnumber)s.tgz") |
| 233 | f.addStep(ShellCommand(name='pkg.tar', |
| 234 | description="tar root", |
| 235 | command=["tar", "zcvf", name, "./"], |
| 236 | workdir=llvm_2_installdir, |
| 237 | warnOnFailure=True, |
| 238 | flunkOnFailure=False, |
| 239 | haltOnFailure=False)) |
| 240 | f.addStep(ShellCommand(name='pkg.upload', |
| 241 | description="upload root", |
| 242 | command=["scp", name, |
| 243 | WithProperties( |
| 244 | package_dst + "/%(buildername)s")], |
| 245 | workdir=".", |
| 246 | warnOnFailure=True, |
| 247 | flunkOnFailure=False, |
| 248 | haltOnFailure=False)) |
| 249 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 250 | return f |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 251 | |
Daniel Dunbar | c51a59e | 2010-09-23 14:57:45 +0000 | [diff] [blame] | 252 | def getClangMSVCBuildFactory(update=True, clean=True, vcDrive='c', jobs=1, cmake=r"cmake"): |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 253 | f = buildbot.process.factory.BuildFactory() |
| 254 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 255 | if update: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 256 | f.addStep(SVN(name='svn-llvm', |
| 257 | mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/', |
| 258 | defaultBranch='trunk', |
| 259 | workdir='llvm')) |
| 260 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 261 | if update: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 262 | f.addStep(SVN(name='svn-clang', |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 263 | mode='update', baseURL='http://llvm.org/svn/llvm-project/cfe/', |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 264 | defaultBranch='trunk', |
| 265 | workdir='llvm/tools/clang')) |
| 266 | |
| 267 | # Full & fast clean. |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 268 | if clean: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 269 | f.addStep(ShellCommand(name='clean-1', |
| 270 | command=['del','/s/q','build'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 271 | warnOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 272 | description='cleaning', |
| 273 | descriptionDone='clean', |
| 274 | workdir='llvm')) |
| 275 | f.addStep(ShellCommand(name='clean-2', |
| 276 | command=['rmdir','/s/q','build'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 277 | warnOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 278 | description='cleaning', |
| 279 | descriptionDone='clean', |
| 280 | workdir='llvm')) |
| 281 | |
| 282 | # Create the project files. |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 283 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 284 | # Use batch files instead of ShellCommand directly, Windows quoting is |
| 285 | # borked. FIXME: See buildbot ticket #595 and buildbot ticket #377. |
| 286 | f.addStep(BatchFileDownload(name='cmakegen', |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 287 | command=[cmake, |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 288 | "-DLLVM_TARGETS_TO_BUILD:=X86", |
Daniel Dunbar | 1ddedce | 2010-09-24 19:57:34 +0000 | [diff] [blame^] | 289 | "-DLLVM_INCLUDE_EXAMPLES:=OFF", |
| 290 | "-DLLVM_INCLUDE_TESTS:=OFF", |
| 291 | "-DLLVM_TARGETS_TO_BUILD:=X86", |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 292 | "-G", |
| 293 | "Visual Studio 9 2008", |
| 294 | ".."], |
| 295 | workdir="llvm\\build")) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 296 | f.addStep(ShellCommand(name='cmake', |
| 297 | command=['cmakegen.bat'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 298 | haltOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 299 | description='cmake gen', |
| 300 | workdir='llvm\\build')) |
| 301 | |
| 302 | # Build it. |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 303 | f.addStep(BatchFileDownload(name='vcbuild', |
| 304 | command=[vcDrive + r""":\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages\vcbuild.exe""", |
| 305 | "/M%d" % jobs, |
| 306 | "LLVM.sln", |
| 307 | "Debug|Win32"], |
| 308 | workdir="llvm\\build")) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 309 | f.addStep(WarningCountingShellCommand(name='vcbuild', |
| 310 | command=['vcbuild.bat'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 311 | haltOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 312 | description='vcbuild', |
| 313 | workdir='llvm\\build', |
| 314 | warningPattern=" warning C.*:")) |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 315 | |
| 316 | # Build clang-test project. |
| 317 | f.addStep(BatchFileDownload(name='vcbuild_test', |
| 318 | command=[vcDrive + r""":\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages\vcbuild.exe""", |
| 319 | "clang-test.vcproj", |
| 320 | "Debug|Win32"], |
| 321 | workdir="llvm\\build\\tools\\clang\\test")) |
| 322 | f.addStep(ClangTestCommand(name='test-clang', |
| 323 | command=["vcbuild_test.bat"], |
| 324 | workdir="llvm\\build\\tools\\clang\\test")) |
| 325 | |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 326 | return f |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 327 | |
| 328 | def addClangTests(f, ignores={}): |
| 329 | make_vars = [WithProperties( |
| 330 | 'CC_UNDER_TEST=%(builddir)s/llvm.install/bin/clang'), |
| 331 | WithProperties( |
| 332 | 'CXX_UNDER_TEST=%(builddir)s/llvm.install/bin/clang++')] |
| 333 | f.addStep(SVN(name='svn-clang-tests', mode='update', |
| 334 | baseURL='http://llvm.org/svn/llvm-project/clang-tests/', |
| 335 | defaultBranch='trunk', workdir='clang-tests')) |
| 336 | gcc_dg_ignores = ignores.get('gcc-4_2-testsuite', {}) |
| 337 | for lang in ('gcc', 'g++', 'objc', 'obj-c++'): |
| 338 | f.addStep(DejaGNUCommand.DejaGNUCommand( |
| 339 | name='test-gcc-4_2-testsuite-%s' % lang, |
| 340 | command=["make", "-k", "check-%s" % lang] + make_vars, |
| 341 | description="gcc-4_2-testsuite (%s)" % lang, |
| 342 | workdir='clang-tests/gcc-4_2-testsuite', |
| 343 | logfiles={ 'dg.sum' : 'obj/%s/%s.sum' % (lang, lang) }, |
| 344 | ignore=gcc_dg_ignores.get(lang, []))) |