[PATCH] [zorg] Support Windows/Linux Clang CMake builds with unified builder.

Rick Foos rfoos at codeaurora.org
Wed Jan 21 16:23:34 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: zorg/buildbot/builders/ClangBuilder.py:68
@@ +67,3 @@
+
+SCMs = {'SVN':scmSvn,'GIT':scmGit}
+
----------------
gkistanova wrote:
> May I suggest using scmSvn and scmGit functions references directly in the arrays in llvmSourceTree?
> You do not need another mapping between a string and a function, really.
> 
> And maybe better names? How about SVN and Git (no need to import SVN and Git from buildbot.steps.source in this case, just use fully qualified names in the local SVN and Git implementation)? :)
> 
> The source definition would look like
> 
>     'svn-llvm': [SVN,"%s",'http://llvm.org/svn/llvm-project/llvm/','trunk','update'],
> 
Excellent idea. I need to get my head around it a little better, but I'll do it.

================
Comment at: zorg/buildbot/builders/ClangBuilder.py:523
@@ +522,3 @@
+            'useTwoStage': True,
+            'test': 'ignoreFail',
+            },
----------------
gkistanova wrote:
> How about using just one parameter 'usePreviousStageResults' (or some better name) instead of useTwoStage and useBuiltClang?
> 
> Besides, since we support multiple stages, useTwoStage sounds a bit misleading.
> 
> This is a cosmetic issue, not a show stopper.
> 
Using one previous stage results is much better.

Eliminating defaults from the argument list is a great idea. I left the argument list as a working example as there are quite a few things that need to be entered/remembered.

================
Comment at: zorg/buildbot/builders/ClangBuilder.py:541
@@ +540,3 @@
+            ],
+            update=[] # Update each stage [{},...]
+            ):
----------------
gkistanova wrote:
> I feel like I'm missing a use case for the update parameter. Could you elaborate, please?
> 
Rather than tackling re-defining the entire list, I found MSVC followed by a clang built compiler easier to do with an update to the original list.

Probably will need something to document all the things you can do with this.

    ClangBuilder.getCMakeBuildFactory(
                    update=[
                    {
                    'cmakeGenerator': "Visual Studio 12",
                    'cmakeProjectfile': "ALL_BUILD.vcxproj",
                    # MSBuild command with user arguments.
                    'build_cmd': ["MSBuild","/p:Configuration=RelWithDebInfo",
                    "/maxcpucount", "ALL_BUILD.vcxproj"],
                    'install_cmd': ["MSBuild","/p:Configuration=RelWithDebInfo",
                    "/maxcpucount", "INSTALL.vcxproj"],
                    'check_cmd': ["MSBuild","/p:Configuration=RelWithDebInfo",
                    "/maxcpucount", "check-clang.vcxproj"],
                    'check_dir': 'stage1/tools/clang/test',
                    'slave_envCmd': r""""%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" %PROCESSOR_ARCHITECTURE% & set""",
                    'extra_cmake_args': [
                     '-DLLVM_BUILD_RUNTIME:BOOL=OFF',
                     '-DLIBCLANG_BUILD_STATIC=ON',
                     '-DLLVM_ENABLE_PIC:BOOL=ON',
                     '-DLLVM_MINIMAL_INSTALL:BOOL=ON',
                     '-DLLVM_ENABLE_ASSERTIONS:BOOL=ON',
                     '-DLLVM_ENABLE_STATS:BOOL=ON',
                     '-DLLVM_LIT_ARGS:STRING=--verbose --no-progress-bar --param build_config=Win32',
                     '-DCMAKE_BUILD_TYPE=RelWithDebInfo',
                     '-DLLVM_APPEND_VC_REV:BOOL=ON',
                     "-DLLVM_TARGETS_TO_BUILD='Hexagon'"
                    "-DTARGET_TRIPLE:STRING=hexagon-unknown-elf",
                    "-DLLVM_DEFAULT_TARGET_TRIPLE:STRING=hexagon-unknown-elf",
                    "-DLLVM_TARGET_ARCH:STRING=hexagon-unknown-elf"
                     ]})

I haven't figured out how to delete a key with update. I may need to go back around and check for both keys and values so that everything can be updated.

Using defaults more intelligently will this by reducing the number of entries.


================
Comment at: zorg/buildbot/builders/ClangBuilder.py:563
@@ +562,3 @@
+            f = getLLVMSource(f,stage_source,stage['source'])
+            haveSource = True
+
----------------
gkistanova wrote:
> You do not really use haveSource, do you?
> What was the original idea?
If you don't specify source and try to build something, what should I do and how should I do it.

I haven't figured that out yet. Bombing out of a checkconfig would be the best way, but I don't know of a way to do it and pass back why something failed yet.

================
Comment at: zorg/buildbot/builders/ClangBuilder.py:652
@@ +651,3 @@
+
+def XorY(x,y):
+    return x or y
----------------
gkistanova wrote:
> It looks like this function is not used.
> 
Yes, I used it in the routine below (which will be replaced by this routine). I'll remove it.

http://reviews.llvm.org/D6866

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list