Files
upstream-tauri-plugins/.scripts/ci/collect-macos-crash-reports.sh
upstream-mirror 9ad64ec987
Some checks failed
integration tests / run-integration-tests (windows-latest) (push) Has been cancelled
Test Rust / test (push) Has been cancelled
test plugins e2e (mobile) / ios (push) Has been cancelled
test plugins e2e / test (map[name:Windows os:windows-latest]) (push) Has been cancelled
test plugins e2e / test (map[name:macOS os:macos-latest]) (push) Has been cancelled
integration tests / run-integration-tests (macos-latest) (push) Has been cancelled
version or publish / version-or-publish (push) Failing after 0s
integration tests / run-integration-tests (ubuntu-22.04) (push) Failing after 0s
Lint JavaScript / eslint (push) Failing after 0s
Sync / sync-to-mirrors (push) Failing after 0s
test plugins e2e (mobile) / android (push) Failing after 0s
test plugins e2e / test (map[name:Linux os:ubuntu-latest]) (push) Failing after 0s
Test Rust / changes (push) Failing after 0s
Lint Rust / changes (push) Failing after 0s
Lint Rust / clippy (push) Has been skipped
Audit Rust / audit-rust (push) Failing after 1s
Audit JavaScript / audit-js (push) Failing after 1s
snapshot of https://github.com/tauri-apps/plugins-workspace.git (v2, 2026-09-23; blobs > 131072B omitted)
2026-09-23 17:17:10 +05:00

51 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# Collects and prints macOS crash reports after a failed plugins e2e run.
#
# The CrabNebula Webdriver proxies every command to a server running *inside* the app
# process, so when the app dies the suite only ever reports `connection refused` — the
# actual cause is never in the job log. The app's stdout/stderr is inherited and no panic
# message is printed, which means it goes down on a signal. macOS records the reason in a
# crash report, and that is the only place it survives the run.
#
# Copies every report into $1 (default: $RUNNER_TEMP/crash-reports) for upload.
set -euo pipefail
dest="${1:-${RUNNER_TEMP:-/tmp}/crash-reports}"
mkdir -p "$dest"
# ReportCrash writes asynchronously; give the last crash a moment to land.
sleep 5
found=0
for f in "$HOME/Library/Logs/DiagnosticReports"/*.ips \
"$HOME/Library/Logs/DiagnosticReports/Retired"/*.ips; do
[ -e "$f" ] || continue
found=$((found + 1))
cp "$f" "$dest/"
echo "::group::$(basename "$f")"
# An .ips file is a one-line JSON header followed by the JSON report body.
head -n 1 "$f"
tail -n +2 "$f" | jq -r '
"exception: \(.exception // {} | tojson)",
"termination: \(.termination // {} | tojson)",
"asi: \(.asi // {} | tojson)",
"faulting thread \(.faultingThread // 0):",
(. as $r
| $r.threads[$r.faultingThread // 0].frames[]?
| " \($r.usedImages[.imageIndex].name // "?") \(.symbol // "?") +\(.imageOffset)"),
"last ObjC exception:",
(. as $r
| $r.lastExceptionBacktrace[]?
| " \($r.usedImages[.imageIndex].name // "?") \(.symbol // "?") +\(.imageOffset)")
' || cat "$f"
echo "::endgroup::"
done
[ "$found" -gt 0 ] || echo "no crash reports under $HOME/Library/Logs/DiagnosticReports"