Skip to content

fix(ios): keep the podspec's build attributes out of the OpenCV branch - #1452

Merged
msluszniak merged 1 commit into
mainfrom
@ms/fix-podspec-opencv-scope
Sep 9, 2026
Merged

fix(ios): keep the podspec's build attributes out of the OpenCV branch#1452
msluszniak merged 1 commit into
mainfrom
@ms/fix-podspec-opencv-scope

Conversation

@msluszniak

Copy link
Copy Markdown
Member

Description

Two defects in #1450, both reproduced against main at a1ff6c9.

if enable_opencv was never closed. Its end sat at the bottom of the spec, one line above install_modules_dependencies(s), and the indentation of everything after the s.dependency call reads as if the block had already ended. So five attributes were assigned only when OpenCV was on:

attribute what an app loses without it
pod_target_xcconfig every HEADER_SEARCH_PATHS entry
vendored_frameworks ExecutorchLib.xcframework
static_framework the use_frameworks! fix from #1448
libraries z, sqlite3
frameworks Accelerate, CoreML, Metal

An app that turns OpenCV off through the libs config block installs fine and then fails to compile or link. #1450 is what made this reachable: before it, a config block in an app package was ignored and OpenCV was always on.

rne_build_config was nil without a config file. The else branch set the five enable_* flags but never assigned the hash, and #1450 added rne_build_config["opencvPod"] on the path that branch reaches, so a checkout without rne-build-config.json raised NoMethodError during pod install. The comment above it names that case as supported ("a fresh checkout where the native libs were provisioned manually"). The branch is gone: the config is a hash either way, and every flag already reads != false, so an empty hash means all-enabled.

Test. pod install is the only thing that runs this file, and every example app takes the same config row, so a misplaced end passes lint, types, tests and review. __tests__/api/podspecAttributes.test.ts evaluates the real podspec under a stubbed Pod::Spec and asserts the build-critical attributes are assigned, for eight config rows. Against a1ff6c9 it fails three of them:

● with no config file (manual provisioning)
  podspec:242: undefined method `[]' for nil:NilClass (NoMethodError)
● with opencv off
● with every optional library off
  missing: pod_target_xcconfig, static_framework, vendored_frameworks, libraries, frameworks

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

yarn workspace react-native-executorch test __tests__/api/podspecAttributes.test.ts
git stash && yarn workspace react-native-executorch test __tests__/api/podspecAttributes.test.ts  # 3 failures

Needs an enableOpencv: false pod install on a device build before merge; I have only run the podspec evaluation.

Related issues

Follow-up to #1450.

Additional notes

Backport to release/0.10 goes on top of #1451.

`if enable_opencv` was never closed: its `end` sat at the bottom of the
spec, so `pod_target_xcconfig`, `libraries`, `frameworks`,
`static_framework` and `vendored_frameworks` were all assigned only when
OpenCV was on. An app that turns it off through the `libs` config block
got a pod with no HEADER_SEARCH_PATHS and no ExecutorchLib, which fails
at compile or link with nothing pointing back here.

The same commit started reading `opencvPod` from `rne_build_config`,
which the `else` branch above never assigns, so a checkout without
`rne-build-config.json` raised `NoMethodError` for nil during
`pod install`. That branch is gone: the config is a hash either way and
every flag already reads `!= false`.

`pod install` is the only thing that runs this file, and no example app
covers a config other than the default, so `podspecAttributes.test.ts`
now evaluates the podspec under a stubbed `Pod::Spec` and asserts the
build-critical attributes are assigned for every config row.
@msluszniak msluszniak added the bug fix PRs that are fixing bugs label Sep 9, 2026
@msluszniak msluszniak self-assigned this Sep 9, 2026
@msluszniak
msluszniak requested a review from barhanc September 9, 2026 17:05
@msluszniak
msluszniak merged commit c8f44f6 into main Sep 9, 2026
5 checks passed
@msluszniak
msluszniak deleted the @ms/fix-podspec-opencv-scope branch September 9, 2026 17:12
msluszniak added a commit that referenced this pull request Sep 9, 2026
)

## Description

Backports the three 0.10.0 setup fixes from `main` to `release/0.10`,
plus the follow-up that fixes two defects in the third one.
Cherry-picked with `-x`, no manual edits to any of them.

| commit | PR |
| --- | --- |
| `12ce3bb` | #1448 fix(ios): narrow the podspec's public headers |
| `c51f76a` | #1449 fix(deps): require worklets >=0.10.0 <0.13.0 and
document it |
| `a1ff6c9` | #1450 fix(build): fail with the cause when the setup is
wrong |
| `080e764` | #1452 fix(ios): keep the podspec's build attributes out of
the OpenCV branch |

All four are now on `main`; #1452 merged as `c8f44f6`.

Only conflict was `docs/versioned_docs/version-0.10.0/**`: that snapshot
exists on `main` only, since on this branch `docs/docs` **is** the 0.10
documentation. Those three hunks were dropped and the equivalent
`docs/docs` changes came across in the same commits.

`packages/react-native-executorch/package.json` keeps `0.10.0`; only the
worklets peer range changed.

### Introduces a breaking change?

- [ ] Yes
- [x] No

### Type of change

- [x] Bug fix (change which fixes an issue)
- [ ] New feature (change which adds functionality)
- [ ] Documentation update (improves or adds clarity to existing
documentation)
- [ ] Other (chores, tests, code style improvements etc.)

### Tested on

- [ ] iOS
- [ ] Android

### Testing instructions

`yarn workspace react-native-executorch test` passes, 3868 tests across
34 suites.

The podspec, `android/build.gradle.kts`, `scripts/download-libs.js` and
the new podspec test on this branch are byte-identical to `main`:

```bash
git fetch origin main
git diff origin/main HEAD -- packages/react-native-executorch/react-native-executorch.podspec \
  packages/react-native-executorch/android/build.gradle.kts \
  packages/react-native-executorch/scripts/download-libs.js \
  packages/react-native-executorch/__tests__/api/podspecAttributes.test.ts
```

### Related issues

#1448, #1449, #1450, #1452

---------

Co-authored-by: Bartosz Hanc <bartosz.hanc02@gmail.com>
Co-authored-by: Mateusz Słuszniak <msluszniak1@gmail.com>
@msluszniak msluszniak mentioned this pull request Sep 9, 2026
7 tasks
msluszniak added a commit that referenced this pull request Sep 9, 2026
## Description

Patch release **v0.10.1**. The fixes are already on `release/0.10` via
#1451 (backports of #1448, #1449, #1450, #1452); this PR only bumps the
version.

- `packages/react-native-executorch/package.json`: `0.10.0` -> `0.10.1`.
`nativeLibsVersion` stays `0.10.0`; the native artifacts release is
unchanged.
- `src/fetcher/telemetry.ts`: `LIB_VERSION` -> `0.10.1`, asserted equal
to the package version by `__tests__/fetcher/telemetry.test.ts`.

Satellites (`bare-resource-fetcher`, `expo-resource-fetcher`, `webrtc`)
are untouched by the backports, so their versions stay at `0.10.0`.
`models.ts` stays on `resolve/v0.10.0`; no model files moved.

### Introduces a breaking change?

- [ ] Yes
- [x] No

### Type of change

- [x] Other (chores, tests, code style improvements etc.)

### Tested on

- [ ] iOS
- [ ] Android

### Testing instructions

CI runs `yarn workspace react-native-executorch test`; the telemetry
version assertion covers the bump.

### Related issues

#1451

### Checklist

- [x] I have performed a self-review of my code
- [x] My changes generate no new warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix PRs that are fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants