chore(utils): add portable to_chars_double fallback for macOS#72
Open
rayandrew wants to merge 1 commit into
Open
chore(utils): add portable to_chars_double fallback for macOS#72rayandrew wants to merge 1 commit into
rayandrew wants to merge 1 commit into
Conversation
Collaborator
rayandrew
commented
May 23, 2026
- Introduce to_chars_double wrapper that falls back to snprintf on macOS < 13.3
- Force CPM-built zstd on Apple to avoid deployment target mismatches
- Update version patch to 8
There was a problem hiding this comment.
Pull request overview
This PR improves macOS portability by avoiding unsupported std::to_chars(double) on older Apple deployment targets and by ensuring zstd is built in a way that matches the wheel’s deployment target (avoiding host-library mismatches during wheel repair).
Changes:
- Add a
dftracer::utils::to_chars_doublewrapper with an Apple fallback tosnprintffor macOS deployment targets < 13.3, and use it inbloom_visitor.cpp. - On Apple, pin
CMAKE_OSX_DEPLOYMENT_TARGETfromMACOSX_DEPLOYMENT_TARGETin the CMake cache and prefer CPM-built zstd over system zstd. - Bump project version patch from 7 to 8.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/dftracer/utils/utilities/composites/dft/visitors/bloom_visitor.cpp |
Switch double formatting to a portable to_chars_double wrapper. |
include/dftracer/utils/core/common/to_chars.h |
New portable double-to-string helper with macOS fallback. |
CMakeLists.txt |
Cache-declare CMAKE_OSX_DEPLOYMENT_TARGET from environment on Apple; bump patch version. |
cmake/modules/Dependencies.cmake |
Avoid system zstd on Apple and pass deployment target into CPM zstd build. |
Comments suppressed due to low confidence (1)
cmake/modules/Dependencies.cmake:1405
- On Apple,
find_package(zstd ...)is skipped, butzstd_FOUNDcan still be TRUE from a previous configure (it’s also written to the cache later in this function). In that case thisif(zstd_FOUND)branch will run and can silently select a cached/system zstd, defeating the "always CPM-build on Apple" intent. Consider explicitly forcingzstd_FOUNDto FALSE (and clearing cached include/lib hints) whenAPPLE, or changing the condition to only honorzstd_FOUNDwhenNOT APPLE.
if(NOT APPLE)
find_package(zstd QUIET CONFIG)
if(NOT zstd_FOUND)
find_path(zstd_INCLUDE_DIRS NAMES zstd.h)
find_library(zstd_LIBRARIES NAMES zstd)
if(zstd_INCLUDE_DIRS AND zstd_LIBRARIES)
set(zstd_FOUND TRUE)
endif()
endif()
endif()
if(zstd_FOUND)
message(STATUS "Found system zstd")
if(DEFINED zstd_LIBRARIES)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
808e67e to
2db6929
Compare
…ate zstd handling - Introduce to_chars_double wrapper that falls back to snprintf on macOS < 13.3 - Force CPM-built zstd on Apple to avoid deployment target mismatches - Update version patch to 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.