Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Crashpad Support on Windows #4351

Merged
merged 30 commits into from
Feb 12, 2023
Merged

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Feb 1, 2023

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

This PR adds support for building with crashpad. Currently, only Windows is supported, though support for other platforms should only require minor modifications.
The behavior is as described in #4349. The only difference now is that it's using the crashpad fork from sentry (getsentry/crashpad, modifications). It's not enabled by default - you need to enable BUILD_WITH_CRASHPAD.

Build instructions

To get meaningful minidumps, you need to have debug symbols enabled. So you need to build in Debug or RelWithDebInfo.

Here, we're building in RelWithDebInfo mode.

  1. Configure your build environment
    • In the case of conan, you need to tell it to build in RelWithDebInfo mode:
      conan install .. -s build_type=RelWithDebInfo -b missing -pr:b=default
  2. Configure the project
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_WITH_CRASHPAD=On ..
  1. Build chatterino
cmake --build .
  1. Build crashpad_handler
cmake --build . --target crashpad_handler

CHANGELOG.md Outdated
@@ -45,6 +45,7 @@
- Dev: Added CMake Install Support on Windows. (#4300)
- Dev: Changed conan generator to [`CMakeDeps`](https://docs.conan.io/en/latest/reference/conanfile/tools/cmake/cmakedeps.html) and [`CMakeToolchain`](https://docs.conan.io/en/latest/reference/conanfile/tools/cmake/cmaketoolchain.html). See PR for migration notes. (#4335)
- Dev: Refactored 7TV EventAPI implementation. (#4342)
- Dev: Added support for building with crashpad. See PR for build instructions. (#4351)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this stays in CI this could be changed into a minor entry.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should stay in CI

Someone (crashpad) includes Windows.h before winsock2.h
@Nerixyz
Copy link
Contributor Author

Nerixyz commented Feb 12, 2023

Regarding 88827c4 and the build failure: https://stackoverflow.com/questions/5971332/redefinition-errors-in-winsock2-h tl;dr: you have to include winsock2.h before Windows.h. Crashpad includes Windows.h and websocketpp includes winsock2.h (for the client). It was easier to remove the include for websocketpp's client.

@pajlada pajlada merged commit e377c30 into Chatterino:master Feb 12, 2023
@Nerixyz Nerixyz deleted the feat/crashpad branch February 12, 2023 19:37
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.

2 participants