From e35dd53649dce5fdebc4befefe0d2438b557a5f2 Mon Sep 17 00:00:00 2001 From: Reactor Scram Date: Wed, 31 Jan 2024 19:36:10 -0600 Subject: [PATCH] ci(windows): Upload Windows debug symbols (#3467) Closes #3450 I was able to get stacktraces from a crash generated inside my VM. It picked out the correct line in gui.rs where the crash was triggered. ![image](https://github.com/firezone/firezone/assets/13400041/1fc521a1-059c-489b-b9b8-506570a4df0f) ![image](https://github.com/firezone/firezone/assets/13400041/17e4bdd9-cd2a-477a-821a-ab23e61eadf7) --- .github/workflows/_rust.yml | 9 +++++++++ .github/workflows/cd.yml | 2 ++ .../src-tauri/src/client/crash_handling.rs | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/.github/workflows/_rust.yml b/.github/workflows/_rust.yml index 4294a7915..16b971cf4 100644 --- a/.github/workflows/_rust.yml +++ b/.github/workflows/_rust.yml @@ -101,9 +101,11 @@ jobs: # In release mode the name comes from tauri.conf.json cp "../target/release/Firezone.exe" "${{ env.BINARY_DEST_PATH }}-x64.exe" cp "../target/release/bundle/msi/*.msi" "${{ env.BINARY_DEST_PATH }}-x64.msi" + cp "../target/release/firezone_windows_client.pdb" "${{ env.BINARY_DEST_PATH }}-x64.pdb" Get-FileHash ${{ env.BINARY_DEST_PATH }}-x64.exe -Algorithm SHA256 | Select-Object Hash > ${{ env.BINARY_DEST_PATH }}-x64.exe.sha256sum.txt Get-FileHash ${{ env.BINARY_DEST_PATH }}-x64.msi -Algorithm SHA256 | Select-Object Hash > ${{ env.BINARY_DEST_PATH }}-x64.msi.sha256sum.txt + Get-FileHash ${{ env.BINARY_DEST_PATH }}-x64.pdb -Algorithm SHA256 | Select-Object Hash > ${{ env.BINARY_DEST_PATH }}-x64.pdb.sha256sum.txt # This might catch regressions in #3384, depending how CI runners # handle exit codes @@ -122,6 +124,13 @@ jobs: path: | ${{ github.workspace }}/rust/windows-client/windows-client-x64.msi ${{ github.workspace }}/rust/windows-client/windows-client-x64.msi.sha256sum.txt + - name: Save Windows debug symbols + uses: actions/upload-artifact@v4 + with: + name: windows-client-x64-pdb + path: | + ${{ github.workspace }}/rust/windows-client/windows-client-x64.pdb + ${{ github.workspace }}/rust/windows-client/windows-client-x64.pdb.sha256sum.txt smoke-test-relay: runs-on: ubuntu-22.04 diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index b87364a93..f7df11d95 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -262,6 +262,8 @@ jobs: - uses: ./.github/actions/setup-node - name: Build release binaries run: | + # Build Windows Tauri GUI + pnpm install pnpm build diff --git a/rust/windows-client/src-tauri/src/client/crash_handling.rs b/rust/windows-client/src-tauri/src/client/crash_handling.rs index 1a7702e83..5d0c1113d 100755 --- a/rust/windows-client/src-tauri/src/client/crash_handling.rs +++ b/rust/windows-client/src-tauri/src/client/crash_handling.rs @@ -3,6 +3,15 @@ //! Mostly copied from //! //! TODO: Capture crash dumps on panic. +//! +//! To get human-usable stack traces out of a dump, do this: +//! (Copied from ) +//! +//! - Get the pdb corresponding to the client exe +//! - `cargo install dump_syms` +//! - Use dump_syms to convert the pdb to a syms file +//! - Compile `minidump-stackwalk` with PR 891 merged +//! - `minidump-stackwalker --symbols-path firezone.syms crash.dmp` use crate::client::settings::app_local_data_dir; use anyhow::{anyhow, bail, Context, Result};