Explorar el Código

Merge pull request #7331 from ThomasWaldmann/undefine-ndebug-master

undef NDEBUG for chunker and hashindex
TW hace 2 años
padre
commit
79d6835738
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      setup.py

+ 4 - 2
setup.py

@@ -186,12 +186,14 @@ if not on_rtd:
         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),
     ]