Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getsentry/sentry-native
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.7.17
Choose a base ref
...
head repository: getsentry/sentry-native
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.7.19
Choose a head ref
  • 10 commits
  • 49 files changed
  • 4 contributors

Commits on Dec 18, 2024

  1. Merge branch 'release/0.7.17'

    getsentry-bot committed Dec 18, 2024
    Copy the full SHA
    19ba6d5 View commit details

Commits on Dec 19, 2024

  1. feat: add option to set debug log level (#1107)

    * feat: add logger output level
    
    * remove test function
    
    * add separate init log level
    
    * refactor: rename of internal log macros
    
    * update CHANGELOG.md
    
    * applied feedback changing log macros
    
    * missed one F
    
    * remove overdesigned init log level
    
    * changelog update
    JoshuaMoelans authored Dec 19, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b24b30c View commit details

Commits on Jan 10, 2025

  1. feat: crashpad support for C++17 compilers. (#1110)

    supervacuus authored Jan 10, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3981ea7 View commit details

Commits on Jan 13, 2025

  1. feat: add support for Xbox Series X/S. (#1100)

    supervacuus authored Jan 13, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    65c109d View commit details

Commits on Jan 14, 2025

  1. feat: add traces_sampler (#1108)

    * add traces_sampler option
    
    * update CHANGELOG.md
    
    * introduced `sentry_traces_sampler_function` typedef
    
    * added sampling context
    
    * format
    
    * eof newlines
    
    * feat: pass sampling_context into sampling decision
    
    * remove unnecessary commented include
    
    * add memory freeing/incref-decref
    
    * change custom sampling context type to sentry_value_t
    
    * add decref
    
    * removed unneeded creation function
    
    * format
    
    * set codeql runner to ubuntu-22.04
    
    * take ownership of custom_sampling_ctx
    
    * add parent sampling decision
    
    * add traces_sampler and parent sampling decision tests
    
    * decref
    
    * change callback arg from struct to parameter list
    
    * format
    
    * mark unused parameters
    
    * format
    
    * cleanup test + docs
    
    * apply PR feedback
    
    * format
    
    * cleanup example
    
    * add getters for transaction_ctx name + operation
    
    * remove (void) on transaction_ctx in example.c
    
    * add transaction_ctx getter tests
    
    * dont expose sampling_context_s in sentry.h
    
    * change bool to int
    
    * cleanup example.c
    
    * refactor tx_cxt to tx_ctx convention
    
    * change sampled_int init
    
    ---------
    
    Co-authored-by: Mischan Toosarani-Hausberger <mischan@abovevacant.com>
    JoshuaMoelans and supervacuus authored Jan 14, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    bce6e8b View commit details
  2. release: 0.7.18

    getsentry-bot committed Jan 14, 2025
    Copy the full SHA
    52ee37c View commit details
  3. Merge branch 'release/0.7.18'

    getsentry-bot committed Jan 14, 2025
    Copy the full SHA
    092de88 View commit details

Commits on Jan 15, 2025

  1. docs: update sampling context parameter description (#1116)

    supervacuus authored Jan 15, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    60a5e61 View commit details

Commits on Jan 20, 2025

  1. fix: build error introduced by crashpad C++17 support (#1118)

    * fix: build error introduced by `crashpad` C++17 support
    
    * introduce a GCC 9.4.0 runner
    
    * update dependencies for new runner
    
    * remove new runner from old deps
    
    * update crashpad
    
    * update crashpad
    
    * remove -Wno-gnu-include-next from senntry compile options
    
    * update crashpad
    
    * remove handle_ex target
    
    * update crashpad
    
    * remove gnu-include-next warnings only for non GNU compilers
    
    * disable pedantic on sentry_boot.h for sentry_info.c
    
    * reset werror for GCC until we fix the crashpad compat
    
    * fix typo
    
    Co-authored-by: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com>
    
    * update crashpad
    
    ---------
    
    Co-authored-by: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com>
    supervacuus and JoshuaMoelans authored Jan 20, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5cb0986 View commit details
  2. release: 0.7.19

    getsentry-bot committed Jan 20, 2025
    Copy the full SHA
    62b966c View commit details
Showing with 1,112 additions and 305 deletions.
  1. +12 −1 .github/workflows/ci.yml
  2. +1 −1 .github/workflows/codeql.yml
  3. +15 −0 CHANGELOG.md
  4. +37 −9 CMakeLists.txt
  5. +2 −0 CONTRIBUTING.md
  6. +6 −6 README.md
  7. +38 −2 examples/example.c
  8. +1 −1 external/breakpad
  9. +1 −1 external/crashpad
  10. +53 −24 include/sentry.h
  11. +1 −1 ndk/gradle.properties
  12. +1 −0 src/CMakeLists.txt
  13. +4 −4 src/backends/sentry_backend_breakpad.cpp
  14. +11 −11 src/backends/sentry_backend_crashpad.cpp
  15. +10 −10 src/backends/sentry_backend_inproc.c
  16. +2 −2 src/modulefinder/sentry_modulefinder_linux.c
  17. +43 −1 src/modulefinder/sentry_modulefinder_windows.c
  18. +1 −1 src/path/sentry_path_unix.c
  19. +1 −1 src/path/sentry_path_windows.c
  20. +77 −59 src/sentry_core.c
  21. +3 −1 src/sentry_core.h
  22. +4 −4 src/sentry_database.c
  23. +1 −1 src/sentry_envelope.c
  24. +5 −1 src/sentry_logger.c
  25. +5 −4 src/sentry_logger.h
  26. +15 −1 src/sentry_options.c
  27. +1 −0 src/sentry_options.h
  28. +28 −4 src/sentry_os.c
  29. +13 −0 src/sentry_sampling_context.h
  30. +7 −7 src/sentry_sync.c
  31. +52 −38 src/sentry_tracing.c
  32. +1 −1 src/sentry_tracing.h
  33. +8 −8 src/sentry_transport.c
  34. +6 −0 src/symbolizer/sentry_symbolizer_windows.c
  35. +1 −1 src/transports/sentry_function_transport.c
  36. +1 −1 src/transports/sentry_transport_curl.c
  37. +5 −5 src/transports/sentry_transport_winhttp.c
  38. +2 −2 tests/assertions.py
  39. +1 −1 tests/test_integration_http.py
  40. +117 −9 tests/unit/test_sampling.c
  41. +2 −2 tests/unit/test_session.c
  42. +78 −78 tests/unit/test_tracing.c
  43. +1 −1 tests/win_utils.py
  44. +244 −0 toolchains/xbox/CMakeGDKScarlett.cmake
  45. +68 −0 toolchains/xbox/GDK-targets.cmake
  46. +41 −0 toolchains/xbox/gdk_build.props
  47. +3 −0 toolchains/xbox/gdk_build.props.md
  48. +62 −0 toolchains/xbox/gxdk_xs_toolchain.cmake
  49. +20 −0 toolchains/xbox/xbox_build.md
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -44,6 +44,11 @@ jobs:
CC: gcc-7
CXX: g++-7
TEST_X86: 1
- name: Linux (GCC 9.4.0)
os: ubuntu-20.04
CC: gcc
CXX: g++
# ERROR_ON_WARNINGS: 1
- name: Linux (GCC 12)
os: ubuntu-22.04
CC: gcc-12
@@ -135,11 +140,17 @@ jobs:
cache: "pip"

- name: Installing Linux Dependencies
if: ${{ runner.os == 'Linux' && !env['TEST_X86'] }}
if: ${{ runner.os == 'Linux' && matrix.os != 'ubuntu-20.04' && !env['TEST_X86'] }}
run: |
sudo apt update
sudo apt install cmake clang-14 clang-tools llvm kcov g++-12 valgrind zlib1g-dev libcurl4-openssl-dev
- name: Installing Linux GCC 9.4.0 Dependencies
if: ${{ runner.os == 'Linux' && matrix.os == 'ubuntu-20.04' && !env['TEST_X86'] }}
run: |
sudo apt update
sudo apt install cmake clang-tools llvm kcov g++ valgrind zlib1g-dev libcurl4-openssl-dev
- name: Installing Linux 32-bit Dependencies
if: ${{ runner.os == 'Linux' && env['TEST_X86'] }}
run: |
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ concurrency:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: false
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.7.19

**Fixes**:

- Fix a build error on older compilers introduced by C++17 support in `0.7.18` for the `crashpad` backend. ([#1118](https://github.com/getsentry/sentry-native/pull/1118), [crashpad#117](https://github.com/getsentry/crashpad/pull/117), [mini_chromium#2](https://github.com/getsentry/mini_chromium/pull/2))

## 0.7.18

**Features**:

- Add support for Xbox Series X/S. ([#1100](https://github.com/getsentry/sentry-native/pull/1100))
- Add option to set debug log level. ([#1107](https://github.com/getsentry/sentry-native/pull/1107))
- Add `traces_sampler` ([#1108](https://github.com/getsentry/sentry-native/pull/1108))
- Provide support for C++17 compilers when using the `crashpad` backend. ([#1110](https://github.com/getsentry/sentry-native/pull/1110), [crashpad#116](https://github.com/getsentry/crashpad/pull/116), [mini_chromium#1](https://github.com/getsentry/mini_chromium/pull/1))

## 0.7.17

**Features**:
46 changes: 37 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -8,6 +8,10 @@ else()
cmake_minimum_required (VERSION 3.10)
cmake_policy(SET CMP0077 NEW)
endif()
set(SENTRY_TOOLCHAINS_DIR "${CMAKE_CURRENT_LIST_DIR}/toolchains")
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64")
include("${SENTRY_TOOLCHAINS_DIR}/xbox/CMakeGDKScarlett.cmake")
endif()

#read sentry-native version
file(READ "include/sentry.h" _SENTRY_HEADER_CONTENT)
@@ -69,10 +73,12 @@ option(SENTRY_TRANSPORT_COMPRESSION "Enable transport gzip compression" OFF)
option(SENTRY_BUILD_TESTS "Build sentry-native tests" "${SENTRY_MAIN_PROJECT}")
option(SENTRY_BUILD_EXAMPLES "Build sentry-native example(s)" "${SENTRY_MAIN_PROJECT}")

option(SENTRY_LINK_PTHREAD "Link platform threads library" ON)
if(SENTRY_LINK_PTHREAD)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if (NOT ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64"))
option(SENTRY_LINK_PTHREAD "Link platform threads library" ON)
if(SENTRY_LINK_PTHREAD)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif()
endif()

if(MSVC)
@@ -137,6 +143,8 @@ option(SENTRY_ENABLE_INSTALL "Enable sentry installation" "${SENTRY_MAIN_PROJECT
if(MSVC AND CMAKE_GENERATOR_TOOLSET MATCHES "_xp$")
message(WARNING "Crashpad is not supported for MSVC with XP toolset. Default backend was switched to 'breakpad'")
set(SENTRY_DEFAULT_BACKEND "breakpad")
elseif(MSVC AND "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64")
set(SENTRY_DEFAULT_BACKEND "breakpad")
elseif((APPLE AND NOT IOS) OR WIN32 OR LINUX)
set(SENTRY_DEFAULT_BACKEND "crashpad")
else()
@@ -233,6 +241,9 @@ endfunction()
# ===== sentry library =====

add_library(sentry ${SENTRY_LIBRARY_TYPE} "${PROJECT_SOURCE_DIR}/vendor/mpack.c")
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64")
set_target_properties(sentry PROPERTIES VS_USER_PROPS gdk_build.props)
endif()
target_sources(sentry PRIVATE "${PROJECT_SOURCE_DIR}/include/sentry.h")
add_library(sentry::sentry ALIAS sentry)
add_subdirectory(src)
@@ -314,7 +325,11 @@ if(MSVC)

# using `/Wall` is not feasible, as it spews tons of warnings from windows headers
# supress C5105, introduced in VS 16.8, which breaks on the Windows SDKs own `winbase.h` header
target_compile_options(sentry PRIVATE $<BUILD_INTERFACE:/W4 /wd5105>)
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64")
target_compile_options(sentry PRIVATE $<BUILD_INTERFACE:/W4 /wd5105 /wd4115>)
else()
target_compile_options(sentry PRIVATE $<BUILD_INTERFACE:/W4 /wd5105>)
endif()
# ignore all warnings for mpack
set_source_files_properties(
"${PROJECT_SOURCE_DIR}/vendor/mpack.c"
@@ -331,7 +346,11 @@ else()
target_compile_options(sentry PRIVATE $<BUILD_INTERFACE:-Wall -Wextra -Wpedantic>)
# The crashpad and breakpad headers generate the following warnings that we
# ignore specifically
target_compile_options(sentry PRIVATE $<BUILD_INTERFACE:-Wno-variadic-macros -Wno-gnu-include-next -Wno-multichar>)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(sentry PRIVATE $<BUILD_INTERFACE:-Wno-variadic-macros -Wno-multichar>)
else()
target_compile_options(sentry PRIVATE $<BUILD_INTERFACE:-Wno-variadic-macros -Wno-gnu-include-next -Wno-multichar>)
endif()
# ignore all warnings for mpack
set_source_files_properties(
"${PROJECT_SOURCE_DIR}/vendor/mpack.c"
@@ -389,16 +408,22 @@ if(ANDROID)
elseif(LINUX)
set(_SENTRY_PLATFORM_LIBS "dl" "rt")
elseif(WIN32)
set(_SENTRY_PLATFORM_LIBS "dbghelp" "shlwapi" "version")
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64")
set(_SENTRY_PLATFORM_LIBS "version")
else()
set(_SENTRY_PLATFORM_LIBS "dbghelp" "shlwapi" "version")
endif()
endif()

if(SENTRY_TRANSPORT_WINHTTP)
list(APPEND _SENTRY_PLATFORM_LIBS "winhttp")
endif()

# handle platform threads library
if(SENTRY_LINK_PTHREAD)
list(APPEND _SENTRY_PLATFORM_LIBS "Threads::Threads")
if (NOT ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64"))
if(SENTRY_LINK_PTHREAD)
list(APPEND _SENTRY_PLATFORM_LIBS "Threads::Threads")
endif()
endif()

# apply platform libraries to sentry library
@@ -575,6 +600,9 @@ endif()

if(SENTRY_BUILD_EXAMPLES)
add_executable(sentry_example examples/example.c)
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64")
set_target_properties(sentry_example PROPERTIES VS_USER_PROPS gdk_build.props)
endif()
target_link_libraries(sentry_example PRIVATE sentry)

if(MSVC)
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -148,6 +148,8 @@ The example currently supports the following commands:
- `stack-overflow`: Provokes a stack-overflow.
- `http-proxy`: Uses a localhost `HTTP` proxy on port 8080.
- `socks5-proxy`: Uses a localhost `SOCKS5` proxy on port 1080.
- `capture-transaction`: Captures a transaction.
- `traces-sampler`: Installs a traces sampler callback function when used alongside `capture-transaction`.

Only on Windows using crashpad with its WER handler module:

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -61,20 +61,20 @@ The SDK bundle contains the following folders:

The SDK currently supports and is tested on the following OS/Compiler variations:

- 64bit Linux with GCC 9
- 64bit Linux with clang 9
- 64bit Linux with GCC 12
- 64bit Linux with clang 15
- 32bit Linux with GCC 7 (cross compiled from 64bit host)
- 32bit Windows with MSVC 2019
- 64bit Windows with MSVC 2022
- macOS Catalina with most recent Compiler toolchain
- Android API29 built by NDK21 toolchain
- macOS 13, 14, 15 with respective most recent Apple compiler toolchain and LLVM clang 15 + 18
- Android API35 built by NDK27 toolchain
- Android API16 built by NDK19 toolchain

Additionally, the SDK should support the following platforms, although they are
not automatically tested, so breakage may occur:

- Windows Versions lower than Windows 10 / Windows Server 2016
- Windows builds with the MSYS2 + MinGW + Clang toolchain
- Windows builds with the MSYS2 + MinGW + Clang toolchain (which also runs in CI)

The SDK supports different features on the target platform:

@@ -94,7 +94,7 @@ CMake.

The prerequisites for building differ depending on the platform and backend. You will always need `CMake` to build the code. Additionally, when using the `crashpad` backend, `zlib` is required. On Linux and macOS, `libcurl` is a prerequisite. For more details, check out the [contribution guide](./CONTRIBUTING.md).

Building the Crashpad Backend [requires a `C++20` compatible compiler](https://github.com/getsentry/sentry-native/issues/1041). In particular, the standard library must support `std::ranges` for `mini_chromium` (a core library of `crashpad`).
Building the Breakpad and Crashpad backends requires a `C++17` compatible compiler.

**Build example**:

40 changes: 38 additions & 2 deletions examples/example.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# ifndef _GAMING_XBOX_SCARLETT
# define WIN32_LEAN_AND_MEAN
# endif
# define NOMINMAX
# define _CRT_SECURE_NO_WARNINGS
#endif
@@ -28,6 +30,32 @@
# define sleep_s(SECONDS) sleep(SECONDS)
#endif

static double
traces_sampler_callback(const sentry_transaction_context_t *transaction_ctx,
sentry_value_t custom_sampling_ctx, const int *parent_sampled)
{
if (parent_sampled != NULL) {
if (*parent_sampled) {
return 0.8; // high sample rate for children of sampled transactions
}
return 0; // parent is not sampled
}
if (strcmp(sentry_transaction_context_get_name(transaction_ctx),
"little.teapot")
== 0) {
if (strcmp(sentry_transaction_context_get_operation(transaction_ctx),
"Short and stout here is my handle and here is my spout")
== 0) {
if (sentry_value_as_int32(
sentry_value_get_by_key(custom_sampling_ctx, "b"))
== 42) {
return 1;
}
}
}
return 0;
}

static sentry_value_t
before_send_callback(sentry_value_t event, void *hint, void *closure)
{
@@ -232,6 +260,10 @@ main(int argc, char **argv)
options, discarding_on_crash_callback, NULL);
}

if (has_arg(argc, argv, "traces-sampler")) {
sentry_options_set_traces_sampler(options, traces_sampler_callback);
}

if (has_arg(argc, argv, "override-sdk-name")) {
sentry_options_set_sdk_name(options, "sentry.native.android.flutter");
}
@@ -403,8 +435,12 @@ main(int argc, char **argv)
if (has_arg(argc, argv, "unsample-tx")) {
sentry_transaction_context_set_sampled(tx_ctx, 0);
}

sentry_value_t custom_sampling_ctx = sentry_value_new_object();
sentry_value_set_by_key(
custom_sampling_ctx, "b", sentry_value_new_int32(42));
sentry_transaction_t *tx
= sentry_transaction_start(tx_ctx, sentry_value_new_null());
= sentry_transaction_start(tx_ctx, custom_sampling_ctx);

sentry_transaction_set_data(
tx, "url", sentry_value_new_string("https://example.com"));
2 changes: 1 addition & 1 deletion external/breakpad
Loading