Add function to create hard links for headers of the third-party dependencies#53638
Add function to create hard links for headers of the third-party dependencies#53638cipolleschi wants to merge 7 commits into
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D81778459 |
7b4d72e to
6105173
Compare
|
This pull request was exported from Phabricator. Differential Revision: D81778459 |
6105173 to
1ad222f
Compare
cortinico
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
1ad222f to
59639a3
Compare
|
This pull request was exported from Phabricator. Differential Revision: D81778459 |
59639a3 to
97760ea
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778459. |
10898e9 to
4b48850
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778459. |
4b48850 to
c5a2999
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778459. |
d49acd6 to
534ab95
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778459. |
Summary: This change adds a simple function that manages symlinks. This is used through the stack of changes to avoid code repetition. ## Context SwiftPM is very picky in how the header structure must be. In order to preserve the import/include statements as much as possible when building from source, we can recreate the header structure in a temporary folder inside the react-native package using symlinks. In this way, users can still modify the headers and build RNTester and HelloWorld using SwiftPM without breaking changes. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D82202860
Summary: This change add a utility function to extract headers (both .h and .hpp) from a folder. It also allow to exclude some specific folders (e.g.: `tests`, non supported platforms, ...) ## Context SwiftPM is very picky in how the header structure must be. In order to preserve the import/include statements as much as possible when building from source, we can recreate the header structure in a temporary folder inside the react-native package using symlinks. In this way, users can still modify the headers and build RNTester and HelloWorld using SwiftPM without breaking changes. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D82205692
…a destination path (facebook#53620) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we are adding an helper function that creates links between a source folder and a destination folder. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778469
…ers in the ReactApple folder (facebook#53629) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we are adding a function to properly create the header structure for the headers in ReactApple that requires a special case. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778471
…ers in the ReactCommon folder (facebook#53631) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we are adding an helper function that creates links for the ReactCommon folder that has a complex structure and complex mapping requirements ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778470
…Native Core (facebook#53635) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we did two things: 1. we move the helper functions to a headers-utils.js file (and the tests to the `headers-utils-test.js` file) 2. we added a function that coordinates the creation of the header links *and added tests for it) ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778464
…ndencies (facebook#53638) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we are adding an helper function that creates links for the ThirdPartyDependencies that React native and libraries might need to access. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778459
534ab95 to
6774245
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778459. |
|
This pull request has been merged in 515c735. |
Summary:
Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with
../).To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
Changed
In this change we are adding an helper function that creates links for the ThirdPartyDependencies that React native and libraries might need to access.
Changelog:
[Internal] -
Differential Revision: D81778459