Repository navigation
Conversation
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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 callsreactCxxDefines(spec.cxxApiDefines), which comes from a later PR that is not on 0.88-stable. This port keeps 0.88'sREACT_CXX_CONFIG_DEFINESthere. 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-diffagainst 4bba13d: the only differences are thereactCxxDefines/cxxApiDefinesparts described above.yarn jest --no-cache -i packages/react-native/scripts/spmon this branch: 1006 of 1006 tests pass.prettier --checkandeslint --max-warnings 0on the changed files: no problems.