Skip to content

fix(ios): unblock the Ray-Ban DAT build and keep its project file clean - #22596

Merged
kodjima33 merged 5 commits into
mainfrom
fix/rayban-dat-embed-before-thin-binary
Oct 20, 2026
Merged

kodjima33 merged 5 commits into
mainfrom
fix/rayban-dat-embed-before-thin-binary

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

The Ray-Ban DAT simulator build fails on current main (1e1879f):

Error (Xcode): Cycle inside RunnerRayBanDat; building could produce unreliable results.
→ Target 'RunnerRayBanDat' has copy command from '.../OnDeviceParakeet.framework' to '.../Runner.app/Frameworks/OnDeviceParakeet.framework'
○ That command depends on command in Target 'RunnerRayBanDat': script phase "Thin Binary"

RunnerRayBanDat ran Flutter's Thin Binary script before Embed Frameworks. Once the target embeds OnDeviceParakeet.framework, the framework copy depends on Thin Binary, which depends on the processed Info.plist, which depends on the copy. The default Runner target already embeds before Thin Binary and builds fine.

  • project.pbxproj: RunnerRayBanDat now runs Embed Frameworks before Thin Binary, matching Runner. Only the order of two existing phases changes.
  • rayban_dat_xcode_graph_test.rb: asserts that order for both iPhone targets.
  • scripts/rayban_dat.sh: both CocoaPods installs rewrite the tracked Runner.xcodeproj/project.pbxproj, and the default reinstall does not restore it byte-for-byte. Every DAT build therefore left about 100 changed lines in the project, which is easy to commit by accident. The wrapper now snapshots the project with the other generated files and restores it after the default graph is reinstalled.

Found while verifying #22059's iPhone flavors. That PR's RunnerRayBanDat phases are identical to main's.

Validation

  • Before, on main 1e1879f: bash app/scripts/rayban_dat.sh build ios --simulator --debug -d <iPhone 16 Pro sim> fails with the cycle above, and git status afterwards shows M app/ios/Runner.xcodeproj/project.pbxproj.
  • After, same command on this branch: ✓ Built build/ios/iphonesimulator/Runner.app, rayban-dat: default build graph restored, and git status --short is empty.
  • ruby app/ios/test/rayban_dat_xcode_graph_test.rb: 10 runs, 0 failures. Against main's project.pbxproj the new test fails with RunnerRayBanDat must embed frameworks before Thin Binary: [... "Thin Binary", "Embed Frameworks"].
  • ruby app/ios/test/rayban_dat_build_wrapper_test.rb: 12 runs, 136 assertions, 0 failures. Against main's wrapper, 7 failures (every restore path leaves the pod-rewritten project behind).
  • ruby app/ios/test/rayban_dat_plugin_boundary_test.rb: 9 runs, 0 failures. plutil -lint OK; git diff --check clean; scripts/pr-preflight --pr-body-file: 24 checks passed.

Not covered: a signed device or archive build of the DAT flavor, and Ray-Ban glasses hardware.

Product invariants affected

none

Failure class (fixes)

Failure-Class: new

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

aryanorastar and others added 4 commits October 19, 2026 22:41
RunnerRayBanDat ran the Flutter "Thin Binary" script before "Embed
Frameworks". Once OnDeviceParakeet.framework is embedded in that target,
Xcode reports "Cycle inside RunnerRayBanDat": the framework copy into
Runner.app/Frameworks depends on Thin Binary, which depends on the
processed Info.plist, which depends on that copy. Use the order the Runner
target already uses (Embed Frameworks, then Thin Binary).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both CocoaPods installs in scripts/rayban_dat.sh rewrite the tracked
Runner.xcodeproj/project.pbxproj, and the default reinstall does not put it
back byte-for-byte, so every DAT build left a modified project that was easy
to commit by accident. Snapshot it with the other generated files before
the DAT install and restore it after the default graph is reinstalled.

Also pin the Embed Frameworks / Thin Binary order for both iPhone targets in
rayban_dat_xcode_graph_test.rb.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T02:48:57.506737Z 4d65dc3 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Auto-fix isn't included in your plan ↗

Upgrade to Team

@Git-on-my-level Git-on-my-level added ios positive-signal Automation verified a genuine fix/quality contribution labels Oct 19, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: the production fix here is correct and tightly scoped, with good contract-test coverage; the two failing checks are analyzer drift from main, not from this diff. No blocking issues from my side.

Per file:

  • app/ios/Runner.xcodeproj/project.pbxproj — the only production change: inside the RunnerRayBanDat native target, Embed Frameworks (84317A1F…) now runs before Thin Binary (5E566183…), matching the default Runner target. Verified against the head tree; this breaks the "Cycle inside RunnerRayBanDat" loop now that OnDeviceParakeet.framework is embedded.
  • app/ios/test/rayban_dat_xcode_graph_test.rb — test_iphone_targets_embed_frameworks_before_thin_binary pins the order for both Runner and RunnerRayBanDat, so a new target or embedded framework can't reintroduce the cycle unnoticed. Nice use of refute_nil plus assert_operator.
  • app/scripts/rayban_dat.sh — adds project.pbxproj to the same snapshot/restore/clear-state set as Generated.xcconfig (snapshot_flutter_environment / restore_flutter_environment / clear_wrapper_state). Mechanical, mirrors the existing helpers, no new control flow.
  • app/ios/test/rayban_dat_build_wrapper_test.rb — the fake pod now rewrites the project the way real CocoaPods does, and assert_default_state_restored checks byte equality after restore, including the stale-transaction recovery path. Good.
  • .github/failure-classes/FC-ios-embed-after-thin-binary-cycle.json — matches the existing FC-* schema and correctly points at the graph test as the canonical prevention artifact.
  • app/changelog/unreleased/20261019-rayban-dat-build-cycle.json — kind: none, consistent with sibling internal-only fragments.

On the failing checks: "Dart Analyze & Tests" tripped the ratchet on one unused_import in app/test/widgets/home_ask_anything_button_test.dart. That import came in on main (6bd179b) and was fixed on main minutes later (8b65fde, "drop unused ui.dart import that fails the analyzer ratchet on main"); this branch's merge base predates the fix and the branch itself touches no Dart files, so the failure is main's, not yours. "Mobile Release Eligibility" fails only because it gates on Dart Analyze. iOS Compile Check, CodeQL, and Hygiene all pass on this head.

Blast radius: only the Ray-Ban DAT build flavor; the default Runner build is unchanged (its phases already used the safe order).

USER IMPACT: none — internal change; the Ray-Ban DAT developer/simulator build stops failing with the Xcode cycle error and no longer leaves ~100 dirty lines in project.pbxproj after each build.

What I'd still want before merge: rebase onto current main (or let the merge ref refresh and re-run) so Dart Analyze & Tests and Mobile Release Eligibility go green — they should, since main already carries the import fix.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@aryanorastar

aryanorastar commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Pushed 4d65dc3: merged current main (8edd56d). No code changes.

  • Why: Dart Analyze & Tests and Mobile Release Eligibility failed on the analyzer ratchet (unused_import: 1 found, baseline 0). With current main merged, app/scripts/analyze_ratchet.sh passes locally. I could not pin which file produced that one import: the previous head analyzes clean here, so the difference is probably in CI's generated code. Its source is unconfirmed, not shown to come from main.
  • Scope: the merge is clean, with no conflicts; the diff against main is exactly this PR's files.
  • Checks: the ratchet passes; this PR adds no Dart tests (it changes the iOS Ray-Ban build).

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scoped iOS build-tooling fix (65 lines) for the Ray-Ban DAT Xcode phase-ordering cycle, with a new graph-order test; 5/5 confidence, CI green.

@kodjima33
kodjima33 merged commit 9e75c89 into main Oct 20, 2026
44 checks passed
@kodjima33
kodjima33 deleted the fix/rayban-dat-embed-before-thin-binary branch October 20, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ios positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants