Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: build native macos arm64 wheel #12029

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6f0f0ad
ci: build for arm64 instead of universal2 for mac
taegyunkim Jan 22, 2025
a9936f8
use latest to build on m1, and so build for universal2
taegyunkim Jan 22, 2025
5015092
target x86_64
taegyunkim Jan 22, 2025
efcf8d6
remove deprecated tp_print
taegyunkim Jan 22, 2025
8a3e15f
drop support for macos<10.13
taegyunkim Jan 22, 2025
abe6f00
revert to universal2
taegyunkim Jan 22, 2025
a6a8942
debug
taegyunkim Jan 22, 2025
f4c0d5d
remove universal2
taegyunkim Jan 22, 2025
1ff6f46
ehco
taegyunkim Jan 22, 2025
d808fb4
Discard changes to ddtrace/profiling/collector/_memalloc.c
taegyunkim Jan 22, 2025
c9aa299
tp_print fix
taegyunkim Jan 22, 2025
28f066e
tp_print crashtracker
taegyunkim Jan 22, 2025
c5eab56
13.0
taegyunkim Jan 22, 2025
3307459
set 13.0 in build python
taegyunkim Jan 22, 2025
ff022cd
unzip list
taegyunkim Jan 22, 2025
d42abf2
use MACOSX_DEPLOYMENT_TARGET=13
taegyunkim Jan 22, 2025
fa9e023
otool
taegyunkim Jan 22, 2025
6e7710f
typo
taegyunkim Jan 22, 2025
aaf7a45
just build for mac for testing purposes
taegyunkim Jan 22, 2025
cc1f501
fix to make delocate-wheel work on macos
taegyunkim Jan 22, 2025
20f087a
revert changes to MACOSX_DEPLOYMENT_TARGET
taegyunkim Jan 22, 2025
59efd82
move test command
taegyunkim Jan 23, 2025
ffbaaf4
revert changes
taegyunkim Jan 23, 2025
e8bd57e
set loaderpath
taegyunkim Jan 23, 2025
4bba95c
just move?
taegyunkim Jan 23, 2025
5468ec7
x86_64 on macos-13
taegyunkim Jan 23, 2025
55041d5
format
taegyunkim Jan 23, 2025
38cfae3
build all
taegyunkim Jan 23, 2025
85f91f6
Merge branch 'main' into taegyunkim/prof-11189-mac-build
taegyunkim Jan 23, 2025
442ed50
this is needed
taegyunkim Jan 23, 2025
7c11903
Merge branch 'main' into taegyunkim/prof-11189-mac-build
taegyunkim Jan 23, 2025
03f68b4
Merge branch 'main' into taegyunkim/prof-11189-mac-build
taegyunkim Jan 24, 2025
6b25ae0
Merge branch 'main' into taegyunkim/prof-11189-mac-build
taegyunkim Jan 24, 2025
68dc4f9
python link trick for mac build
taegyunkim Jan 24, 2025
c7477cc
delocate for real
taegyunkim Jan 24, 2025
5a87bbe
link with python
taegyunkim Jan 24, 2025
73ef0fc
format
taegyunkim Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build_python_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ 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 | 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
Expand Down Expand Up @@ -112,6 +113,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

Expand Down Expand Up @@ -152,6 +154,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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function(add_ddup_config target)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# macOS-specific linker options
target_link_options(${target} PRIVATE "$<$<CONFIG:Release>:-Wl,-dead_strip>")
target_link_options(${target} PRIVATE -ldl -undefined dynamic_lookup)
else()
# Linux/ELF-based linker options
target_link_options(
Expand Down
23 changes: 16 additions & 7 deletions ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ 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})

if(Python3_LIBRARIES)
if(NOT APPLE AND Python3_LIBRARIES)
target_link_libraries(${EXTENSION_NAME} PRIVATE dd_wrapper ${Python3_LIBRARIES})
else()
# for manylinux builds
Expand All @@ -87,13 +91,18 @@ if(NOT CRASHTRACKER_EXE_TARGET_NAME)
message(FATAL_ERROR "CRASHTRACKER_EXE_TARGET_NAME not set")
endif()

set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH "$ORIGIN/.." OUTPUT_NAME
${CRASHTRACKER_EXE_TARGET_NAME})
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)
# To let crashtracker find Python library at runtime
set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

if(Python3_LIBRARIES)
if(NOT APPLE AND Python3_LIBRARIES)
target_link_libraries(crashtracker_exe PRIVATE dd_wrapper ${Python3_LIBRARIES})
else()
# for manylinux builds
Expand Down
8 changes: 6 additions & 2 deletions ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ 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})

if(Python3_LIBRARIES)
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)
Expand Down
8 changes: 6 additions & 2 deletions ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ 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)

if(Python3_LIBRARIES)
if(NOT APPLE AND Python3_LIBRARIES)
target_link_libraries(${EXTENSION_NAME} PRIVATE ${Python3_LIBRARIES})
endif()

Expand Down
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,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",
Expand Down
Loading