Skip to content
Merged
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
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
# Changelog

## Unreleased

### Changes

- Windows & Linux native crash handlers: add `SENTRY_NATIVE_BACKEND` env var with default setting of `none`. ([#2522](https://github.com/getsentry/sentry-dart/pull/2522))
Native crash reporting support with `sentry-native`'s `crashpad` was added in v8.11.0 and has caused build-time issues
for some users, because it required newer build tools (newer versions of MSVC/Clang/GCC) than base Flutter SDK.
This broke the ability to build the app for some users compiling Windows and Linux apps with older toolchains.

To avoid this issue, we're disabling the native crash handling by default for Linux and Windows for now.
You can enable it manually by setting the `SENTRY_NATIVE_BACKEND=crashpad` environment variable before running `flutter build`.
You can read more about available backends that fit your use-case in [sentry-native docs](https://docs.sentry.io/platforms/native/configuration/backends/).

We plan to change the default back to `crashpad` in the next major SDK release.

## 8.11.1

### Improvements

- Check for type before casting in TTID ([#2497](https://github.com/getsentry/sentry-dart/pull/2497))

### Fixes
### Fixes

- SentryWidgetsFlutterBinding initializing even if a binding already exists ([#2494](https://github.com/getsentry/sentry-dart/pull/2494))

Expand Down
2 changes: 2 additions & 0 deletions flutter/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# the plugin to fail to compile for some customers of the plugin.
cmake_minimum_required(VERSION 3.10)

set(SENTRY_BACKEND "crashpad" CACHE STRING "The sentry backend responsible for reporting crashes" FORCE)

include("${CMAKE_CURRENT_SOURCE_DIR}/../sentry-native/sentry-native.cmake")

# Even though sentry_flutter doesn't actually provide a useful plugin, we need to accommodate the Flutter tooling.
Expand Down
29 changes: 20 additions & 9 deletions flutter/sentry-native/sentry-native.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ load_cache("${CMAKE_CURRENT_LIST_DIR}" READ_WITH_PREFIX SENTRY_NATIVE_ repo vers
message(STATUS "Fetching Sentry native version: ${SENTRY_NATIVE_version} from ${SENTRY_NATIVE_repo}")

set(SENTRY_SDK_NAME "sentry.native.flutter" CACHE STRING "The SDK name to report when sending events." FORCE)
set(SENTRY_BACKEND "crashpad" CACHE STRING "The sentry backend responsible for reporting crashes" FORCE)
set(SENTRY_BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" FORCE)

# Note: the backend is also set in linux/CMakeLists.txt and windows/CMakeLists.txt. This overwrites those if user sets an env var.
if("$ENV{SENTRY_NATIVE_BACKEND}" STREQUAL "")
# Until sentry-dart v9, we disable native backend by default.
set(SENTRY_BACKEND "none" CACHE STRING "The sentry backend responsible for reporting crashes" FORCE)
else()
set(SENTRY_BACKEND $ENV{SENTRY_NATIVE_BACKEND} CACHE STRING "The sentry backend responsible for reporting crashes" FORCE)
endif()

include(FetchContent)
FetchContent_Declare(
sentry-native
Expand All @@ -17,15 +24,19 @@ FetchContent_MakeAvailable(sentry-native)

# List of absolute paths to libraries that should be bundled with the plugin.
# This list could contain prebuilt libraries, or libraries created by an external build triggered from this build file.
if(WIN32)
set(sentry_flutter_bundled_libraries
$<TARGET_FILE:crashpad_handler>
$<TARGET_FILE:crashpad_wer>
PARENT_SCOPE)
if(SENTRY_BACKEND STREQUAL "crashpad")
if(WIN32)
set(sentry_flutter_bundled_libraries
$<TARGET_FILE:crashpad_handler>
$<TARGET_FILE:crashpad_wer>
PARENT_SCOPE)
else()
set(sentry_flutter_bundled_libraries
$<TARGET_FILE:crashpad_handler>
PARENT_SCOPE)
endif()
else()
set(sentry_flutter_bundled_libraries
$<TARGET_FILE:crashpad_handler>
PARENT_SCOPE)
set(sentry_flutter_bundled_libraries "" PARENT_SCOPE)
endif()

# `*_plugin` is the name of the plugin library as expected by flutter.
Expand Down
Loading
Loading