Skip to content

macOS Swift Compiler Crash in OnboardingView+Wizard.swift #139

@daveonkels

Description

@daveonkels

Date: 2026-01-03
Severity: Critical (Blocks macOS app build)
Status: Unresolved
Upstream Commit: 73fa2e1 (refactor: split gateway server methods)
Upstream Issue: https://github.com/steipete/clawdis (needs to be reported)

Summary

The Swift compiler crashes when building the macOS app after pulling the latest updates (76 commits from 33cdb16 to 73fa2e1). The crash occurs during compilation of OnboardingView+Wizard.swift, which is part of the new onboarding wizard feature.

Error Details

swift-frontend: <compiler arguments>
Compiling OnboardingView+Wizard.swift
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
<...stack trace...>

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Compiler crashed with signal code 6

Reproduction Steps

  1. Start with working commit: 33cdb16b
  2. Pull latest updates:
    git -C ~/.clawdis-src pull origin main
    # Updates to commit 73fa2e10 (76 new commits)
  3. Install dependencies:
    pnpm --dir ~/.clawdis-src install
  4. Build TypeScript code (succeeds):
    pnpm --dir ~/.clawdis-src run build
    # Build completes successfully
  5. Attempt to build macOS app:
    ~/.clawdis-src/scripts/package-mac-app.sh
    # Crashes during Swift compilation

Environment

  • macOS Version: Darwin 25.2.0
  • Xcode/Swift: System default (via swift-frontend)
  • Node Version: >=22.12.0
  • pnpm Version: 10.23.0
  • Last Working Commit: 33cdb16
  • First Broken Commit: Unknown (somewhere between 33cdb16 and 73fa2e1)

Affected Files

Based on the compiler output, the crash occurs when compiling:

  • apps/macos/Sources/Clawdis/OnboardingView+Wizard.swift (new file)

Related files in the same feature:

  • apps/macos/Sources/Clawdis/OnboardingWizard.swift (new file, 400 lines)
  • apps/macos/Sources/Clawdis/OnboardingView+Actions.swift (modified)
  • apps/macos/Sources/Clawdis/OnboardingView+Layout.swift (modified)
  • apps/macos/Sources/Clawdis/OnboardingView+Pages.swift (modified)

Changes in the Pull

This pull included 343 files changed with major updates:

  • ✅ TypeScript build: Successful
  • ✅ Gateway refactor: Successful
  • ❌ macOS Swift build: CRASHED

Key changes that might be related:

  • New onboarding wizard feature (multiple Swift files added/modified)
  • Bundle ID change: com.steipete.clawdiscom.clawdis
  • TUI overhaul
  • Gateway server split into multiple modules
  • New skills: github, bear-notes, tmux

Workarounds Attempted

❌ Failed Attempts

  1. Clean build directory:

    rm -rf ~/.clawdis-src/apps/macos/.build
    ~/.clawdis-src/scripts/package-mac-app.sh
    # Still crashes
  2. Multiple build attempts: Same crash every time

✅ Working Workarounds

  1. Use previous Mac app build (from commit 33cdb16):

    • The old Mac app binary still exists and should work
    • Located at: ~/.clawdis-src/dist/Clawdis.app
    • Built before the problematic pull
  2. Use CLI directly:

    clawdis gateway
    # Or via pnpm for development mode
    pnpm --dir ~/.clawdis-src clawdis gateway

Stack Trace Analysis

The crash occurs in the Swift constraint solver:

swift::constraints::ConstraintSystem::getTypeOfMemberReference(...)
swift::constraints::ConstraintSystem::resolveOverload(...)
swift::constraints::ConstraintSystem::simplifyConstraint(...)

This suggests the compiler is having trouble resolving type constraints in the new wizard code, possibly due to:

  • Complex generic type inference
  • Ambiguous overload resolution
  • Recursive type constraints
  • SwiftUI view builder complexity

Impact

  • TypeScript gateway code: Works fine (builds successfully)
  • Gateway functionality: Not affected
  • CLI usage: Works normally
  • macOS app build: Completely blocked
  • macOS app updates: Cannot incorporate new features

Possible Root Causes

  1. Swift compiler version incompatibility: The new code might require a newer Swift version
  2. Type inference complexity: The wizard code might be too complex for the compiler
  3. SwiftUI bug: Known issue in SwiftUI view builder or state management
  4. Code issue: Actual bug in the Swift code causing the compiler to crash

Recommended Investigation

  1. Bisect the commits: Find exactly which commit introduced the crash

    git bisect start 73fa2e10 33cdb16b
    # Test each commit with: ~/.clawdis-src/scripts/package-mac-app.sh
  2. Isolate the problematic code: Comment out sections of OnboardingView+Wizard.swift to find the exact lines causing the crash

  3. Check Swift compiler version: Ensure the minimum required Swift version is documented

  4. Test on different machines: Verify this isn't environment-specific

Next Steps

  • Bisect to find the exact problematic commit
  • Test with different Swift compiler versions
  • Check if this is a known Swift compiler bug
  • Consider temporarily reverting the onboarding wizard changes

Upstream Commits Involved

Total commits in this pull: 76 commits from 33cdb16 to 73fa2e1

Key commits that added the wizard:

  • 53baba71 - feat: unify onboarding + config schema
  • Commits adding OnboardingWizard.swift and OnboardingView+Wizard.swift

Notes

This bug completely blocks macOS app development and distribution. Users can still use the CLI and previously built Mac apps, but no new Mac app builds can be created until this is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions