fix(swift-sdk): build the shippable profile by default - #4371
Conversation
`build_ios.sh` defaulted to `--profile dev`, which maps to `dev-ios`: Cargo's `dev` defaults (debug assertions and overflow checks on, opt-level 0) plus `panic = "abort"`. Every `debug_assert!` in dash-spv, key-wallet and platform-wallet is therefore live in such a build, and aborts the host process instead of degrading. That is correct for local iteration and wrong for anything a tester touches — and it has already happened. A TestFlight build of the wallet (9.0.0/25) died with SIGABRT inside `FiltersManager::start_download` at `filters/manager.rs:182`, which is `debug_assert!(self.is_idle(), ...)`. A release build would have compiled that line out entirely. The same build's logs carry `platform_wallet_ffi::metrics` lines, which `build_ios.sh` only enables under `dev-ios` — so the profile, not the assert, is what made an internal invariant a user-visible crash. The default is now `release`; `dev` stays available and prints a warning naming what it implies. Both CI callers pass `--profile` explicitly (`release-swift-sdk.yml` release, `swift-example-app-ui-smoke.yml` dev), so neither changes behaviour. The trade-off is deliberate: an unqualified `./build_ios.sh` is now slow (fat LTO, opt-level 3) where it used to be fast. A developer who wants the fast one asks for it by name; nobody ships the slow-to-notice one by forgetting to.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe iOS build script now defaults to release builds, documents release and dev profiles, and warns about dev build limitations. The framework build instructions specify simulator targeting and profile selection. ChangesiOS build profiles
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
✅ Final review complete — no blockers (commit 109e5c9) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Codex/Sol only (Phase 2 disabled)
At exact head 109e5c9, the script correctly maps an omitted profile to the existing release-ios Cargo profile while retaining explicit dev-ios builds, their tokio-metrics feature, and a clear distribution warning. The documentation matches the new behavior, explicit CI profile selection remains unchanged, and no in-scope correctness or FFI issues were found.
Source: reviewer backends codex/gpt-5.6-sol (general) and codex/gpt-5.6-sol (ffi-engineer); final verifier backend codex/gpt-5.6-sol. openclaw-agent/cliproxy/gpt-5.6-sol is orchestration-only and not reviewer evidence.
Validated zero-blocker Codex/Sol precheck evidence was promoted to final because Phase 2 (Sonnet/Opus) is temporarily disabled. This is Codex/Sol-only final validation, not Codex + Sonnet/Opus coverage.
Review provenance
- Codex reviewers:
gpt-5.6-sol— general (completed),gpt-5.6-sol— ffi-engineer (completed) - Verifier:
gpt-5.6-sol— verifier - Sonnet/Opus: not run (Phase 2 disabled — temporary Codex/Sol-only final)
- Secondary pass: disabled (
temporary_phase2_sonnet_disable)
Issue being fixed or feature implemented
build_ios.shdefaults to--profile dev, which maps to thedev-iosprofile: Cargo'sdevdefaults (debug assertions and overflow checks on,opt-level = 0) pluspanic = "abort". So in such a build everydebug_assert!in dash-spv, key-wallet and platform-wallet is live, and aborts the host process instead of degrading.That is exactly what a dev build is for locally. It is also what shipped.
A TestFlight build of the wallet —
dashpay9.0.0 (25), iPhone17,2, iOS 26.6 — died withSIGABRT:manager.rs:182at the pinned rev isdebug_assert!(self.is_idle(), "manager should have no in-flight state on start");— a line a release build compiles out entirely.Two independent confirmations that the shipped binary had debug assertions on:
debug_assert!is a no-op undercfg!(debug_assertions) == false, so its firing is first-hand proof.release-iosnever setsdebug, so it emits no line tables;dev-ios'sdebug = "line-tables-only"is what makes per-line frames possible.A session log from a comparable build carries
platform_wallet_ffi::metricslines, which this script enables only underdev-ios— the same story from a second angle.So the invariant violation is a real bug worth fixing on its own (upstream, in
dash-spv), but the profile is what turned it into a user-visible crash rather than a log line.What was done?
release.devremains available and now prints a warning naming what it implies, rather than being the silent default.--helpspells out the difference instead of listingdev (default)with no consequences attached.AGENTS.mdshows both forms.Both CI callers already pass
--profileexplicitly —release-swift-sdk.ymlusesrelease,swift-example-app-ui-smoke.ymlusesdev— so neither changes behaviour.The trade-off, stated plainly
An unqualified
./build_ios.shis now slow:release-iosis fat LTO, one codegen unit,opt-level = 3. It used to be fast. A developer who wants the fast build asks for it by name; the alternative is that people keep shipping the one whose cost only shows up weeks later on someone else's device.If reviewers prefer to keep
devas the default, the warning alone still helps — but it is a warning in a build log, which is precisely where this went unnoticed the first time.How Has This Been Tested?
Verified by reading, not by running a full build of each profile: the change is to a default and a message, and both CI callers pin the profile explicitly so their behaviour is unchanged by construction.
Breaking Changes
No API or artifact-format change. A behavioural change for anyone invoking
build_ios.shwithout--profile: they now get an optimized build, which takes considerably longer and produces a framework without debug assertions. That is the intent.Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
Documentation
Build Improvements