From 6f0f0adc3b715ff937eb57849f29c57c47979eef Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 11:06:41 -0500 Subject: [PATCH 01/37] ci: build for arm64 instead of universal2 for mac --- .github/workflows/build_python_3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index a3d6066dc0c..1d3ea1d0744 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -35,7 +35,7 @@ jobs: cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \ && cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \ && cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,universal2 | jq -cR '{only: ., os: "macos-13"}' + && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | jq -cR '{only: ., os: "macos-13"}' } | jq -sc ) echo $MATRIX_INCLUDE From a9936f8ff9a977bf0ae5956972da2606fbe48be0 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 11:11:03 -0500 Subject: [PATCH 02/37] use latest to build on m1, and so build for universal2 --- .github/workflows/build_python_3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 1d3ea1d0744..8bc2204e60e 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -35,7 +35,7 @@ jobs: cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \ && cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \ && cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | jq -cR '{only: ., os: "macos-13"}' + && cibuildwheel --print-build-identifiers --platform macos --arch universal2,arm64 | jq -cR '{only: ., os: "macos-latest"}' } | jq -sc ) echo $MATRIX_INCLUDE From 50150922390158e2f9e74f5f4322a58924c3baea Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 11:16:19 -0500 Subject: [PATCH 03/37] target x86_64 --- .github/workflows/build_python_3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 8bc2204e60e..7484e38f3f8 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -35,7 +35,7 @@ jobs: cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \ && cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \ && cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --arch universal2,arm64 | jq -cR '{only: ., os: "macos-latest"}' + && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | jq -cR '{only: ., os: "macos-latest"}' } | jq -sc ) echo $MATRIX_INCLUDE From efcf8d68ef00ff83fc8710c5dcbc7c87590b816c Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 11:34:00 -0500 Subject: [PATCH 04/37] remove deprecated tp_print --- ddtrace/profiling/collector/_memalloc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/ddtrace/profiling/collector/_memalloc.c b/ddtrace/profiling/collector/_memalloc.c index 1f2b87e0433..f729bdc9b26 100644 --- a/ddtrace/profiling/collector/_memalloc.c +++ b/ddtrace/profiling/collector/_memalloc.c @@ -508,9 +508,6 @@ static PyTypeObject MemallocIterEvents_Type = { #ifdef _PY38_AND_LATER 0, /* tp_vectorcall */ #endif -#ifdef _PY38 - 0, /* tp_print */ -#endif }; static PyMethodDef module_methods[] = { { "start", (PyCFunction)memalloc_start, METH_VARARGS, memalloc_start__doc__ }, From 8a3e15fbf8490ebdced37a43ba630d82e54472b9 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 11:41:20 -0500 Subject: [PATCH 05/37] drop support for macos<10.13 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index dfaa5f6bf97..84efc7de3fd 100644 --- a/setup.py +++ b/setup.py @@ -351,6 +351,7 @@ def build_extension_cmake(self, ext): "-DCMAKE_BUILD_TYPE={}".format(ext.build_type), "-DLIB_INSTALL_DIR={}".format(output_dir), "-DEXTENSION_NAME={}".format(extension_basename), + "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13", ] if BUILD_PROFILING_NATIVE_TESTS: From abe6f00f67c4b569996302e1626bd42bee248cd0 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 11:48:27 -0500 Subject: [PATCH 06/37] revert to universal2 --- .github/workflows/build_python_3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 7484e38f3f8..8bc2204e60e 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -35,7 +35,7 @@ jobs: cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \ && cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \ && cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --arch x86_64,arm64 | jq -cR '{only: ., os: "macos-latest"}' + && cibuildwheel --print-build-identifiers --platform macos --arch universal2,arm64 | jq -cR '{only: ., os: "macos-latest"}' } | jq -sc ) echo $MATRIX_INCLUDE From a6a894292b8c292d2775e26eff6a5d99c4232b0a Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 12:49:25 -0500 Subject: [PATCH 07/37] debug --- .github/workflows/build_python_3.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 8bc2204e60e..a61c9b8c8c7 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -147,6 +147,9 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && + pwd && + find ./ddtrace/internal/datadog/profiling -name "*.dylib" && + find ./ddtrace/internal/datadog/profiling -name "*.so" && MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && From f4c0d5db9e13fe466af861657fa3ced0a441a18b Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 12:56:13 -0500 Subject: [PATCH 08/37] remove universal2 --- .github/workflows/build_python_3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index a61c9b8c8c7..0f130c1864f 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -35,7 +35,7 @@ jobs: cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \ && cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \ && cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --arch universal2,arm64 | jq -cR '{only: ., os: "macos-latest"}' + && cibuildwheel --print-build-identifiers --platform macos --arch arm64 | jq -cR '{only: ., os: "macos-latest"}' } | jq -sc ) echo $MATRIX_INCLUDE From 1ff6f468e1a4aa1b40a747ed3834786e47dc3f2b Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 13:03:34 -0500 Subject: [PATCH 09/37] ehco --- .github/workflows/build_python_3.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 0f130c1864f..67fe2659352 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -147,9 +147,9 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - pwd && - find ./ddtrace/internal/datadog/profiling -name "*.dylib" && - find ./ddtrace/internal/datadog/profiling -name "*.so" && + echo $(pwd) && + echo $(find ./ddtrace/internal/datadog/profiling -name "*.dylib") && + echo $(find ./ddtrace/internal/datadog/profiling -name "*.so") && MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && From d808fb43c265e7f1e3b32e12529f45e0d82de69e Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 13:11:05 -0500 Subject: [PATCH 10/37] Discard changes to ddtrace/profiling/collector/_memalloc.c --- ddtrace/profiling/collector/_memalloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ddtrace/profiling/collector/_memalloc.c b/ddtrace/profiling/collector/_memalloc.c index f729bdc9b26..1f2b87e0433 100644 --- a/ddtrace/profiling/collector/_memalloc.c +++ b/ddtrace/profiling/collector/_memalloc.c @@ -508,6 +508,9 @@ static PyTypeObject MemallocIterEvents_Type = { #ifdef _PY38_AND_LATER 0, /* tp_vectorcall */ #endif +#ifdef _PY38 + 0, /* tp_print */ +#endif }; static PyMethodDef module_methods[] = { { "start", (PyCFunction)memalloc_start, METH_VARARGS, memalloc_start__doc__ }, From c9aa29922765176cef47b34fbc8f4aa5067cfdb5 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 15:18:09 -0500 Subject: [PATCH 11/37] tp_print fix --- ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index 6a4cb4e8803..12ceab6fcb6 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -49,6 +49,10 @@ add_library(${EXTENSION_NAME} SHARED ${DDUP_CPP_SRC}) add_ddup_config(${EXTENSION_NAME}) # Cython generates code that produces errors for the following, so relax compile options target_compile_options(${EXTENSION_NAME} PRIVATE -Wno-old-style-cast -Wno-shadow -Wno-address) +# tp_print is marked deprecated in Python 3.8, but cython still generates code using it +if("${Python3_VERSION_MINOR}" STREQUAL "8") + target_compile_options(${EXTENSION_NAME} PRIVATE -Wno-deprecated-declarations) +endif() # cmake may mutate the name of the library (e.g., lib- and -.so for dynamic libraries). This suppresses that behavior, # which is required to ensure all paths can be inferred correctly by setup.py. From 28f066ed95b7f69ff62ae638b8af96409ac35de5 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 15:23:14 -0500 Subject: [PATCH 12/37] tp_print crashtracker --- .../internal/datadog/profiling/crashtracker/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index c23a3e3ddce..8165613c07d 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -46,6 +46,10 @@ add_library(${EXTENSION_NAME} SHARED ${CRASHTRACKER_CPP_SRC}) add_ddup_config(${EXTENSION_NAME}) # Cython generates code that produces errors for the following, so relax compile options target_compile_options(${EXTENSION_NAME} PRIVATE -Wno-old-style-cast -Wno-shadow -Wno-address) +# tp_print is marked deprecated in Python 3.8, but cython still generates code using it +if("${Python3_VERSION_MINOR}" STREQUAL "8") + target_compile_options(${EXTENSION_NAME} PRIVATE -Wno-deprecated-declarations) +endif() # cmake may mutate the name of the library (e.g., lib- and -.so for dynamic libraries). This suppresses that behavior, # which is required to ensure all paths can be inferred correctly by setup.py. From c5eab56866eedad7699b38735895f315f6e871f8 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 15:32:35 -0500 Subject: [PATCH 13/37] 13.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 84efc7de3fd..7f716ffd67a 100644 --- a/setup.py +++ b/setup.py @@ -351,7 +351,7 @@ def build_extension_cmake(self, ext): "-DCMAKE_BUILD_TYPE={}".format(ext.build_type), "-DLIB_INSTALL_DIR={}".format(output_dir), "-DEXTENSION_NAME={}".format(extension_basename), - "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13", + "-DCMAKE_OSX_DEPLOYMENT_TARGET=13.0", ] if BUILD_PROFILING_NATIVE_TESTS: From 3307459ad534388a30d0edbbc4d2cbf1d9b0f441 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 15:33:46 -0500 Subject: [PATCH 14/37] set 13.0 in build python --- .github/workflows/build_python_3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 67fe2659352..503727064cf 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -107,7 +107,7 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + MACOSX_DEPLOYMENT_TARGET=13.0 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && @@ -150,7 +150,7 @@ jobs: echo $(pwd) && echo $(find ./ddtrace/internal/datadog/profiling -name "*.dylib") && echo $(find ./ddtrace/internal/datadog/profiling -name "*.so") && - MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + MACOSX_DEPLOYMENT_TARGET=13.0 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && From ff022cd8a2fdf2a1d344031582ef2489f124800a Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 15:49:00 -0500 Subject: [PATCH 15/37] unzip list --- .github/workflows/build_python_3.yml | 5 ++--- setup.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 503727064cf..082a30d5e23 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -147,9 +147,8 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - echo $(pwd) && - echo $(find ./ddtrace/internal/datadog/profiling -name "*.dylib") && - echo $(find ./ddtrace/internal/datadog/profiling -name "*.so") && + echo $(unzip -l {wheel} | grep .so$) && + echo $(unzip -l {wheel} | grep .dylib$) && MACOSX_DEPLOYMENT_TARGET=13.0 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && diff --git a/setup.py b/setup.py index 7f716ffd67a..dfaa5f6bf97 100644 --- a/setup.py +++ b/setup.py @@ -351,7 +351,6 @@ def build_extension_cmake(self, ext): "-DCMAKE_BUILD_TYPE={}".format(ext.build_type), "-DLIB_INSTALL_DIR={}".format(output_dir), "-DEXTENSION_NAME={}".format(extension_basename), - "-DCMAKE_OSX_DEPLOYMENT_TARGET=13.0", ] if BUILD_PROFILING_NATIVE_TESTS: From d42abf28d8ef274e1e21b2077a4cef164ef89d13 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 15:50:06 -0500 Subject: [PATCH 16/37] use MACOSX_DEPLOYMENT_TARGET=13 --- .github/workflows/build_python_3.yml | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 082a30d5e23..4e27d5b71c0 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -107,7 +107,7 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - MACOSX_DEPLOYMENT_TARGET=13.0 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && @@ -149,7 +149,7 @@ jobs: zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && echo $(unzip -l {wheel} | grep .so$) && echo $(unzip -l {wheel} | grep .dylib$) && - MACOSX_DEPLOYMENT_TARGET=13.0 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && diff --git a/setup.py b/setup.py index dfaa5f6bf97..0d0aa5fe140 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ # Set macOS SDK default deployment target to 10.14 for C++17 support (if unset, may default to 10.9) if CURRENT_OS == "Darwin": - os.environ.setdefault("MACOSX_DEPLOYMENT_TARGET", "10.14") + os.environ.setdefault("MACOSX_DEPLOYMENT_TARGET", "13") def interpose_sccache(): From fa9e023f73f955c7638293c147ef818172d1a791 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 16:14:48 -0500 Subject: [PATCH 17/37] otool --- .github/workflows/build_python_3.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 4e27d5b71c0..b2fb4386682 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -149,6 +149,12 @@ jobs: zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && echo $(unzip -l {wheel} | grep .so$) && echo $(unzip -l {wheel} | grep .dylib$) && + + unzip -d extracted_wheel {wheel} && + pushd extracted_wheel && + echo ${otool -L ddtrace/internal/datadog/profiling/libdd_wrapper-unknown-arm64.dylib} && + echo ${otool -L ddtrace/internal/datadog/profiling/ddup/_ddup.cpython-*-darwin.so} && + popd && delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && From 6e7710f5e54195d78342f22dfbe5b49feb308b8e Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 16:29:16 -0500 Subject: [PATCH 18/37] typo --- .github/workflows/build_python_3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index b2fb4386682..c277bc4854e 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -152,8 +152,8 @@ jobs: unzip -d extracted_wheel {wheel} && pushd extracted_wheel && - echo ${otool -L ddtrace/internal/datadog/profiling/libdd_wrapper-unknown-arm64.dylib} && - echo ${otool -L ddtrace/internal/datadog/profiling/ddup/_ddup.cpython-*-darwin.so} && + echo $(otool -L ddtrace/internal/datadog/profiling/libdd_wrapper-unknown-arm64.dylib) && + echo $(otool -L ddtrace/internal/datadog/profiling/ddup/_ddup.cpython-*-darwin.so) && popd && delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: From aaf7a45b87d6af257a027134f8425cafb48cc739 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 16:36:43 -0500 Subject: [PATCH 19/37] just build for mac for testing purposes --- .github/workflows/build_python_3.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index c277bc4854e..47f9129adbb 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -32,10 +32,7 @@ jobs: run: | MATRIX_INCLUDE=$( { - cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \ - && cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \ - && cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --arch arm64 | jq -cR '{only: ., os: "macos-latest"}' + cibuildwheel --print-build-identifiers --platform macos --arch arm64 | jq -cR '{only: ., os: "macos-latest"}' } | jq -sc ) echo $MATRIX_INCLUDE From cc1f501d034455b487a0fc69ec6681e720aef7ab Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 17:48:09 -0500 Subject: [PATCH 20/37] fix to make delocate-wheel work on macos --- ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt | 2 +- ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt | 2 +- ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index 8165613c07d..12b7b738b01 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -58,7 +58,7 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/.." INSTALL_RPATH_USE_LINK_PATH TRUE) target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index 12ceab6fcb6..352b1146557 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -61,7 +61,7 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/.." INSTALL_RPATH_USE_LINK_PATH TRUE) target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt index 77952e09d41..e4c05d1702c 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt @@ -95,7 +95,7 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/.." INSTALL_RPATH_USE_LINK_PATH TRUE) target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) From 20f087ac54a0198fa80bbf8dfca5a1818a216091 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 17:53:27 -0500 Subject: [PATCH 21/37] revert changes to MACOSX_DEPLOYMENT_TARGET --- .github/workflows/build_python_3.yml | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 47f9129adbb..43f6d5951da 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -104,7 +104,7 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && @@ -152,7 +152,7 @@ jobs: echo $(otool -L ddtrace/internal/datadog/profiling/libdd_wrapper-unknown-arm64.dylib) && echo $(otool -L ddtrace/internal/datadog/profiling/ddup/_ddup.cpython-*-darwin.so) && popd && - delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && diff --git a/setup.py b/setup.py index 0d0aa5fe140..dfaa5f6bf97 100644 --- a/setup.py +++ b/setup.py @@ -65,7 +65,7 @@ # Set macOS SDK default deployment target to 10.14 for C++17 support (if unset, may default to 10.9) if CURRENT_OS == "Darwin": - os.environ.setdefault("MACOSX_DEPLOYMENT_TARGET", "13") + os.environ.setdefault("MACOSX_DEPLOYMENT_TARGET", "10.14") def interpose_sccache(): From 59efd82131a0c6360a8220172332cf439306f773 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 20:04:23 -0500 Subject: [PATCH 22/37] move test command --- .github/workflows/build_python_3.yml | 2 ++ pyproject.toml | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 43f6d5951da..7a5d557c47c 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -109,6 +109,7 @@ jobs: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && move "{wheel}" "{dest_dir}" + CIBW_TEST_COMMAND: "python {project}/tests/smoke_test.py" # DEV: Uncomment to debug MacOS # CIBW_BUILD_VERBOSITY_MACOS: 3 @@ -157,6 +158,7 @@ jobs: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && move "{wheel}" "{dest_dir}" + CIBW_TEST_COMMAND: "python {project}/tests/smoke_test.py" # DEV: Uncomment to debug MacOS # CIBW_BUILD_VERBOSITY_MACOS: 3 diff --git a/pyproject.toml b/pyproject.toml index 03560d1b171..69bf290b9f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -198,12 +198,6 @@ exclude_dirs = [ "ddtrace/sourcecode/_utils.py", ] -[tool.cibuildwheel] -build = ["cp27-*", "cp35-*", "cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"] -test-command = ["python {project}/tests/smoke_test.py"] -# Skip trying to test arm64 builds on Intel Macs -test-skip = "*-macosx_universal2:arm64" - [tool.ruff] exclude = [ ".riot", From ffbaaf4a1a53ba842f3037cf43251e5a47da7022 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 20:29:58 -0500 Subject: [PATCH 23/37] revert changes --- ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt | 2 +- ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt | 2 +- ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index 12b7b738b01..8165613c07d 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -58,7 +58,7 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/.." INSTALL_RPATH_USE_LINK_PATH TRUE) +set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index 352b1146557..12ceab6fcb6 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -61,7 +61,7 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/.." INSTALL_RPATH_USE_LINK_PATH TRUE) +set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt index e4c05d1702c..77952e09d41 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt @@ -95,7 +95,7 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/.." INSTALL_RPATH_USE_LINK_PATH TRUE) +set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) From e8bd57e550037658f05218f0ffa323a1c0ce1dd2 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Wed, 22 Jan 2025 21:39:56 -0500 Subject: [PATCH 24/37] set loaderpath --- .../datadog/profiling/crashtracker/CMakeLists.txt | 14 ++++++++++---- .../internal/datadog/profiling/ddup/CMakeLists.txt | 6 +++++- .../datadog/profiling/stack_v2/CMakeLists.txt | 6 +++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index 8165613c07d..9b6ca10fb23 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -58,7 +58,11 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +if (APPLE) + set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "@loader_path/..") +elseif(UNIX) + set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) @@ -87,11 +91,13 @@ if(NOT CRASHTRACKER_EXE_TARGET_NAME) message(FATAL_ERROR "CRASHTRACKER_EXE_TARGET_NAME not set") endif() +if (APPLE) + set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "@loader_path/.." OUTPUT_NAME + ${CRASHTRACKER_EXE_TARGET_NAME}) +elseif(UNIX) set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "$ORIGIN/.." OUTPUT_NAME ${CRASHTRACKER_EXE_TARGET_NAME}) - -# To let crashtracker find Python library at runtime -set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) +endif() if(Python3_LIBRARIES) target_link_libraries(crashtracker_exe PRIVATE dd_wrapper ${Python3_LIBRARIES}) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index 12ceab6fcb6..49faf881866 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -61,7 +61,11 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +if (APPLE) + set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "@loader_path/..") +elseif(UNIX) + set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt index 77952e09d41..877876f5e01 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt @@ -95,7 +95,11 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +if(APPLE) + set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "@loader_path/..") +elseif(UNIX) + set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") +endif() target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) From 4bba95cb720d7e128a089dd77bc88fcf981f3616 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 23 Jan 2025 01:55:08 -0500 Subject: [PATCH 25/37] just move? --- .github/workflows/build_python_3.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 7a5d557c47c..29d8b0add84 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -104,7 +104,7 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + mv {wheel} {dest_dir} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && @@ -145,15 +145,7 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - echo $(unzip -l {wheel} | grep .so$) && - echo $(unzip -l {wheel} | grep .dylib$) && - - unzip -d extracted_wheel {wheel} && - pushd extracted_wheel && - echo $(otool -L ddtrace/internal/datadog/profiling/libdd_wrapper-unknown-arm64.dylib) && - echo $(otool -L ddtrace/internal/datadog/profiling/ddup/_ddup.cpython-*-darwin.so) && - popd && - MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} + mv {wheel} {dest_dir} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && From 5468ec7828fad59b1fffdc382324ae70bc2d8a0d Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 23 Jan 2025 10:06:56 -0500 Subject: [PATCH 26/37] x86_64 on macos-13 --- .github/workflows/build_python_3.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 29d8b0add84..2f54627fc32 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -32,7 +32,8 @@ jobs: run: | MATRIX_INCLUDE=$( { - cibuildwheel --print-build-identifiers --platform macos --arch arm64 | jq -cR '{only: ., os: "macos-latest"}' + cibuildwheel --print-build-identifiers --platform macos --arch x86_64 | jq -cR '{only: ., os: "macos-13"}' \ + && cibuildwheel --print-build-identifiers --platform macos --arch arm64 | jq -cR '{only: ., os: "macos-latest"}' } | jq -sc ) echo $MATRIX_INCLUDE From 55041d58bfd89e77fbb7bc355932e1435369ac41 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 23 Jan 2025 10:19:34 -0500 Subject: [PATCH 27/37] format --- .../datadog/profiling/crashtracker/CMakeLists.txt | 10 +++++----- ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index 9b6ca10fb23..14c61d8c763 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -58,7 +58,7 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -if (APPLE) +if(APPLE) set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "@loader_path/..") elseif(UNIX) set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") @@ -91,12 +91,12 @@ if(NOT CRASHTRACKER_EXE_TARGET_NAME) message(FATAL_ERROR "CRASHTRACKER_EXE_TARGET_NAME not set") endif() -if (APPLE) +if(APPLE) set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "@loader_path/.." OUTPUT_NAME - ${CRASHTRACKER_EXE_TARGET_NAME}) + ${CRASHTRACKER_EXE_TARGET_NAME}) elseif(UNIX) -set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "$ORIGIN/.." OUTPUT_NAME - ${CRASHTRACKER_EXE_TARGET_NAME}) + set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "$ORIGIN/.." OUTPUT_NAME + ${CRASHTRACKER_EXE_TARGET_NAME}) endif() if(Python3_LIBRARIES) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index 49faf881866..d818d21d019 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -61,7 +61,7 @@ set_target_properties(${EXTENSION_NAME} PROPERTIES SUFFIX "") # RPATH is needed for sofile discovery at runtime, since Python packages are not installed in the system path. This is # typical. -if (APPLE) +if(APPLE) set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "@loader_path/..") elseif(UNIX) set_target_properties(${EXTENSION_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/..") From 38cfae3ae96ce3b20af5fe6184607ba18653a02d Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 23 Jan 2025 10:20:32 -0500 Subject: [PATCH 28/37] build all --- .github/workflows/build_python_3.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index 2f54627fc32..d366dde00c7 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -32,7 +32,10 @@ jobs: run: | MATRIX_INCLUDE=$( { - cibuildwheel --print-build-identifiers --platform macos --arch x86_64 | jq -cR '{only: ., os: "macos-13"}' \ + cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \ + && cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \ + && cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \ + && cibuildwheel --print-build-identifiers --platform macos --arch x86_64 | jq -cR '{only: ., os: "macos-13"}' \ && cibuildwheel --print-build-identifiers --platform macos --arch arm64 | jq -cR '{only: ., os: "macos-latest"}' } | jq -sc ) From 442ed507bf384cea48cc483c7a8553461594db77 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Thu, 23 Jan 2025 11:41:47 -0500 Subject: [PATCH 29/37] this is needed --- ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index 14c61d8c763..a5999d50b6d 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -99,6 +99,9 @@ elseif(UNIX) ${CRASHTRACKER_EXE_TARGET_NAME}) endif() +# To let crashtracker find Python library at runtime +set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) + if(Python3_LIBRARIES) target_link_libraries(crashtracker_exe PRIVATE dd_wrapper ${Python3_LIBRARIES}) else() From 68dc4f9e09e348519b5d7a733010cfc1eb9b52cf Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 24 Jan 2025 13:06:00 -0500 Subject: [PATCH 30/37] python link trick for mac build --- .../datadog/profiling/cmake/AnalysisFunc.cmake | 1 + .../profiling/crashtracker/CMakeLists.txt | 16 +++------------- .../datadog/profiling/ddup/CMakeLists.txt | 6 +----- .../datadog/profiling/stack_v2/CMakeLists.txt | 3 --- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake b/ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake index 2495a84ed29..b176c59993c 100644 --- a/ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake +++ b/ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake @@ -32,6 +32,7 @@ function(add_ddup_config target) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") # macOS-specific linker options target_link_options(${target} PRIVATE "$<$:-Wl,-dead_strip>") + target_link_options(${target} PRIVATE -ldl -undefined dynamic_lookup) else() # Linux/ELF-based linker options target_link_options( diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index a5999d50b6d..7232d1a9037 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -66,12 +66,7 @@ endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) -if(Python3_LIBRARIES) - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper ${Python3_LIBRARIES}) -else() - # for manylinux builds - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) -endif() +target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) # Set the output directory for the built library if(LIB_INSTALL_DIR) @@ -92,7 +87,7 @@ if(NOT CRASHTRACKER_EXE_TARGET_NAME) endif() if(APPLE) - set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "@loader_path/.." OUTPUT_NAME + set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "@loader_path/.." OUTPUT_NAME ${CRASHTRACKER_EXE_TARGET_NAME}) elseif(UNIX) set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "$ORIGIN/.." OUTPUT_NAME @@ -102,12 +97,7 @@ endif() # To let crashtracker find Python library at runtime set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) -if(Python3_LIBRARIES) - target_link_libraries(crashtracker_exe PRIVATE dd_wrapper ${Python3_LIBRARIES}) -else() - # for manylinux builds - target_link_libraries(crashtracker_exe PRIVATE dd_wrapper) -endif() +target_link_libraries(crashtracker_exe PRIVATE dd_wrapper) # See the dd_wrapper CMakeLists.txt for a more detailed explanation of why we do what we do. if(INPLACE_LIB_INSTALL_DIR) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index d818d21d019..d4faa8704bb 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -69,11 +69,7 @@ endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) -if(Python3_LIBRARIES) - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper ${Python3_LIBRARIES}) -else() - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) -endif() +target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) # Set the output directory for the built library if(LIB_INSTALL_DIR) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt index 877876f5e01..c94ce902288 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt @@ -103,9 +103,6 @@ endif() target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) -if(Python3_LIBRARIES) - target_link_libraries(${EXTENSION_NAME} PRIVATE ${Python3_LIBRARIES}) -endif() # Set the output directory for the built library if(LIB_INSTALL_DIR) From c7477cc5f4c7713bb6cb60e25f80dc029f4ca8ac Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 24 Jan 2025 13:07:30 -0500 Subject: [PATCH 31/37] delocate for real --- .github/workflows/build_python_3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_python_3.yml b/.github/workflows/build_python_3.yml index d366dde00c7..a20779fbe81 100644 --- a/.github/workflows/build_python_3.yml +++ b/.github/workflows/build_python_3.yml @@ -108,7 +108,7 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - mv {wheel} {dest_dir} + MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && @@ -149,7 +149,7 @@ jobs: rm -rf ./tempwheelhouse CIBW_REPAIR_WHEEL_COMMAND_MACOS: | zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx && - mv {wheel} {dest_dir} + MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: choco install -y 7zip && 7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx && From 5a87bbecd89171f393819d6f1652d91e04e4c6a2 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 24 Jan 2025 13:18:52 -0500 Subject: [PATCH 32/37] link with python --- .../profiling/crashtracker/CMakeLists.txt | 19 +++++++++++++++---- .../datadog/profiling/ddup/CMakeLists.txt | 6 +++++- .../datadog/profiling/stack_v2/CMakeLists.txt | 3 +++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index 7232d1a9037..67b6259750e 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -66,7 +66,12 @@ endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) -target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) +if(NOT APPLE AND Python3_LIBRARIES) + target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper ${Python3_LIBRARIES}) +else() + # for manylinux builds + target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) +endif() # Set the output directory for the built library if(LIB_INSTALL_DIR) @@ -92,12 +97,18 @@ if(APPLE) elseif(UNIX) set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "$ORIGIN/.." OUTPUT_NAME ${CRASHTRACKER_EXE_TARGET_NAME}) + + # To let crashtracker find Python library at runtime + set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) endif() -# To let crashtracker find Python library at runtime -set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) -target_link_libraries(crashtracker_exe PRIVATE dd_wrapper) +if(NOT APPLE AND Python3_LIBRARIES) + target_link_libraries(crashtracker_exe PRIVATE dd_wrapper ${Python3_LIBRARIES}) +else() + # for manylinux builds + target_link_libraries(crashtracker_exe PRIVATE dd_wrapper) +endif() # See the dd_wrapper CMakeLists.txt for a more detailed explanation of why we do what we do. if(INPLACE_LIB_INSTALL_DIR) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index d4faa8704bb..7899b065992 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -69,7 +69,11 @@ endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) -target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) +if(NOT APPLE AND Python3_LIBRARIES) + target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper ${Python3_LIBRARIES}) +else() + target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) +endif() # Set the output directory for the built library if(LIB_INSTALL_DIR) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt index c94ce902288..3d9b6705aef 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt @@ -103,6 +103,9 @@ endif() target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) +if(NOT APPLE AND Python3_LIBRARIES) + target_link_libraries(${EXTENSION_NAME} PRIVATE ${Python3_LIBRARIES}) +endif() # Set the output directory for the built library if(LIB_INSTALL_DIR) From 73ef0fcaa2d0e055a284f5e970c184f4d19d2f20 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Fri, 24 Jan 2025 13:22:34 -0500 Subject: [PATCH 33/37] format --- ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake | 2 +- ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake b/ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake index b176c59993c..567ba15208f 100644 --- a/ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake +++ b/ddtrace/internal/datadog/profiling/cmake/AnalysisFunc.cmake @@ -32,7 +32,7 @@ function(add_ddup_config target) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") # macOS-specific linker options target_link_options(${target} PRIVATE "$<$:-Wl,-dead_strip>") - target_link_options(${target} PRIVATE -ldl -undefined dynamic_lookup) + target_link_options(${target} PRIVATE -ldl -undefined dynamic_lookup) else() # Linux/ELF-based linker options target_link_options( diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index 67b6259750e..dd085d3de76 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -92,7 +92,7 @@ if(NOT CRASHTRACKER_EXE_TARGET_NAME) endif() if(APPLE) - set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "@loader_path/.." OUTPUT_NAME + set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "@loader_path/.." OUTPUT_NAME ${CRASHTRACKER_EXE_TARGET_NAME}) elseif(UNIX) set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "$ORIGIN/.." OUTPUT_NAME @@ -102,7 +102,6 @@ elseif(UNIX) set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) endif() - if(NOT APPLE AND Python3_LIBRARIES) target_link_libraries(crashtracker_exe PRIVATE dd_wrapper ${Python3_LIBRARIES}) else() From 1f08af45ae9df97e24504c515c1b397e0c0a235b Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 27 Jan 2025 15:55:34 +0000 Subject: [PATCH 34/37] update reno --- releasenotes/notes/ci-mac-build-37f7e55c8289de61.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 releasenotes/notes/ci-mac-build-37f7e55c8289de61.yaml diff --git a/releasenotes/notes/ci-mac-build-37f7e55c8289de61.yaml b/releasenotes/notes/ci-mac-build-37f7e55c8289de61.yaml new file mode 100644 index 00000000000..5249b038c6e --- /dev/null +++ b/releasenotes/notes/ci-mac-build-37f7e55c8289de61.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + profiling: fixes an issue on arm64 macOS where the profiler was not able + to find native extension modules to enable the following features: + ``DD_PROFILING_TIMELINE_ENABLED`` and ``DD_PROFILING_STACK_V2_ENABLED``. From cd36de802745e3a3f10fa0e76487edf9bc5eac4f Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 27 Jan 2025 16:10:38 +0000 Subject: [PATCH 35/37] can we remove these? --- .../datadog/profiling/crashtracker/CMakeLists.txt | 14 ++------------ .../internal/datadog/profiling/ddup/CMakeLists.txt | 7 ++----- .../datadog/profiling/stack_v2/CMakeLists.txt | 4 ---- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt index dd085d3de76..5bf8ee6ad80 100644 --- a/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt @@ -66,12 +66,7 @@ endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) -if(NOT APPLE AND Python3_LIBRARIES) - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper ${Python3_LIBRARIES}) -else() - # for manylinux builds - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) -endif() +target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) # Set the output directory for the built library if(LIB_INSTALL_DIR) @@ -102,12 +97,7 @@ elseif(UNIX) set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) endif() -if(NOT APPLE AND Python3_LIBRARIES) - target_link_libraries(crashtracker_exe PRIVATE dd_wrapper ${Python3_LIBRARIES}) -else() - # for manylinux builds - target_link_libraries(crashtracker_exe PRIVATE dd_wrapper) -endif() +target_link_libraries(crashtracker_exe PRIVATE dd_wrapper) # See the dd_wrapper CMakeLists.txt for a more detailed explanation of why we do what we do. if(INPLACE_LIB_INSTALL_DIR) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index 7899b065992..dbe28cfe2e6 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -69,11 +69,8 @@ endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) -if(NOT APPLE AND Python3_LIBRARIES) - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper ${Python3_LIBRARIES}) -else() - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) -endif() + +target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) # Set the output directory for the built library if(LIB_INSTALL_DIR) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt index 3d9b6705aef..39bbdc42648 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt @@ -103,10 +103,6 @@ endif() target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper Threads::Threads) -if(NOT APPLE AND Python3_LIBRARIES) - target_link_libraries(${EXTENSION_NAME} PRIVATE ${Python3_LIBRARIES}) -endif() - # Set the output directory for the built library if(LIB_INSTALL_DIR) install( From ad514c562bdf4812f42eb1755a28b2d00938e71c Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 27 Jan 2025 16:37:38 +0000 Subject: [PATCH 36/37] link with python3 --- .../internal/datadog/profiling/stack_v2/test/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt index 423f927d8f1..926645b15c8 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt @@ -35,6 +35,11 @@ function(dd_wrapper_add_test name) target_include_directories(${name} PRIVATE ../include) # this has to refer to the stack_v2 extension name to properly link against target_link_libraries(${name} PRIVATE gmock gtest_main ${EXTENSION_NAME}) + + if (Python3_LIBRARIES) + target_link_libraries(${name} PRIVATE ${Python3_LIBRARIES}) + endif() + set_target_properties(${name} PROPERTIES INSTALL_RPATH "$ORIGIN/../stack_v2") add_ddup_config(${name}) From c548e12cabc79710d1afa4461df1f56c125a7b3b Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Mon, 27 Jan 2025 16:41:27 +0000 Subject: [PATCH 37/37] format --- ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt | 1 - ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt index dbe28cfe2e6..d4faa8704bb 100644 --- a/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt @@ -69,7 +69,6 @@ endif() target_include_directories(${EXTENSION_NAME} PRIVATE ../dd_wrapper/include ${Datadog_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) - target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper) # Set the output directory for the built library diff --git a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt index 926645b15c8..6cf4b2fe7a4 100644 --- a/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt +++ b/ddtrace/internal/datadog/profiling/stack_v2/test/CMakeLists.txt @@ -36,7 +36,7 @@ function(dd_wrapper_add_test name) # this has to refer to the stack_v2 extension name to properly link against target_link_libraries(${name} PRIVATE gmock gtest_main ${EXTENSION_NAME}) - if (Python3_LIBRARIES) + if(Python3_LIBRARIES) target_link_libraries(${name} PRIVATE ${Python3_LIBRARIES}) endif()