Skip to content

CI (Apple): read the iOS exit code from the last stderr line and print crash reports on failure - #242

Open
matthargett wants to merge 1 commit into
BabylonJS:mainfrom
rebeckerspecialties:ci-apple-crash-reports
Open

matthargett wants to merge 1 commit into
BabylonJS:mainfrom
rebeckerspecialties:ci-apple-crash-reports

Conversation

@matthargett

@matthargett matthargett commented Sep 16, 2026

Copy link
Copy Markdown

Problem

build-ios.yml captures the simulator app's stderr into a file and runs (exit $(cat /tmp/exitCode)). The app writes its exit code as the last line of stderr (iOS/App.mm), but anything else a test writes there — or nothing at all after a crash — makes bash fail with exit: numeric argument required, so the job ends with 255 and no diagnostics. On the fork this hid a run in which every test had passed (a Worker test prints progress to stderr).

Neither Apple job prints crash reports: a JavaScriptCore RELEASE_ASSERT ends the process with EXC_BREAKPOINT, which the shell reports as exit 137 with no gtest summary; the .ips under ~/Library/Logs/DiagnosticReports has the faulting stack.

Changes

  • iOS: echo the stderr capture and use only its last line as the exit code.
  • iOS + macOS: a failure-only "Collect crash reports" step that prints the simulator's unified log for the process (iOS) and decodes the newest UnitTests*.ips reports (exception, termination, faulting-thread frames).

Workflow-only change; both files parse. Fork twin: rebeckerspecialties#26.

…t crash reports

The iOS step captured the app's whole stderr and handed it to `exit`,
so any test output on stderr (or nothing at all, after a crash) ends the
job with bash's "numeric argument required" as 255 and no diagnostics.
Use the last line only, echo the capture, and on failure print the
simulator's unified log for the process plus ReportCrash's .ips files.

macOS gets the same failure-only .ips step: a JavaScriptCore
RELEASE_ASSERT ends the process with EXC_BREAKPOINT, which the shell
reports as exit 137 with no gtest summary; the report has the stack.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes address CI diagnostics; only a minor documentation nit remains.

Pull request overview

Improves Apple CI exit-code handling and crash diagnostics for iOS and macOS tests.

Changes:

  • Reads the iOS exit code from the final stderr line.
  • Collects simulator logs and decodes crash reports on failures.

Review note: A minor nit requests updating the stale /tmp/exitCode comment.

File summaries
File Summary
.github/workflows/build-ios.yml Updates exit-code handling and adds crash diagnostics.
.github/workflows/build-macos.yml Adds macOS crash-report decoding.
Review details

Suppressed comments (1)

.github/workflows/build-ios.yml:49

  • This changes the capture file from /tmp/exitCode to /tmp/stderr, but Tests/UnitTests/Shared/StandardStreamLogger.cpp:182-184 still says the CI handshake uses /tmp/exitCode and that any stderr output corrupts it. Please update that comment in the same change; it is now misleading about both the path and the accepted stderr behavior.
          xcrun simctl launch --console booted "com.jsruntimehost.unittests" 2> /tmp/stderr
          cat /tmp/stderr
          (exit "$(tail -n 1 /tmp/stderr)")
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

matthargett added a commit to rebeckerspecialties/JsRuntimeHost that referenced this pull request Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants