Enable Sentry crash reporting for Windows CI builds#4566
Open
bjorn wants to merge 11 commits into
Open
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the existing Sentry integration (currently Linux-only in CI) to the Windows packages:
projects.Tiled.sentry:trueplus separate debug information for the Windows buildsentry.dllandcrashpad_handler.exeto the install root, the zip, and the MSI (guarded by aSentryWiX define)Falling back to
SENTRY_BACKEND=breakpad(matching Linux) is a one-line change if the crashpad MinGW build proves troublesome.