From 4da9aa62c7490c6a2275cdd38c9399aacb813e66 Mon Sep 17 00:00:00 2001 From: arvidn Date: Tue, 18 May 2021 18:54:26 +0200 Subject: [PATCH] add support for building a debug build with sanitizers of the chiavdf python module --- README.md | 8 ++++++++ setup.py | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3264cbc0..7dd67362 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,14 @@ If you're running a timelord, the following tests are available, depending of wh Those tests will simulate the vdf_client and verify for correctness the produced proofs. +## Debug builds + +To build and install a debug build of the python module, run: + +```bash +python setup.py build_ext --debug install +``` + ## Contributing and workflow Contributions are welcome and more details are available in chia-blockchain's diff --git a/setup.py b/setup.py index e84f7fdc..143dafa1 100644 --- a/setup.py +++ b/setup.py @@ -130,6 +130,8 @@ def build_extension(self, ext): build_args += ["--", "/m"] else: cmake_args += ["-DCMAKE_BUILD_TYPE=" + cfg] + cmake_args += ["-DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address -fsanitize=undefined", + "-DCMAKE_LINKER_FLAGS_DEBUG=-fsanitize=address -fsanitize=undefined"] build_args += ["--", "-j", "6"] env = os.environ.copy() @@ -137,7 +139,7 @@ def build_extension(self, ext): env.get("CXXFLAGS", ""), self.distribution.get_version() ) subprocess.check_call(["cmake", ext.sourcedir] + cmake_args, env=env) - subprocess.check_call(["cmake", "--build", "."] + build_args) + subprocess.check_call(["cmake", "--build", "."] + build_args + ["--", "VERBOSE=1"]) class get_pybind_include(object):