[PATCH] D29677: [buildbot] Add check-fuzzer to Asan buildbot on Windows.
Marcos Pividori via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 8 11:01:18 PST 2017
mpividori updated this revision to Diff 87676.
mpividori added a comment.
Let mw know if you agree with this diff. I use `Interpolate()` and I update PATH in the `slave_env`.
https://reviews.llvm.org/D29677
Files:
zorg/buildbot/builders/SanitizerBuilderWindows.py
Index: zorg/buildbot/builders/SanitizerBuilderWindows.py
===================================================================
--- zorg/buildbot/builders/SanitizerBuilderWindows.py
+++ zorg/buildbot/builders/SanitizerBuilderWindows.py
@@ -7,6 +7,7 @@
from buildbot.steps.slave import RemoveDirectory
from buildbot.steps.source import SVN
from buildbot.process.properties import Property
+from buildbot.process.properties import Interpolate
from zorg.buildbot.builders.Util import getVisualStudioEnvironment
from zorg.buildbot.builders.Util import extractSlaveEnvironment
from zorg.buildbot.commands.NinjaCommand import NinjaCommand
@@ -64,6 +65,7 @@
# Global configurations
build_dir='build'
+ build_fuzzer_dir='build-fuzzer'
############# CLEANING
cleanBuildRequested = lambda step: step.build.getProperty("clean") or clean
@@ -112,4 +114,69 @@
workdir=build_dir,
env=Property('slave_env')))
+ # Clean fuzzer build dir.
+ f.addStep(RemoveDirectory(name='clean '+build_fuzzer_dir,
+ dir=build_fuzzer_dir,
+ haltOnFailure=False,
+ flunkOnFailure=False,
+ doStepIf=cleanBuildRequested
+ ))
+
+ # Get absolute path to build dir.
+ f.addStep(SetProperty(name="get_builddir",
+ command=["pwd"],
+ property="builddir",
+ description="set build dir",
+ workdir=build_dir))
+
+ # Get clang version.
+ lib_clang_dir = "%(prop:builddir)s\\" + config + "\\lib\\clang"
+ f.addStep(SetProperty(name="get clang version",
+ command=["dir", "/b", Interpolate(lib_clang_dir)],
+ property="clang_version",
+ description="get clang version",
+ workdir=build_dir))
+
+ # Get compiler-rt's libraries dir.
+ dll_path = lib_clang_dir + "\\%(prop:clang_version)s\\lib\\windows"
+ # Get binary dir.
+ bin_path = "%(prop:builddir)s\\" + config + "\\bin"
+ # Get absolute path to clang-cl.
+ clang_cl = bin_path + "\\clang-cl"
+
+ # Update slave_env to add fresh clang, tools and compiler-rt dlls to path.
+ update_path_cmd = "set Path=\""+bin_path+";"+dll_path+";%Path%\" && set"
+ f.addStep(SetProperty(command=Interpolate(update_path_cmd),
+ extract_fn=extractSlaveEnvironment,
+ env=Property('slave_env')))
+
+ f.addStep(ShellCommand(name='cmake',
+ command=[cmake, "-G", "Ninja", "../llvm",
+ "-DCMAKE_BUILD_TYPE="+config,
+ "-DLLVM_ENABLE_ASSERTIONS=ON",
+ Interpolate("-DCMAKE_C_COMPILER="+clang_cl),
+ Interpolate("-DCMAKE_CXX_COMPILER="+clang_cl),
+ "-DLLVM_USE_SANITIZER=Address",
+ "-DLLVM_USE_SANITIZE_COVERAGE=YES"]
+ + extra_cmake_args,
+ haltOnFailure=True,
+ workdir=build_fuzzer_dir,
+ env=Property('slave_env')))
+
+ # Build libFuzzer.
+ f.addStep(NinjaCommand(name='build LLVMFuzzer',
+ targets=['LLVMFuzzer'],
+ haltOnFailure=True,
+ description='ninja LLVMFuzzer',
+ workdir=build_dir,
+ env=Property('slave_env')))
+
+ # Run libFuzzer's tests.
+ f.addStep(NinjaCommand(name='run fuzzer tests',
+ targets=['check-fuzzer'],
+ haltOnFailure=True,
+ description='ninja check-fuzzer',
+ workdir=build_fuzzer_dir,
+ env=Property('slave_env')))
+
return f
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29677.87676.patch
Type: text/x-patch
Size: 4021 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170208/45fa17c2/attachment.bin>
More information about the llvm-commits
mailing list