commit 8d5c373e511b08b8c629b1df9b7360d89ba12558
parent d9c130fe7d06ece4b4d851a212290bf14f2aa795
Author: alltheseas <alltheseas@users.noreply.github.com>
Date: Fri, 2 Jan 2026 09:06:42 -0600
chrome: fix debug mode crash on macOS
The app crashed on startup when built in debug mode (`cargo run`)
but worked fine in release mode (`cargo run --release`).
Root cause: objc2-foundation 0.2.2 (transitive dep from winit) has
incorrect type encoding for NSFastEnumeration - it expects signed
i64 ('q') but macOS returns unsigned u64 ('Q'). In debug mode,
objc2 verifies type encodings at runtime and panics on mismatch.
Fix: Enable the `relax-sign-encoding` feature on objc2 0.5.2, which
allows signed/unsigned type mismatches to pass verification. Adding
objc2 as a direct dependency triggers Cargo's feature unification,
ensuring the feature is enabled for all transitive uses of objc2.
The dependency is gated to macOS only to avoid affecting Linux/Windows
builds where objc2 is not used.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Changelog-Fixed: Fix startup crash in debug mode
Closes: https://github.com/damus-io/notedeck/issues/1211
Closes: https://github.com/damus-io/notedeck/pull/1236
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: alltheseas <alltheseas@users.noreply.github.com>
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
@@ -22,6 +22,7 @@
# Fixed
+- Fix debug mode crash on macOS due to objc2 type encoding mismatch (alltheseas)
- Fix timelines sometimes not updating (stale feeds)
- Fix ui bounciness when loading profile pictures
- Fix unselectable post replies
diff --git a/Cargo.lock b/Cargo.lock
@@ -3942,6 +3942,7 @@ dependencies = [
"notedeck_messages",
"notedeck_notebook",
"notedeck_ui",
+ "objc2 0.5.2",
"profiling",
"puffin",
"puffin_egui",
diff --git a/crates/notedeck_chrome/Cargo.toml b/crates/notedeck_chrome/Cargo.toml
@@ -62,6 +62,12 @@ tracing-logcat = "0.1.0"
egui-winit.workspace = true
android-keyring = { workspace = true }
+# Fix debug mode crash on macOS: objc2-foundation 0.2.2 has incorrect type
+# encoding for NSFastEnumeration. The relax-sign-encoding feature allows
+# signed/unsigned mismatches to pass runtime verification.
+[target.'cfg(target_os = "macos")'.dependencies]
+objc2 = { version = "0.5.2", features = ["relax-sign-encoding"] }
+
[package.metadata.bundle]
name = "Notedeck"
short_description = "The nostr browser"