更新崩溃报告(Crashpad)
优质
小牛编辑
132浏览
2023-12-01
获取crashpad的版本信息
libcc/src/third_party/crashpad/README.chromium
将会有一个带有 校验和(checksum)的Revision:
信息- 检出到相应的分支
- 获取Google的奔溃报告 (https://chromium.googlesource.com/crashpad/crashpad),
git clone https://chromium.googlesource.com/crashpad/crashpad
用版本校验和检出分支
git checkout <revision checksum>
- 将electron的奔溃报告分支作为远程
git remote add electron https://github.com/electron/crashpad
- 为更新检出一个新的分支
git checkout -b electron-crashpad-vA.B.C.D
A.B.C.D
是 Chromium 的版本,可以在libcc/VERSION
中查看,版本信息将应类似于62.0.3202.94
用
git log --oneline
为Electron的补丁生成一个分支列表。- 可参考https://github.com/electron/crashpad/commits/previous-branch-name
每一个补丁:
- 在
electron-crashpad-vA.B.C.D
中, 单向拣取补丁的校验和 git cherry-pick <checksum>
- 消除冲突
- 首先确保它能构建成功,然后依次执行add, commit, 和 push,将补丁添加到electron 的 crashpad 分支
git push electron electron-crashpad-vA.B.C.D
- 在
更新Electron,创建新的crashpad分支:
cd vendor/crashpad
git fetch
git checkout electron-crashpad-v62.0.3202.94
为两个版本的Electron重新生成相应的Ninja文件
- 在Electron根目录的上一级目录中,运行
script/update.py
script/build.py -c D --target=crashpad_client
script/build.py -c D --target=crashpad_handler
- 确保两个构建过程没有抛出异常,
- 在Electron根目录的上一级目录中,运行
将变更内容Push到子模块的引用部分。
- (在 electron 的根目录下)
git add vendor/crashpad
git push origin upgrade-to-chromium-62
- (在 electron 的根目录下)
Upgrading Crashpad
- Get the version of crashpad that we're going to use.
libcc/src/third_party/crashpad/README.chromium
will have a lineRevision:
with a checksum- We need to check out the corresponding branch.
Clone Google's crashpad (https://chromium.googlesource.com/crashpad/crashpad)
git clone https://chromium.googlesource.com/crashpad/crashpad
Check out the branch with the revision checksum:
git checkout <revision checksum>
Add electron's crashpad fork as a remote
git remote add electron https://github.com/electron/crashpad
Check out a new branch for the update
git checkout -b electron-crashpad-vA.B.C.D
A.B.C.D
is the Chromium version found inlibcc/VERSION
and will be something like62.0.3202.94
Make a checklist of the Electron patches that need to be applied with
git log --oneline
- Or view https://github.com/electron/crashpad/commits/previous-branch-name
For each patch:
In
electron-crashpad-vA.B.C.D
, cherry-pick the patch's checksumgit cherry-pick <checksum>
- Resolve any conflicts
Make sure it builds then add, commit, and push work to electron's crashpad fork
git push electron electron-crashpad-vA.B.C.D
- Update Electron to build the new crashpad:
cd vendor/crashpad
git fetch
git checkout electron-crashpad-v62.0.3202.94
- Regenerate Ninja files against both targets
- From Electron root's root, run
script/update.py
script/build.py -c D --target=crashpad_client
script/build.py -c D --target=crashpad_handler
- Both should build with no errors
- Push changes to submodule reference
- (From electron root)
git add vendor/crashpad
git push origin upgrade-to-chromium-62