Skip to content

fix(ios): add missing sources - #161

Closed
jpnurmi wants to merge 4 commits into
getsentryfrom
jpnurmi/test/link
Closed

fix(ios): add missing sources#161
jpnurmi wants to merge 4 commits into
getsentryfrom
jpnurmi/test/link

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

#1 (comment)

Missing iOS crash handler sources

High Severity

The iOS CMake sources omit crash_handler_base_ios, crash_handler_ios / crash_handler_tvos, and upload_behavior_ios, which BUILD.gn adds and which crashpad_client_ios.cc includes. An iOS CMake build, including the new build-ios workflow job, cannot link the client.

Additional Locations (2)

Add an opt-in CMake link test that builds a tiny executable against the
Crashpad client start path. Enable it in CI, including the iOS Xcode job,
so missing client implementation sources are caught by a final link.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7e787f9. Configure here.

Comment thread test/link/client_link_test.cc
Comment thread .github/workflows/build.yml
@jpnurmi
jpnurmi force-pushed the jpnurmi/test/link branch from 7e787f9 to defb093 Compare July 17, 2026 13:59
jpnurmi added 2 commits July 17, 2026 16:14
Avoid mixing an iPhoneOS-configured Xcode project with an iPhoneSimulator
build SDK, and use wmain for Windows builds that enable unicode startup.
Include the iOS crash handler implementation and shared base sources in the
CMake client target so the iOS client can complete a final link.
@jpnurmi
jpnurmi force-pushed the jpnurmi/test/link branch from defb093 to dc1d183 Compare July 17, 2026 14:17
Build the sysctl helper for all Apple util targets because the iOS system
data collector uses it, and link the iOS client with the handler common
library that provides CrashReportUploadThread.
@jpnurmi jpnurmi changed the title WIP fix(ios): add missing sources Jul 17, 2026
@jpnurmi

jpnurmi commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

Based on the repo history, linking has been broken on iOS since 2021-12-03. The CI missed it because it built static libraries/Xcode targets without forcing a final link against crashpad_client.

2020-11-02: a0b37e1 added CMake iOS build support. At that point the specific missing crash_handler_*_ios files did not exist yet, and ReadStringSysctlByName() was still local to ios_system_data_collector.mm.

2021-10-14: 204abe1 added the iOS in-process handler upstream. That made crashpad_client_ios.cc depend on InProcessHandler, which depends on CrashReportUploadThread.

2021-12-03: 2ab34ff synced CMake files in the Sentry fork and added the iOS handler sources, but did not add the CMake equivalent of GN’s ../handler:common dependency. So a real iOS final link would have failed on CrashReportUploadThread from then onward.

2024-06-11: dbe6f74 merged the change where iOS began using util/mac/sysctl.h, but CMake still built mac/sysctl.cc only for APPLE AND NOT IOS. That caused the ReadStringSysctlByName undefined symbol.

2025-05-14: aed4e5d split CrashHandler into crash_handler_base_ios.cc, crash_handler_ios.cc, and crash_handler_tvos.cc, and GN added them. CMake did not, causing the newer missing CrashHandler symbols.

@jpnurmi jpnurmi closed this Jul 23, 2026
@jpnurmi
jpnurmi deleted the jpnurmi/test/link branch July 23, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant