Skip to content

fix(ci): stop caching the generated example/ios/Pods tree - #283

Merged
chouaibMo merged 1 commit into
mainfrom
fix/ios-build-rnscreens-fabric-link
Aug 20, 2026
Merged

fix(ci): stop caching the generated example/ios/Pods tree#283
chouaibMo merged 1 commit into
mainfrom
fix/ios-build-rnscreens-fabric-link

Conversation

@chouaibMo

Copy link
Copy Markdown
Contributor

Summary

build-ios has failed on every PR since late July — including PRs that only touch a test-project lockfile. The failure is the CI cache, not the app code.

"typeinfo for facebook::react::YogaStylableProps", referenced from ...
"vtable for facebook::react::DebugStringConvertible", referenced from
    ... in libRNScreens.a(RNSFullWindowOverlay.o)
ld: symbol(s) not found for architecture arm64

Root cause

The CocoaPods cache included example/ios/Pods — the generated install tree — behind a loose restore-keys: ${{ runner.os }}-cocoapods- fallback. The v6 migration (#243, merged 2026-07-24) changed the Podfile/podspec hash, so the exact key has never matched since. Every run therefore restores a pre-v6 Pods tree. From the failing run's log:

key:      macOS-cocoapods-21c48bdc...   (requested)
restored: macOS-cocoapods-a2f4547b...   (stale, different key)

pod install does not fully reconcile a stale tree. RNScreens then compiled against stale React Native headers while linking the current prebuilt React.xcframework — a header/binary mismatch that surfaces as those missing facebook::react::* vtables.

The timeline matches exactly: build-ios passed through 2026-07-25 and has failed on every run since, across unrelated branches.

Verification

On this same commit, with a clean pod install and the exact CI xcodebuild invocation:

** BUILD SUCCEEDED **

Same prebuilt core, same Xcode 26. Only the stale cache distinguishes CI from a working build. As a control, a stale local Pods tree failed too — with a different stale-artifact error (Build input file cannot be found: RCTConvert_PurchaselyRN.m, a file the v6 reorg removed), independently showing that a stale Pods tree survives pod install and breaks the build.

Fix

  • Cache only ~/.cocoapods and ~/Library/Caches/CocoaPods. These are content-addressed download caches, so a restore-key hit is safe and still avoids re-downloading pods. The Pods tree is regenerated each run (~20s locally).
  • Add yarn.lock to both cache keys so a React Native version bump invalidates them.
  • Drop the DerivedData restore-keys so it is exact-match only. A partial hit would mix object files built against a different Pods install — the same staleness class of bug. It was latent here (that cache was cold in the failing run), but it is the same footgun.

Applied to both jobs that install the example Pods: build-ios and ios-unit-tests.

Note on what this does not change

No app, Podfile, or dependency changes — the diff is workflow-only. That is deliberate: if build-ios goes green here, it confirms the diagnosis, since nothing but the cache behaviour changed.

Unrelated and left alone: #278 fixes a different iOS problem (a Swift header compile error under Xcode 26 explicit modules); it does not address this link failure.

Test plan

  • Clean pod install + CI's exact xcodebuild command locally — ** BUILD SUCCEEDED **
  • Confirmed the failing CI run restored a stale cache under a different key
  • Confirmed DerivedData cache was cold in the failing run (so Pods is the culprit)
  • ruby -ryaml parses the workflow; all 7 jobs still present
  • build-ios green in CI on this PR (the real test)
  • iOS Unit Tests (bridge) still green with the narrowed cache

🤖 Generated with Claude Code

build-ios has failed on every PR since late July with a link error in the
example app:

  "typeinfo for facebook::react::YogaStylableProps", referenced from ...
  "vtable for facebook::react::DebugStringConvertible", referenced from
      ... in libRNScreens.a(RNSFullWindowOverlay.o)
  ld: symbol(s) not found for architecture arm64

Root cause is the CI cache, not the app. The CocoaPods cache included
`example/ios/Pods` -- the *generated* install tree -- with a loose
`restore-keys: ${{ runner.os }}-cocoapods-` fallback. Since the v6
migration changed the Podfile/podspec hash, the exact key never matches, so
every run restores a pre-v6 Pods tree. The failing run shows it plainly:

  key:      macOS-cocoapods-21c48bdc...   (requested)
  restored: macOS-cocoapods-a2f4547b...   (stale, different key)

`pod install` does not fully reconcile a stale tree, so RNScreens compiled
against stale React Native headers while linking the current prebuilt
React.xcframework -- a header/binary mismatch that surfaces as the missing
`facebook::react::*` vtables above.

Verified locally: a clean `pod install` + the exact CI xcodebuild command
BUILD SUCCEEDED on the same commit, with the same prebuilt core. Only the
stale cache distinguishes CI.

Fix:
- Cache only `~/.cocoapods` and `~/Library/Caches/CocoaPods`. These are
  content-addressed download caches, so a restore-key hit is safe and still
  avoids re-downloading pods; the Pods tree is regenerated each run (~20s).
- Add `yarn.lock` to both keys so a React Native version change invalidates
  them.
- Drop the DerivedData `restore-keys` so it is exact-match only. A partial
  hit would mix object files built against a different Pods install -- the
  same staleness class of bug, latent (that cache was cold in the failing
  run).

Applied to both jobs that install the example Pods: build-ios and
ios-unit-tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR corrects stale iOS CI caching by excluding the generated Pods installation tree and requiring exact matches for DerivedData.

  • Caches only CocoaPods download caches in both iOS jobs.
  • Adds yarn.lock to the CocoaPods and DerivedData cache keys.
  • Removes the DerivedData fallback restore key to prevent reuse across dependency configurations.

Confidence Score: 5/5

The PR appears safe to merge, with both iOS jobs continuing to regenerate Pods before building or testing.

The workflow now avoids restoring generated Pods state, preserves safe CocoaPods download caching, and limits DerivedData restoration to exact dependency and project-key matches.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Narrows CocoaPods caching and strengthens DerivedData invalidation without introducing an actionable workflow defect.

Reviews (1): Last reviewed commit: "fix(ci): stop caching the generated exam..." | Re-trigger Greptile

@chouaibMo
chouaibMo merged commit f1ad32f into main Aug 20, 2026
8 checks passed
@chouaibMo
chouaibMo deleted the fix/ios-build-rnscreens-fabric-link branch August 20, 2026 09:37
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.

2 participants