cmake: enable libunwind_mac only for inproc#1722
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4b145aa. Configure here.
| set(SENTRY_WITH_LIBUNWIND_MAC TRUE) | ||
| if(SENTRY_BACKEND_INPROC) | ||
| set(SENTRY_WITH_LIBUNWIND_MAC TRUE) | ||
| endif() |
There was a problem hiding this comment.
No unwinder on Apple with non-inproc backends
High Severity
On Apple platforms with non-inproc backends (e.g., macOS defaults to crashpad), no unwinder is compiled in. The public APIs sentry_value_new_stacktrace, sentry_value_set_stacktrace, and sentry_event_value_add_stacktrace all rely on sentry_unwind_stack via unwind_stack(), which now returns 0 on these configurations because no SENTRY_WITH_UNWINDER_* macro is defined. This silently produces empty stack traces when users pass ips == NULL.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4b145aa. Configure here.


Summary
Restrict
SENTRY_WITH_LIBUNWIND_MACto theinprocbackend on Apple platforms.Motivation
libunwind_macis only needed for Sentry's local unwinding path used by theinprocbackend. When building withbreakpadon Apple targets, this file is still compiled today because the CMake condition enables it for allAPPLEbuilds.That creates unnecessary build exposure for Apple configurations that do not use this unwinder at runtime, including older iOS SDK / armv7 setups where
libunwind_maccan fail to compile.Changes
SENTRY_WITH_LIBUNWIND_MACis enabled only when:APPLESENTRY_BACKEND_INPROCis selectedImpact
macOS/iOS + breakpad: no longer compilesentry_unwinder_libunwind_mac.cmacOS/iOS + inproc: behavior unchanged