From 311ac55ebda45aaa2d93b5a41d98c439caa961bf Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 9 Feb 2023 20:59:14 +0100 Subject: [PATCH] undef NDEBUG for chunker and hashindex note: intentionally not undef'ing it for all the cython-only generated C code. --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 157be2c32..95d180c65 100644 --- a/setup.py +++ b/setup.py @@ -186,12 +186,14 @@ def lib_ext_kwargs(pc, prefix_env_var, lib_name, lib_pkg_name, pc_version, lib_s dict(extra_compile_args=cflags), ) + # note: _chunker.c and _hashindex.c are relatively complex/large pieces of handwritten C code, + # thus we undef NDEBUG for them, so the compiled code will contain and execute assert(). ext_modules += [ Extension("borg.crypto.low_level", **crypto_ext_kwargs), Extension("borg.compress", **compress_ext_kwargs), - Extension("borg.hashindex", [hashindex_source], extra_compile_args=cflags), + Extension("borg.hashindex", [hashindex_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]), Extension("borg.item", [item_source], extra_compile_args=cflags), - Extension("borg.chunker", [chunker_source], extra_compile_args=cflags), + Extension("borg.chunker", [chunker_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]), Extension("borg.checksums", **checksums_ext_kwargs), ]