Skip to content

[0.88] Stop reading podspec header search paths during SwiftPM sync - #59477

Open
chrfalch wants to merge 1 commit into
0.88-stablefrom
chrfalch/0.88-port-59365
Open

chrfalch wants to merge 1 commit into
0.88-stablefrom
chrfalch/0.88-port-59365

Conversation

@chrfalch

@chrfalch chrfalch commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Port of 4bba13d (#59365, "Stop reading podspec header search paths during SwiftPM sync") to 0.88-stable. That commit already landed in main. A plain cherry-pick conflicts, so this PR resolves the conflict.

Every SwiftPM sync reads the podspec of each npm dependency to collect its HEADER_SEARCH_PATHS, and the result is never used. This change removes that read and the code that carried its result.

The only conflict is in generate-spm-autolinking.js. On main, the C++ settings line calls reactCxxDefines(spec.cxxApiDefines), which comes from a later PR that is not on 0.88-stable. This port keeps 0.88's REACT_CXX_CONFIG_DEFINES there. Everything else is the same as the commit on main.

Pick request: reactwg/react-native-releases#1462

Changelog:

[INTERNAL] [REMOVED] - Stop reading unused podspec header search paths during SwiftPM sync

Test Plan:

  • git range-diff against 4bba13d: the only differences are the reactCxxDefines/cxxApiDefines parts described above.
  • yarn jest --no-cache -i packages/react-native/scripts/spm on this branch: 1006 of 1006 tests pass.
  • prettier --check and eslint --max-warnings 0 on the changed files: no problems.
  • CI on this PR.

Summary:
In the SwiftPM pipeline, every sync reads the podspec of each npm dependency to collect its `HEADER_SEARCH_PATHS`. (That can even start a `pod ipc spec` process for each dependency), and the result is never used.

This change removes the read and the code that carried its result:

- `extractPodspecHeaderSearchPaths` and its call in `autolinkingDepToSpmTarget` (`generate-spm-autolinking.js`)
- the `headerSearchPaths` field on `SpmTarget` and `SynthPackageSpec` (`spm-types.js`)
- the `root/` prefix step in `main()` and the `.headerSearchPath(...)` output in `generateSynthPackageSwift`

The podspec reader (`read-podspec.js`) and the scaffolder (`scaffold-package-swift.js`) still use header search paths. They do not change.

This PR does not depend on other open PRs.

## Changelog:

[INTERNAL] [REMOVED] - Stop reading unused podspec header search paths during SwiftPM sync

Pull Request resolved: #59365

Test Plan:
- New test in `generate-spm-autolinking-test.js`: an npm dependency whose podspec sets `HEADER_SEARCH_PATHS` must not cause a call to the podspec reader. Before the change it failed with `Expected number of calls: 0, Received number of calls: 1`. After the change it passes.
- `node_modules/.bin/jest --no-cache -i packages/react-native/scripts/spm`: 23 of 23 suites and 1129 of 1129 tests pass.
- Generated output for RNTester, before and after, with `node packages/react-native/scripts/spm/generate-spm-autolinking.js --app-root packages/rn-tester --react-native-root packages/react-native --autolinking-json <file> --output <dir>`:
  - With RNTester's npm dependencies, both runs stop with the same missing-manifest error and write no files.
  - With only RNTester's app-local modules, both runs write the same 7 `Package.swift` files. `diff -r` finds no differences.
- ESLint and Prettier pass on the changed files. Flow finds no errors in them. I did not run a full `yarn flow-check`, because it fails locally on unrelated vendored files.

Reviewed By: andrewdacenko

Differential Revision: D126936104

Pulled By: cipolleschi

fbshipit-source-id: 178520a0fe5037aa646c20d2b9ffafd178b4888f

(cherry picked from commit 4bba13d)

Conflict resolution for 0.88-stable: kept 0.88's REACT_CXX_CONFIG_DEFINES for cxxSettings instead of main's reactCxxDefines(spec.cxxApiDefines), which is not on 0.88.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Pick Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant