Skip to content

Commit e783922

Browse files
committed
build: try just passing the heap map C++ file to the extension build
1 parent 4428c28 commit e783922

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

setup.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -608,23 +608,6 @@ def get_exts_for(name):
608608

609609
extra_libraries = []
610610
if not IS_PYSTON:
611-
# To make it easier to mix C and C++ for the memalloc extension,
612-
# we build the C++ part as a separate static library and link it into the extension.
613-
if CURRENT_OS != "Windows":
614-
# Shot in the dark, but try setting the archiver explicitly
615-
# here so that it can be resolved via the PATH at runtime?
616-
# Just in case the sysconfig for the Python interpreter points
617-
# to a weird archiver installation...
618-
os.environ["AR"] = "ar"
619-
memalloc_map_lib = (
620-
"memalloc_map",
621-
{
622-
"sources": ["ddtrace/profiling/collector/_memalloc_heap_map.cpp"],
623-
"include_dirs": [get_python_inc()],
624-
"cflags": (debug_compile_args + (["-std=c++17"] if CURRENT_OS != "Windows" else ["/std:c++17"])),
625-
},
626-
)
627-
extra_libraries.append(memalloc_map_lib)
628611
ext_modules = [
629612
Extension(
630613
"ddtrace.profiling.collector._memalloc",
@@ -633,17 +616,17 @@ def get_exts_for(name):
633616
"ddtrace/profiling/collector/_memalloc_tb.c",
634617
"ddtrace/profiling/collector/_memalloc_heap.c",
635618
"ddtrace/profiling/collector/_memalloc_reentrant.c",
619+
"ddtrace/profiling/collector/_memalloc_heap_map.cpp",
636620
],
637621
depends=["ddtrace/profiling/collector/_memalloc_heap_map.h"],
638-
libraries=["memalloc_map"] + (["stdc++"] if CURRENT_OS != "Windows" else [])
639622
extra_compile_args=(
640623
debug_compile_args
641624
# If NDEBUG is set, assert statements are compiled out. Make
642625
# sure we explicitly set this for normal builds, and explicitly
643626
# _unset_ it for debug builds in case the CFLAGS from sysconfig
644627
# include -DNDEBUG
645628
+ (["-DNDEBUG"] if not debug_compile_args else ["-UNDEBUG"])
646-
+ ["-D_POSIX_C_SOURCE=200809L", "-std=c11"]
629+
+ ["-D_POSIX_C_SOURCE=200809L"]
647630
+ fast_build_args
648631
if CURRENT_OS != "Windows"
649632
else ["/std:c11"]

0 commit comments

Comments
 (0)