Skip to content

Enable Sentry crash reporting for Windows CI builds#4566

Open
bjorn wants to merge 11 commits into
masterfrom
sentry-windows
Open

Enable Sentry crash reporting for Windows CI builds#4566
bjorn wants to merge 11 commits into
masterfrom
sentry-windows

Conversation

@bjorn

@bjorn bjorn commented Jul 10, 2026

Copy link
Copy Markdown
Member

Extends the existing Sentry integration (currently Linux-only in CI) to the Windows packages:

  • Builds sentry-native 0.12.8 with the crashpad backend in the Windows job (Sentry's fork now supports MinGW, unlike upstream crashpad)
  • Enables projects.Tiled.sentry:true plus separate debug information for the Windows build
  • Deploys sentry.dll and crashpad_handler.exe to the install root, the zip, and the MSI (guarded by a Sentry WiX define)
  • Uploads DWARF debug symbols and sources to Sentry, mirroring the Linux job
  • Uses the wide-char Sentry path setters on Windows so non-ASCII user profile paths work, and sets the crashpad handler path explicitly

Falling back to SENTRY_BACKEND=breakpad (matching Linux) is a one-line change if the crashpad MinGW build proves troublesome.

The Windows CI job now builds sentry-native 0.12.8 with the crashpad
backend using MinGW, and Tiled is compiled with Sentry support enabled
and separate debug information. The resulting sentry.dll and
crashpad_handler.exe are shipped in both the installer and the archive,
and debug symbols and sources are uploaded to Sentry.

On Windows, the Sentry database and crashpad handler paths are set
using the wide-character variants to support non-ASCII paths, with the
handler expected next to the Tiled executable.
bjorn added 10 commits July 10, 2026 17:09
Crashpad defaults to the system zlib for non-MSVC compilers, but the
MinGW toolchain on the CI runner does not provide one.
Since structured logs and metrics are enabled by default as of
sentry-native 0.14.0, they are now explicitly disabled since we only
use crash reporting.
* Skip building the sentry-native tests and examples. The tests can
  not compile with MinGW GCC since it does not generate the .pdb files
  they rely on.

* Install UASM from the pre-installed MSYS2 and pass it explicitly as
  the ASM_MASM compiler, since crashpad needs a MASM-compatible
  assembler for capture_context_win.asm and safe_terminate_process.asm.
  Passing it on the command line is also needed because crashpad sets
  its UASM fallback only after enable_language(ASM_MASM) has already
  chosen an assembler.
They were built but never used, wasting CI time.
The mingw-w64 headers shipped with the Qt MinGW toolchain declare
WerReportSubmit using PWER_SUBMIT_RESULT without defining that type
(fixed in later mingw-w64 versions). Crashpad has a compat definition
for it, but it is placed after the system header has already been
included, so patch it to apply before instead.
Replaced the werapi.h sed command with a patch file that also fixes
the use of a non-constant array index in offsetof, which is supported
by MSVC and Clang but not by GCC.
The files they apply to will generally have LF line endings, and the
patch tool might not handle mismatching line endings gracefully.
It is created in the repository root when building sentry-native as
done by the CI package builds.
When built with MinGW, CMake names the Sentry library libsentry.dll
rather than sentry.dll.

Also deploy crashpad_wer.dll, which sentry-native automatically
registers when it is found next to crashpad_handler.exe. It enables
capturing fast-fail crashes, like those raised by stack buffer
overrun checks, which bypass regular exception handling.
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