Skip to content

iOS release builds compile again: dismiss_keyboard leaves the debug-only block (MOB-504) - #229

Merged
GenericJam merged 3 commits into
masterfrom
fix/MOB-504-release-dismiss-keyboard
Oct 25, 2026
Merged

GenericJam merged 3 commits into
masterfrom
fix/MOB-504-release-dismiss-keyboard

Conversation

@GenericJam

Copy link
Copy Markdown
Owner

Fixes MOB-504, which mob_ci's nightly reported.

Bug. In mob 0.9.26, nif_dismiss_keyboard (from #173) and the find_first_responder_in helper it uses were defined inside the test harness's #if !MOB_RELEASE block (ios/mob_nif.m:5065 in 0.9.26). Their nif_funcs entries were outside it, so every iOS release build failed:

ios/mob_nif.m:10281:29: error: use of undeclared identifier 'nif_dismiss_keyboard'

#184 added dismiss_keyboard/1, so master had the same problem twice over.

Fix. Both functions move above the harness block. Both use only public UIKit (isFirstResponder, resignFirstResponder), so nothing App Store-sensitive moves into release builds. No other NIF has this mismatch: I compared every function defined inside a MOB_RELEASE guard with the guard on its table entry, and no non-static function is defined inside a guard.

Guard against a repeat. test/native/ios_nif_compile.sh (make -C test/native ios-nif) generates MobApp-Swift.h with swiftc. It then syntax-compiles ios/mob_nif.m for arm64 iOS in three variants: debug, release, and release with MOB_ENABLE_SCREENSHOT. CI's macOS job runs it after brew install erlang, which provides erl_nif.h. RELEASE.md lists it as a mob preflight step.

Verification.

  • The script fails on master's mob_nif.m with the error above, in both release variants, and passes on this branch.
  • mix test passes 2155 (38 excluded).
  • make -C test/native run and clang-format are clean.

This goes out as mob 0.9.27.

…nly block (MOB-504)

mob 0.9.26 defined nif_dismiss_keyboard and find_first_responder_in inside
the test harness's #if !MOB_RELEASE block while the nif_funcs entries for
dismiss_keyboard/0,1 sat outside it, so every iOS release build failed with
'use of undeclared identifier'. Both functions now sit above the harness
block.

test/native/ios_nif_compile.sh (make -C test/native ios-nif) generates
MobApp-Swift.h and syntax-compiles ios/mob_nif.m as debug, release, and
release with MOB_ENABLE_SCREENSHOT; CI's macOS job runs it. It fails on the
0.9.26 source and passes with this fix.
….9.27 gate)

mob_dev sends :__mob_hot_reload__ as a bare message to :mob_screen, which
names one window's router; further windows kept drawing the old code until
their next render. The router now handles the message itself: it repaints
its own screens and casts the reload to every other router Mob.Scenes lists,
from a spawned process so it never waits on Mob.Scenes. Also fixes the
Mob.Test moduledoc example: screens/1 reports native's scene id on iOS.
@GenericJam

Copy link
Copy Markdown
Owner Author

Release gate for 0.9.27, run by a reviewer subagent because Codex is rate-limited until 5:02 AM.

  • First round: DO NOT SHIP. With multi-window on, the reload a deploy sends after a hot push repainted only the window whose router holds :mob_screen. Fixed in 0005f0b, with a regression test.
  • Re-review: SHIP.

@GenericJam
GenericJam merged commit 5f1c05c into master Oct 25, 2026
4 checks passed
@GenericJam
GenericJam deleted the fix/MOB-504-release-dismiss-keyboard branch October 25, 2026 01:16
@GenericJam GenericJam mentioned this pull request Oct 25, 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.

1 participant