openclaw/scripts
gupsammy 29e9a574b0 fix(macos): prevent crash from missing ClawdbotKit resources and Swift library
The macOS app was crashing in two scenarios:

1. Bundle.module crash (fixes #213): When the first tool event arrived,
   ToolDisplayRegistry tried to load config via ClawdbotKitResources.bundle,
   which used Bundle.module directly. In packaged apps, Bundle.module
   couldn't find the resource bundle at the expected path, causing a
   fatal assertion failure after ~40-80 minutes of runtime.

2. dyld crash (fixes #417): Swift 6.2 requires libswiftCompatibilitySpan.dylib
   but SwiftPM doesn't bundle it automatically, causing immediate crash on
   launch with "Library not loaded" error.

Changes:
- ClawdbotKitResources.swift: Replace direct Bundle.module access with a
  safe locator that checks multiple paths and falls back gracefully
- package-mac-app.sh: Copy ClawdbotKit_ClawdbotKit.bundle to Resources
- package-mac-app.sh: Copy libswiftCompatibilitySpan.dylib from Xcode
  toolchain to Frameworks

Tested on macOS 26.2 with Swift 6.2 - app launches and runs without crashes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 19:24:20 +00:00
..
e2e refactor: simplify cli commands 2026-01-08 07:16:12 +01:00
bench-model.ts chore: add bench-model script 2026-01-01 08:59:31 +01:00
build_icon.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
build-and-run-mac.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
bundle-a2ui.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
canvas-a2ui-copy.ts refactor(canvas): host A2UI via gateway 2025-12-20 12:17:27 +00:00
changelog-to-html.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
clawlog.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
clawtributors-map.json docs: keep steipete first 2026-01-08 07:02:17 +01:00
codesign-mac-app.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
committer chore: drop runner shim and add committer helper 2025-12-09 17:24:25 +00:00
create-dmg.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
docs-list.ts refactor: replace tsx with bun for TypeScript execution (#278) 2026-01-06 07:14:08 +00:00
ios-team-id.sh chore(ios): add team id helper 2025-12-26 18:16:13 +01:00
make_appcast.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
notarize-mac-artifact.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
package-mac-app.sh fix(macos): prevent crash from missing ClawdbotKit resources and Swift library 2026-01-08 19:24:20 +00:00
package-mac-dist.sh chore: default mac packaging to notarize 2026-01-05 04:22:58 +01:00
postinstall.js fix: targetDir symlink handling in postinstall script (#272) 2026-01-05 23:36:11 -06:00
protocol-gen-swift.ts fix(mac): add Sendable conformance to generated Swift protocol structs (#195) 2026-01-04 22:39:21 +00:00
protocol-gen.ts chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
release-check.ts refactor: replace tsx with bun for TypeScript execution (#278) 2026-01-06 07:14:08 +00:00
restart-mac.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
sandbox-browser-entrypoint.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
sandbox-browser-setup.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
sandbox-common-setup.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
sandbox-setup.sh chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
test-force.ts refactor: replace tsx with bun for TypeScript execution (#278) 2026-01-06 07:14:08 +00:00
ui.js fix(ui): self-heal ui builds 2026-01-06 16:03:04 +01:00
update-clawtributors.ts docs: infer logins from email local 2026-01-08 06:26:50 +01:00