Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add `sentry_scope_remove_fingerprint` to remove a fingerprint set on a scope, matching the global `sentry_remove_fingerprint`. ([#1932](https://github.com/getsentry/sentry-native/pull/1932))
- Add `sentry_options_set_before_send_feedback` to filter or enrich user feedback. Feedback does not go through `before_send`. ([#1923](https://github.com/getsentry/sentry-native/pull/1923))
- Unix: Add `SENTRY_LINK_CURL` to control whether the curl transport links `libcurl` directly, loads it dynamically at runtime, or uses the default behavior. ([#1954](https://github.com/getsentry/sentry-native/pull/1954))
- Native/Unix: The native crash daemon now loads `libcurl` dynamically at runtime by default when `SENTRY_LINK_CURL=AUTO`, avoiding `libcurl` linker work during process startup and significantly speeding up startup time. Explicitly set `SENTRY_LINK_CURL=ON` to link it directly. ([#1955](https://github.com/getsentry/sentry-native/pull/1955))

**Fixes**:

Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ elseif(SENTRY_BACKEND_NATIVE)
get_target_property(SENTRY_COMPILE_DEFS sentry COMPILE_DEFINITIONS)
if(SENTRY_COMPILE_DEFS)
# The daemon is always a static executable, never a shared library
list(REMOVE_ITEM SENTRY_COMPILE_DEFS "SENTRY_BUILD_SHARED")
list(REMOVE_ITEM SENTRY_COMPILE_DEFS "SENTRY_BUILD_SHARED" "SENTRY_LINK_CURL")
list(FILTER SENTRY_COMPILE_DEFS EXCLUDE REGEX "^SENTRY_INTEGRATION_")
target_compile_definitions(sentry-crash PRIVATE ${SENTRY_COMPILE_DEFS})
endif()
Expand Down Expand Up @@ -910,7 +910,11 @@ elseif(SENTRY_BACKEND_NATIVE)

# Transport-specific libraries
if(SENTRY_TRANSPORT_CURL)
sentry_target_link_curl(sentry-crash ${_SENTRY_LINK_CURL})
set(_SENTRY_CRASH_LINK_CURL ${_SENTRY_LINK_CURL})
if(SENTRY_LINK_CURL STREQUAL "AUTO" AND UNIX)
set(_SENTRY_CRASH_LINK_CURL OFF)
endif()
sentry_target_link_curl(sentry-crash ${_SENTRY_CRASH_LINK_CURL})
Comment thread
cursor[bot] marked this conversation as resolved.
endif()

if(SENTRY_TRANSPORT_WINHTTP)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ using `cmake -D BUILD_SHARED_LIBS=OFF ..`.
- `SENTRY_LINK_CURL` (Default: `AUTO`):
Controls whether the `curl` transport links `libcurl` directly or loads it
dynamically at runtime on UNIX targets. Possible values are `AUTO`, `ON`, and
`OFF`. `AUTO` currently behaves like `ON`.
`OFF`. `AUTO` currently behaves like `ON`, except for the native crash daemon
on UNIX targets, where it behaves like `OFF`.

- `SENTRY_BUILD_FORCE32` (Default: `OFF`):
Forces cross-compilation from 64-bit host to 32-bit target. Only affects Linux.
Expand Down
24 changes: 12 additions & 12 deletions src/backends/native/sentry_crash_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -4620,18 +4620,6 @@ sentry__crash_daemon_main(pid_t app_pid, uint64_t app_tid, HANDLE event_handle,
}
}

// Transport is already initialized by sentry_options_new(), just start it
if (options->transport) {
SENTRY_DEBUG("Starting transport");
sentry__transport_startup(options->transport, options);
// Set http_retry after transport startup to keep daemon-side retry
// polling disabled, while letting capture cache consent-revoked
// envelopes in retry format for the app to send on restart.
options->http_retry = ipc->shmem->http_retry;
} else {
SENTRY_WARN("No transport available");
}

SENTRY_DEBUG("Daemon options fully initialized");

#if defined(SENTRY_PLATFORM_LINUX) || defined(SENTRY_PLATFORM_ANDROID)
Expand Down Expand Up @@ -4661,6 +4649,18 @@ sentry__crash_daemon_main(pid_t app_pid, uint64_t app_tid, HANDLE event_handle,
SENTRY_DEBUG("Signaling ready to parent");
sentry__crash_ipc_signal_ready(ipc);

// Transport is already initialized by sentry_options_new(), just start it
if (options->transport) {
SENTRY_DEBUG("Starting transport");
sentry__transport_startup(options->transport, options);
// Set http_retry after transport startup to keep daemon-side retry
// polling disabled, while letting capture cache consent-revoked
Comment thread
sentry[bot] marked this conversation as resolved.
// envelopes in retry format for the app to send on restart.
options->http_retry = ipc->shmem->http_retry;
} else {
SENTRY_WARN("No transport available");
}

SENTRY_DEBUG("Entering main loop");

// Daemon main loop
Expand Down
Loading