Skip to content

Harden CI against Swift crash backtrace hangs - #4440

Merged
austinywang merged 1 commit into
mainfrom
fix-ci-swift-backtrace-timeout
May 20, 2026
Merged

austinywang merged 1 commit into
mainfrom
fix-ci-swift-backtrace-timeout

Conversation

@austinywang

@austinywang austinywang commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • disable Swift crash catching in the CI unit-test environment with the documented SWIFT_BACKTRACE=enable=no setting
  • keep all shared cmux test schemes (cmux, cmux-ci, cmux-unit) aligned so app-hosted XCTest/UI test runs inherit the same crash-backtrace guard

Context

PR #4437's visible tests job timed out after XCTest restarted from MarkdownPanelTests crashes and the Swift crash backtracer prompt remained in the log. The previous interactive=no setting was not a documented Swift backtrace option, so this uses the supported enable=no switch to disable crash catching entirely.

Validation

  • git diff --check
  • xmllint --noout cmux.xcodeproj/xcshareddata/xcschemes/cmux.xcscheme cmux.xcodeproj/xcshareddata/xcschemes/cmux-ci.xcscheme cmux.xcodeproj/xcshareddata/xcschemes/cmux-unit.xcscheme

I did not run local tests per repository policy; CI must validate this PR.


Note

Low Risk
Low risk: CI/scheme-only configuration change that just alters Swift crash backtrace behavior during tests, with no production code impact.

Overview
Hardens macOS CI test runs against Swift crash-backtrace hangs by switching SWIFT_BACKTRACE to the documented enable=no setting in the tests GitHub Actions job.

Aligns Xcode test schemes (cmux-unit, cmux-ci, and cmux) to set the same environment variable during TestAction, ensuring app-hosted XCTest runs inherit the guard consistently.

Reviewed by Cursor Bugbot for commit 76799fe. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Chores
    • CI and local test schemes updated to disable the Swift crash backtracer, ensuring tests run without the backtrace catcher.
    • Comments and test environment configurations adjusted to accurately reflect the new disabled behavior across CI and project test schemes.

Review Change Stack

@vercel

vercel Bot commented May 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment May 20, 2026 12:58pm
cmux-staging Building Building Preview, Comment May 20, 2026 12:58pm

@greptile-apps

greptile-apps Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a CI timeout issue by replacing the undocumented SWIFT_BACKTRACE=interactive=no,color=no with the supported enable=no setting, which fully disables Swift's crash backtracer and prevents xcodebuild from hanging when an XCTest app-host process crashes.

  • ci.yml: Updates the tests job's SWIFT_BACKTRACE env var from the unsupported interactive=no,color=no value to enable=no, and adds a clarifying comment.
  • cmux-unit.xcscheme / cmux-ci.xcscheme: Align the scheme-level SWIFT_BACKTRACE override with the new enable=no value; cmux-ci.xcscheme gains a new EnvironmentVariables block.
  • cmux.xcscheme: Adds SWIFT_BACKTRACE=enable=no to the main scheme's TestAction so UI test runs with the default scheme inherit the same non-hanging behavior.

Confidence Score: 5/5

Safe to merge — all four files receive the same well-scoped environment variable tweak with no logic changes.

The change replaces an undocumented SWIFT_BACKTRACE value with the supported enable=no flag across CI config and all three shared Xcode schemes. The fix is targeted, consistent, and directly addresses the documented hang scenario without touching any Swift source or build logic.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Replaces unsupported SWIFT_BACKTRACE value with documented enable=no; comment updated to match.
cmux.xcodeproj/xcshareddata/xcschemes/cmux-unit.xcscheme Updates existing SWIFT_BACKTRACE scheme variable from invalid value to enable=no, keeping unit test scheme aligned with CI.
cmux.xcodeproj/xcshareddata/xcschemes/cmux-ci.xcscheme Adds new EnvironmentVariables block with SWIFT_BACKTRACE=enable=no to TestAction; no prior override existed for this scheme.
cmux.xcodeproj/xcshareddata/xcschemes/cmux.xcscheme Adds SWIFT_BACKTRACE=enable=no to the main scheme's TestAction (UI tests); broadens the crash-backtrace guard to local developer UI test runs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[XCTest run starts] --> B{App-host process crashes?}
    B -- No --> C[Tests complete normally]
    B -- Yes --> D{SWIFT_BACKTRACE setting}
    D -- "interactive=no,color=no (old, undocumented)" --> E[Crash backtracer may still prompt or hang indefinitely]
    E --> F[CI job times out after 45 min]
    D -- "enable=no (new, documented)" --> G[Crash catcher disabled entirely]
    G --> H[xcodebuild exits promptly]
    H --> I[CI job continues / fails fast]
Loading

Reviews (3): Last reviewed commit: "Harden CI against Swift crash backtrace ..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented May 20, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Change SWIFT_BACKTRACE from interactive=no,color=no to enable=no in the GitHub Actions tests job and in Xcode test schemes (cmux.xcscheme, cmux-unit.xcscheme, cmux-ci.xcscheme).

Changes

Swift Crash Backtrace Configuration

Layer / File(s) Summary
Update SWIFT_BACKTRACE in CI and Xcode schemes
.github/workflows/ci.yml, cmux.xcodeproj/xcshareddata/xcschemes/cmux.xcscheme, cmux.xcodeproj/xcshareddata/xcschemes/cmux-unit.xcscheme, cmux.xcodeproj/xcshareddata/xcschemes/cmux-ci.xcscheme
SWIFT_BACKTRACE changed to enable=no in the GitHub Actions tests job env and added/updated inside TestAction EnvironmentVariables for the project's Xcode schemes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I nudged the backtrace, soft and small,
"Quiet your chatter," I said to all.
With enable=no the prompts took flight,
Tests hop along in peaceful night. 🥕

🚥 Pre-merge checks | ✅ 17
✅ Passed checks (17 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: disabling Swift crash backtrace handling to prevent CI hangs. It directly describes the core issue and solution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PR only modifies CI/test configuration files with SWIFT_BACKTRACE environment variable changes. No production Swift source code actor isolation issues introduced.
Cmux Swift Blocking Runtime ✅ Passed PR modifies only CI configuration files (workflows and Xcode schemes) to disable Swift crash backtrace. No blocking synchronization primitives introduced in Swift code.
Cmux No Hacky Sleeps ✅ Passed PR changes only CI workflow YAML (out of scope) and Xcode scheme XML config; no sleeps, timers, or polling logic introduced in covered runtime scripts.
Cmux Swift Concurrency ✅ Passed PR modifies only CI configuration files (YAML/XML) without introducing Swift code or legacy async patterns. No .swift files changed.
Cmux Swift @Concurrent ✅ Passed PR modifies only CI/Xcode configuration files (YAML/XML), not Swift source code, so @concurrent annotation rules do not apply.
Cmux Swift File And Package Boundaries ✅ Passed PR modifies only CI configuration files (YAML, XML) with no Swift source code changes; custom check targets Swift file architecture and is not applicable.
Cmux Swift Logging ✅ Passed PR contains only CI/test configuration changes (YAML workflow and XML scheme files); no Swift source code or logging statements added or modified.
Cmux User-Facing Error Privacy ✅ Passed PR changes CI/test configuration only (SWIFT_BACKTRACE env var in workflows and Xcode schemes), not user-facing error messages or outputs. Changes are to operational infrastructure not shown to users.
Cmux Full Internationalization ✅ Passed PR contains only CI test configuration (SWIFT_BACKTRACE environment variables). No user-facing strings, localization, or internationalization changes present.
Cmux Swiftui State Layout ✅ Passed PR contains only CI/build configuration changes (YAML and XML scheme files). No SwiftUI source code or state management patterns modified, so SwiftUI state layout rules do not apply.
Cmux Architecture Rethink ✅ Passed PR makes test-only environment variable changes to disable SWIFT_BACKTRACE in CI, which is explicitly allowed by the architectural rethink guidelines as test-only configuration changes.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR contains no Swift code changes for windows. All changes are CI configuration (GitHub Actions workflow and Xcode scheme files with SWIFT_BACKTRACE environment variable modifications only).
Description check ✅ Passed PR description covers the core sections: what changed, context, and validation steps performed. However, Testing and Demo Video sections are missing, and Checklist items are not addressed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-ci-swift-backtrace-timeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 156-158: The SWIFT_BACKTRACE environment variable is set with
undocumented parameters; change the value of SWIFT_BACKTRACE (used in the CI
workflow) to only include the supported option "enable=no" instead of
"enable=no,interactive=no,timeout=0s,color=no"; remove the unsupported keys
(interactive, timeout, color) and, if you need other formatting, use documented
parameters such as preset, sanitize, limit, or cache per Swift docs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 098ec221-2f98-4a5c-80f3-d8758bfa8ac1

📥 Commits

Reviewing files that changed from the base of the PR and between bea8551 and a6c82b9.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • cmux.xcodeproj/xcshareddata/xcschemes/cmux-unit.xcscheme

Comment thread .github/workflows/ci.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmux.xcodeproj/xcshareddata/xcschemes/cmux-unit.xcscheme`:
- Line 23: Add the SWIFT_BACKTRACE environment variable to the cmux scheme's
TestAction so UI tests cannot hang on backtracer; specifically, in the
cmux-unit.xcscheme TestAction add an EnvironmentVariable entry with
key="SWIFT_BACKTRACE", value="enable=no" and isEnabled="YES" (matching the
existing TestAction in the cmux-unit scheme and the tests job setting) to ensure
consistent protection across test schemes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6620b098-b390-45dd-a94d-655ab1018c25

📥 Commits

Reviewing files that changed from the base of the PR and between a6c82b9 and 326c5df.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • cmux.xcodeproj/xcshareddata/xcschemes/cmux-unit.xcscheme

Comment thread cmux.xcodeproj/xcshareddata/xcschemes/cmux-unit.xcscheme

This branch was successfully deployed

1 active deployment
Preview – cmux — 76799fe1 Deployed May 20, 2026 by vercel[bot]
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.

1 participant