Repository navigation
Commit abe1c5f
committed
Stop reading podspec header search paths during SwiftPM sync (#59365)
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.1 parent 99d4ed3 commit abe1c5f
3 files changed
Lines changed: 59 additions & 104 deletions
File tree
- packages/react-native/scripts/spm
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2287 | 2287 | | |
2288 | 2288 | | |
2289 | 2289 | | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
2290 | 2333 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | 804 | | |
857 | 805 | | |
858 | 806 | | |
| |||
869 | 817 | | |
870 | 818 | | |
871 | 819 | | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
872 | 829 | | |
873 | 830 | | |
874 | 831 | | |
| |||
903 | 860 | | |
904 | 861 | | |
905 | 862 | | |
906 | | - | |
907 | | - | |
908 | 863 | | |
909 | 864 | | |
910 | 865 | | |
911 | 866 | | |
912 | 867 | | |
913 | 868 | | |
914 | 869 | | |
915 | | - | |
916 | | - | |
917 | 870 | | |
918 | 871 | | |
919 | 872 | | |
| |||
1123 | 1076 | | |
1124 | 1077 | | |
1125 | 1078 | | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | 1079 | | |
1133 | 1080 | | |
1134 | 1081 | | |
| |||
1212 | 1159 | | |
1213 | 1160 | | |
1214 | 1161 | | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
1221 | | - | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1231 | 1167 | | |
1232 | 1168 | | |
1233 | 1169 | | |
| |||
1245 | 1181 | | |
1246 | 1182 | | |
1247 | 1183 | | |
1248 | | - | |
| 1184 | + | |
1249 | 1185 | | |
1250 | 1186 | | |
1251 | 1187 | | |
| |||
1705 | 1641 | | |
1706 | 1642 | | |
1707 | 1643 | | |
1708 | | - | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
1716 | | - | |
1717 | 1644 | | |
1718 | 1645 | | |
1719 | 1646 | | |
| |||
1725 | 1652 | | |
1726 | 1653 | | |
1727 | 1654 | | |
1728 | | - | |
1729 | 1655 | | |
1730 | 1656 | | |
1731 | 1657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 90 | | |
98 | 91 | | |
99 | 92 | | |
| |||
373 | 366 | | |
374 | 367 | | |
375 | 368 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | 369 | | |
384 | 370 | | |
385 | 371 | | |
| |||
0 commit comments