Skip to content

Commit

Permalink
Configure sentry handler for Linux amd64
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopheLarchier committed Jan 15, 2025
1 parent 71098fa commit b00f637
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,12 @@ elseif(BUILD_CLIENT)
install(FILES ${SENTRY_SHARED_LIBRARY} DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME})

# Crashpad_handler
find_program(CRASHPAD_HANDLER_PROGRAM NAMES crashpad_handler NO_CACHE)
message(STATUS "crashpad_handler found in ${CRASHPAD_HANDLER_PROGRAM}")
install(PROGRAMS ${CRASHPAD_HANDLER_PROGRAM} DESTINATION ${CMAKE_INSTALL_BINDIR})
message(STATUS "CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}")
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
find_program(CRASHPAD_HANDLER_PROGRAM NAMES crashpad_handler NO_CACHE)
message(STATUS "crashpad_handler found in ${CRASHPAD_HANDLER_PROGRAM}")
install(PROGRAMS ${CRASHPAD_HANDLER_PROGRAM} DESTINATION ${CMAKE_INSTALL_BINDIR})
endif ()

# xxHash
find_library(XXHASH_SHARED_LIBRARY NAMES xxhash NO_CACHE)
Expand Down
6 changes: 4 additions & 2 deletions src/libcommon/log/sentry/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ void Handler::init(AppType appType, int breadCrumbsSize) {
// Sentry init
sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, ((appType == AppType::Server) ? SENTRY_SERVER_DSN : SENTRY_CLIENT_DSN));
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(__x86_64__)
// TODO: On Linux arm64, Sentry is built with breakpad instead of crashpad_handler until support of Ubuntu 20.04 is
// discontinued
const SyncPath appWorkingPath = CommonUtility::getAppWorkingDir() / SENTRY_CRASHPAD_HANDLER_NAME;
#endif

Expand All @@ -232,7 +234,7 @@ void Handler::init(AppType appType, int breadCrumbsSize) {
#if defined(Q_OS_WIN)
sentry_options_set_handler_pathw(options, appWorkingPath.c_str());
sentry_options_set_database_pathw(options, appSupportPath.c_str());
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MAC) || defined(__x86_64__)
sentry_options_set_handler_path(options, appWorkingPath.c_str());
sentry_options_set_database_path(options, appSupportPath.c_str());
#endif
Expand Down

0 comments on commit b00f637

Please sign in to comment.