Refactoring Crashpad + uploading debug symbols#691
Refactoring Crashpad + uploading debug symbols#691elviscapiaq wants to merge 2 commits intogoogle:mainfrom
Conversation
50a5f6b to
8186325
Compare
13f9f2e to
58afbcc
Compare
6f47f8f to
4089ee9
Compare
|
Tested on Windows and Linux. @angela28chen @GrantComm, could you please help me test this PR on macOS? Since I’m guessing the Crashpad path dependencies for macOS, please follow this workflow:
What to verify:
If you don't see these messages, please post the error log here. On another note, could you also investigate why the Regression_StackOverflow test is failing on macOS with a timeout? My guess is that because crashpad_handler now runs out-of-process, we might need to increase the timeout. |
I got: Also, do I need to set something up with api key? |
25f1be9 to
af0ec01
Compare
|
Tested on Windows and Linux. @angela28chen , could you help me to test on macOS? |
3c3f0e1 to
3302bb4
Compare
|
Tested on Windows and Linux. |
CMakeLists.txt
Outdated
|
|
||
| option(DIVE_BUILD_WITH_SANITIZER "Build Dive with sanitizers" OFF) | ||
|
|
||
| option(DIVE_BUILD_WITH_CRASHPAD "Build Dive with Crashpad" OFF) |
There was a problem hiding this comment.
I thought that this option is meant to be ON by default? As discussed here: #691 (comment). Please correct me if this is wrong.
I think it's better to have the default (no-option specified) behavior be the one that we want, rather than depend on users to know that they need to be supplying the additional flag -DDIVE_BUILD_WITH_CRASHPAD=ON to achieve the correct behavior for RelWithDebInfo builds.
I believe currently in the presubmits the Debug and RelWithDebInfo builds are both using crash_report_absl.cpp? Shouldn't the RelWithDebInfo be using crash_report_crashpad.cpp instead?
There was a problem hiding this comment.
Thanks for pointing this out. I set up the value to ON and also when the build mode is RelWithDebInfo, then we use the crash_report_crashpad.cpp, otherwise, it uses crash_report_absl.cpp.
There was a problem hiding this comment.
so i guess this comment is not valid anymore since the default is OFF?
There was a problem hiding this comment.
Now the default value is On as discussed below.
|
Also just since this PR is very large (+826 -450) and is still in the review process, what do you think about breaking this into smaller PRs? For example, the part with refactoring the platform-specific shell scripts into |
3302bb4 to
3567521
Compare
@angela28chen , I agree with that. I split this PR into two smaller ones: the first involves refactoring dive_crashpad, and the second is for uploading the debug symbols to the Crashpad server. I plan to push these as different commits. Let me know what you think. |
3567521 to
efd9d76
Compare
efd9d76 to
8708c6c
Compare
|
Fixed the issue, all presubmit tests are passing now. |
That sounds good to me! |
|
|
||
| option(DIVE_BUILD_WITH_SANITIZER "Build Dive with sanitizers" OFF) | ||
|
|
||
| option(DIVE_BUILD_WITH_CRASHPAD "Build Dive with Crashpad" ON) |
There was a problem hiding this comment.
just to make sure i understand this, now with both Debug and RelWithDebInfo build, we build crashpad? or do we disable crashpad for Debug somewhere else?
There was a problem hiding this comment.
We are building Crashpad for both: Debug and RelWithDebInfo, however, we only use Crashpad for RelWithDebInfo while for Debug we use the abls:crashhandler.
To solve this unnecesary building for a Debug build, I am:
- Seting DIVE_BUILD_WITH_CRASHPAD=OFF by default.
- Updating the README.md to be clear about it: To build with Crashpad, set the CMake flag "DIVE_BUILD_WITH_CRASHPAD=ON" and ensure the build type is set to "RelWithDebInfo".
There was a problem hiding this comment.
@angela28chen , let me know what you think about this.
There was a problem hiding this comment.
regarding "Updating the README.md to be clear about it: To build with Crashpad, set the CMake flag "DIVE_BUILD_WITH_CRASHPAD=ON" and ensure the build type is set to "RelWithDebInfo"."
Can we do this automatically: DIVE_BUILD_WITH_CRASHPAD=ON if build type is RelWithDebInfo?
There was a problem hiding this comment.
I have investigated the reliability of that point and it seems that the current change makes it impossible. To build DIVE, we have two stages:
- Configuration stage: Here, we must fetch or find the dependencies. Crashpad should be fetched if it is not present.
- Building stage: Here, we build for [Debug, Release, RelWithDebInfo], and we cannot change the value of
DIVE_BUILD_WITH_CRASHPADtoONorOFF(this action is performed in step 1). If we want aRelWithDebInfobuild, we must have fetched Crashpad, meaning we needDIVE_BUILD_WITH_CRASHPAD=ONin step 1.T
Therefore, if I understand correctly, we have two alternatives:
- Set
DIVE_BUILD_WITH_CRASHPAD=ONby default, and fetch Crashpad if it does not exist, even if the build type is notRelWithDebInfo. This means we always fetch Crashpad for all builds but only link it for theRelWithDebInfobuild. - Set DIVE_BUILD_WITH_CRASHPAD=OFF by default and Crashpad is never fetched, however, for a RelWithDebInfo build we are not going to link Crashpad as it does not exist, and we fallback to absl:handler. Here we need to set DIVE_BUILD_WITH_CRASHPAD=ON during configuration stage for RelWithDebInfo build.
What do you think is a better approach?
There was a problem hiding this comment.
Personally, I feel option 1 is better as when developers build RelWithDebInfo, they automatically get the correct crash handler without remembering to flip a CMake flag. Building RelWithDebInfo should use Crashpad without requiring manual intervention.
There was a problem hiding this comment.
I agreee with that. I updated the value to ON.
ae983c5 to
28655b1
Compare
- This change implements Crashpad as the primary crash reporting system across all platforms (Linux, Windows, and macOS), replacing the existing absl::crashhandler. - Symbol Generation: Developers are now required to install dump_syms via the Rust toolchain or the Linux package manager to generate debug symbols. - Symbol Uploads: Added support for uploading symbols to the Crashpad server using curl via PowerShell (Windows) or Bash (macOS/Linux). - Distribution: Included the crashpad_handler executable in the Dive UI output directory for both development and release builds. - Debug symbols are only generated and uploaded to the Crashpad server for a release build (DIVE_RELEASE_TYPE=RelWithDebInfo).
28655b1 to
fda25a3
Compare
|
Ready for review. I have put all commits into two PRs. |
|
|
||
| option(DIVE_BUILD_WITH_CRASHPAD "Build Dive with Crashpad" ON) | ||
|
|
||
| option(UPLOAD_DEBUG_SYMBOLS "Enable uploading debug symbols to Crashpad" OFF) |
There was a problem hiding this comment.
for this flag, i guess we need to manually change it to ON when we prepare the new release?
Sorry can you clarify which two PRs? I only see this one #691 If you're talking about the two commits on this PR, are you planning to merge without squashing? |
Uh oh!
There was an error while loading. Please reload this page.