Fix hermes and jsc pods for test targets #36005
Closed
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
I'm maintaining a library that includes iOS tests (https://github.com/DataDog/dd-sdk-reactnative).
To run these tests, I'm adding the test target to a simple application, from where I am able to run the tests:

Since React Native 0.71, the build for the test target fails with the following errors (depending on whether hermes is enabled or not):
Without hermes:
With hermes:
When I investigated into the testing target for my pod, I realized that
React-jsc(orReact-hermesif hermes is enabled) were missing from the following Build Settings:See screenshots below (with hermes):



After comparing with other pods that were included in these locations, I noticed that the difference was that they were not in the dependencies of
React-Coreand thatReact-jscis missing aheader_dirproperty in its podspec.After adding both changes, I was able to build the test target again, and there was no regression on my simple application.
I am not sure this is the best way to achieve this, I don't understand fully how header search paths etc. are defined for Pods targets, so feel free to point me to a better solution if you can think of one.
This could also potentially fix #34344
Changelog
[IOS] [FIXED] - Fix builds for pods testing targets
Test Plan
I am still able to build a simple RN 0.71 application.
With the changes, my test target builds and tests are passing.