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

fix(ci, profiling): build native macos arm64 wheel #12029

Merged
merged 42 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
42 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
aab63e0
Merge branch 'main' into taegyunkim/prof-11189-mac-build
taegyunkim Jan 27, 2025
1f08af4
update reno
taegyunkim Jan 27, 2025
cd36de8
can we remove these?
taegyunkim Jan 27, 2025
ad514c5
link with python3
taegyunkim Jan 27, 2025
c548e12
format
taegyunkim Jan 27, 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
9 changes: 6 additions & 3 deletions .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 @@ -107,11 +108,12 @@ 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 &&
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 @@ -147,11 +149,12 @@ 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 &&
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
15 changes: 12 additions & 3 deletions ddtrace/internal/datadog/profiling/crashtracker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down Expand Up @@ -87,8 +91,13 @@ 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})
endif()

# To let crashtracker find Python library at runtime
set_target_properties(crashtracker_exe PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE)
Expand Down
6 changes: 5 additions & 1 deletion ddtrace/internal/datadog/profiling/ddup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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