Index: zorg/buildbot/builders/ClangAndLLDBuilder.py =================================================================== --- zorg/buildbot/builders/ClangAndLLDBuilder.py +++ zorg/buildbot/builders/ClangAndLLDBuilder.py @@ -101,16 +101,38 @@ if isMSVC: options = [] if extraCompilerOptions: + assert type(extraCompilerOptions)==list, \ + """"Please make sure a list type is assigned to the extraCompilerOptions argument, + %s was detected.""" % type(extraCompilerOptions) + for items in extraCompilerOptions: + assert type(items)==str, \ + """"Strings are the only acceptable type for items in extraCompilerOptions, + the value %s was entered and it is %s.""" % (items,type(items)) options += extraCompilerOptions if buildWithSanitizerOptions: + assert type(buildWithSanitizerOptions)==list, \ + """Please make sure a list type is assigned to the buildWithSanitizerOptions argument, + %s was detected.""" % type(buildWithSanitizerOptions) + for items in buildWithSanitizerOptions: + assert type(items)==str, \ + """"Strings are the only acceptable type for items in buildWithSanitizerOptions, + the value %s was entered and it is %s.""" % (items,type(items)) options += buildWithSanitizerOptions lit_args = ["-v"] if extraLitArgs: + assert type(extraLitArgs)==list, \ + """Please make sure a list type is assigned to the extraLitArgs argument, + %s was detected.""" % type(extraLitArgs) + for items in extraLitArgs: + assert type(items)==str, \ + """"Strings are the only acceptable type for items in extraLitArgs, + the value %s was entered and it is %s.""" % (items,type(items)) lit_args += extraLitArgs - lit_args_str = "-DLLVM_LIT_ARGS=\"%s\"" % (" ".join(lit_args)) + lit_args = ["-DLLVM_LIT_ARGS=\"%s\"" % (" ".join(lit_args))] + cmakeCommand = [ "cmake", "-DCMAKE_BUILD_TYPE=Release", @@ -122,12 +144,23 @@ "-DCMAKE_CXX_COMPILER=clang++" ] if triple: - cmakeCommand += [ - "-DLLVM_DEFAULT_TARGET_TRIPLE=%s" % triple - ] + assert type(triple)==str, \ + """Please make sure a string type is assigned to the triple argument, + %s was detected.""" % type(triple) + cmakeCommand += ["-DLLVM_DEFAULT_TARGET_TRIPLE=%s" % triple] if extraCmakeOptions: - assert not any(a.startswith('-DLLVM_LIT_ARGS=') for a in extraCmakeOptions), "Please use extraLitArgs for LIT arguments instead of defining them in extraCmakeOptions." + assert type(extraCmakeOptions)==list, \ + """Please make sure a list type is assigned to the extraCmakeOptions argument, + %s was detected.""" % type(extraCmakeOptions) + for items in extraCmakeOptions: + assert type(items)==str, \ + """"Strings are the only acceptable type for items in extraCmakeOptions, + the value %s was entered and it is %s.""" % (items,type(items)) + # We need a special assert here to ensure a duplicate -DLLVM_LIT_ARGS + # is not passed in by mistake. + assert not items.startswith('-DLLVM_LIT_ARGS='), \ + "Please use extraLitArgs for LIT arguments instead of defining them in extraCmakeOptions." cmakeCommand += extraCmakeOptions if not isMSVC: @@ -135,9 +168,9 @@ "-DCMAKE_C_FLAGS=\"%s\"" % (" ".join(options)), "-DCMAKE_CXX_FLAGS=\"-std=c++11 %s\"" % (" ".join(options)), ] - cmakeCommand += lit_args_str + cmakeCommand += lit_args cmakeCommand += [ - "-G", "Ninja", + "-GNinja", "../%s" % llvm_srcdir ]