mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 02:53:25 -08:00
[CrashReporting] Breakpad everywhere, session detection, symbol CI (inc 3)
Breakpad on all platforms (no crashpad packaging); remove the Windows MiniDumpWithFullMemory filter and the installer WER LocalDumps full-dump registration. QLockFile per-process session tracking replaces the Windows-only .dmp scan, placed after parser.process and the instance hand-off so help/version exits and handed-off secondaries never leak a lock. CI: Release-only DSN bake from SENTRY_DSN secret, tag-only sentry-cli symbol upload (org cockatrice, project native). Tests: 533/533 ctest green, format clean, code gate PASS.
This commit is contained in:
parent
69b421f1c2
commit
c40763e61d
8 changed files with 362 additions and 102 deletions
108
.github/workflows/desktop-build.yml
vendored
108
.github/workflows/desktop-build.yml
vendored
|
|
@ -46,6 +46,11 @@ jobs:
|
|||
outputs:
|
||||
tag: ${{ steps.configure.outputs.tag }}
|
||||
sha: ${{ steps.configure.outputs.sha }}
|
||||
# MAJ.MIN.PATCH[-beta[.N]] of a tag build; empty otherwise. Mirrors what
|
||||
# cmake/getversion.cmake derives as PROJECT_VERSION, which the client bakes as its
|
||||
# Sentry release (cmake/CrashReporting.cmake) — symbol uploads must use the same
|
||||
# string so stack traces de-symbolicate against this build's binaries.
|
||||
sentry_release: ${{ steps.configure.outputs.sentry_release }}
|
||||
|
||||
steps:
|
||||
- name: "Configure"
|
||||
|
|
@ -56,6 +61,9 @@ jobs:
|
|||
run: |
|
||||
if [[ "$GITHUB_REF_TYPE" == 'tag' ]]; then # release
|
||||
echo "tag=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
|
||||
# Tag format is YYYY-MM-DD-{Release|Development}-MAJ.MIN.PATCH[-beta[.N]];
|
||||
# PROJECT_VERSION is the tail after the type (see cmake/getversion.cmake).
|
||||
echo "sentry_release=$(sed -E 's/^[0-9]{4}-[0-9]{2}-[0-9]{2}-(Release|Development)-//' <<< "$GITHUB_REF_NAME")" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "sha=$RESOLVED_SHA" >> "$GITHUB_OUTPUT"
|
||||
|
||||
|
|
@ -240,6 +248,11 @@ jobs:
|
|||
package: '${{ matrix.package }}'
|
||||
server_only: '${{ matrix.server_only }}'
|
||||
WITH_CRASH_REPORTING: 'ON'
|
||||
# Tag builds only: artifacts from master pushes and PR branches must not report to
|
||||
# Sentry. Forks get no secrets on pull_request, so they keep the mock fallback either way.
|
||||
# configure.outputs.tag is set for ANY tag, so beta (Development) tags get the DSN
|
||||
# and the symbol upload below just like full releases.
|
||||
COCKATRICE_SENTRY_DSN: ${{ needs.configure.outputs.tag != null && secrets.SENTRY_DSN || '' }}
|
||||
run: |
|
||||
source .ci/docker.sh
|
||||
args=()
|
||||
|
|
@ -248,9 +261,47 @@ jobs:
|
|||
args+=(--ccache "$CCACHE_SIZE")
|
||||
args+=(--cmake-generator "$CMAKE_GENERATOR")
|
||||
args+=(--suffix "$SUFFIX")
|
||||
# The container inherits no environment, so the DSN rides in explicitly. -e without
|
||||
# =value passes it through (possibly empty); compile.sh only consumes it for Release
|
||||
# configures, and empty keeps the mock fallback.
|
||||
export RUN_ARGS="${RUN_ARGS:-} -e COCKATRICE_SENTRY_DSN"
|
||||
|
||||
RUN --server --release --package "$package" "${args[@]}"
|
||||
|
||||
- name: "Install sentry-cli"
|
||||
if: matrix.package != 'skip' && needs.configure.outputs.tag != null
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_CLI_VERSION: '3.8.0'
|
||||
run: |
|
||||
export INSTALL_DIR="$GITHUB_WORKSPACE/.sentry-cli"
|
||||
curl -sL https://sentry.io/get-cli/ | bash
|
||||
echo "$GITHUB_WORKSPACE/.sentry-cli" >> "$GITHUB_PATH"
|
||||
|
||||
- name: "Upload debug symbols to Sentry"
|
||||
# Like the DSN above, this runs for every tag — beta (Development) tags included.
|
||||
if: matrix.package != 'skip' && needs.configure.outputs.tag != null
|
||||
# A Sentry outage or rotated token must not take down the release assets below.
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
# Same release string the client reports its events under (COCKATRICE_SENTRY_RELEASE
|
||||
# = PROJECT_VERSION, see cmake/CrashReporting.cmake), so stack traces from this build
|
||||
# de-symbolicate against these symbols.
|
||||
SENTRY_RELEASE: ${{ needs.configure.outputs.sentry_release }}
|
||||
run: |
|
||||
paths=()
|
||||
for dir in build/cockatrice build/oracle build/servatrice; do
|
||||
[[ -d $dir ]] && paths+=("$dir")
|
||||
done
|
||||
if [[ ${#paths[@]} == 0 ]]; then
|
||||
echo "No build output dirs found, skipping symbol upload"
|
||||
exit 0
|
||||
fi
|
||||
# Project slug on Sentry; must match the project the baked DSN points at.
|
||||
sentry-cli debug-files upload --org cockatrice --project cockatrice-desktop --release "$SENTRY_RELEASE" "${paths[@]}"
|
||||
|
||||
# Delete used cache to emulate a ccache update. See https://github.com/actions/cache/issues/342
|
||||
- name: "Delete remote compiler cache (ccache)"
|
||||
if: github.ref == 'refs/heads/master' && steps.restore_ccache.outputs.cache-hit
|
||||
|
|
@ -536,6 +587,11 @@ jobs:
|
|||
BUILDTYPE: '${{ matrix.type }}'
|
||||
CCACHE_EVICTION_AGE: ${{ matrix.ccache_eviction_age }}
|
||||
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
|
||||
# Tag builds only: artifacts from master pushes and PR branches must not report to
|
||||
# Sentry. Forks get no secrets on pull_request, so they keep the mock fallback either way.
|
||||
# configure.outputs.tag is set for ANY tag, so beta (Development) tags get the DSN
|
||||
# and the symbol upload below just like full releases.
|
||||
COCKATRICE_SENTRY_DSN: ${{ needs.configure.outputs.tag != null && secrets.SENTRY_DSN || '' }}
|
||||
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
|
||||
GITHUB_TOKEN: ${{ github.token }} # needed for vcpkg dependency graph updates, see VCPKG_FEATURE_FLAGS
|
||||
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
|
||||
|
|
@ -563,6 +619,58 @@ jobs:
|
|||
WITH_CRASH_REPORTING: ${{ matrix.type == 'Release' && 'ON' || '' }}
|
||||
run: .ci/compile.sh --server --test --vcpkg
|
||||
|
||||
- name: "Install sentry-cli"
|
||||
if: needs.configure.outputs.tag != null && matrix.make_package == '1'
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_CLI_VERSION: '3.8.0'
|
||||
run: |
|
||||
export INSTALL_DIR="$GITHUB_WORKSPACE/.sentry-cli"
|
||||
curl -sL https://sentry.io/get-cli/ | bash
|
||||
echo "$GITHUB_WORKSPACE/.sentry-cli" >> "$GITHUB_PATH"
|
||||
|
||||
- name: "Upload debug symbols to Sentry"
|
||||
# Like the DSN above, this runs for every tag — beta (Development) tags included.
|
||||
if: needs.configure.outputs.tag != null && matrix.make_package == '1'
|
||||
# A Sentry outage or rotated token must not take down the release assets below.
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
# Same release string the client reports its events under (COCKATRICE_SENTRY_RELEASE
|
||||
# = PROJECT_VERSION, see cmake/CrashReporting.cmake), so stack traces from this build
|
||||
# de-symbolicate against these symbols.
|
||||
SENTRY_RELEASE: ${{ needs.configure.outputs.sentry_release }}
|
||||
run: |
|
||||
paths=()
|
||||
if [[ '${{ matrix.os }}' == 'Windows' ]]; then
|
||||
# Top-level CMakeLists.txt links /DEBUG even in release, so PDBs land
|
||||
# next to the binaries (same dirs as the PDB artifact step below).
|
||||
for dir in build/cockatrice/Release build/oracle/Release build/servatrice/Release; do
|
||||
[[ -d $dir ]] && paths+=("$dir")
|
||||
done
|
||||
else
|
||||
# Release builds carry DWARF (-g, kept by CrashReporting.cmake); macOS keeps its
|
||||
# debug info in dSYM bundles, so materialize them before uploading.
|
||||
for app in cockatrice oracle servatrice; do
|
||||
binary="build/$app/$app.app/Contents/MacOS/$app"
|
||||
if [[ -f $binary ]]; then
|
||||
if [[ '${{ matrix.os }}' == 'macOS' ]]; then
|
||||
dsymutil "$binary" -o "$binary.dSYM"
|
||||
paths+=("$binary.dSYM")
|
||||
else
|
||||
paths+=("$binary")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [[ ${#paths[@]} == 0 ]]; then
|
||||
echo "No symbol paths found, skipping symbol upload"
|
||||
exit 0
|
||||
fi
|
||||
# Project slug on Sentry; must match the project the baked DSN points at.
|
||||
sentry-cli debug-files upload --org cockatrice --project cockatrice-desktop --release "$SENTRY_RELEASE" "${paths[@]}"
|
||||
|
||||
# CPack reports a failed makensis run as "Problem running NSIS command"
|
||||
# plus a path to NSISOutput.log, and that log lives only on the runner, so
|
||||
# the actual compile error is otherwise nowhere in the workflow output.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue