Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect changes in Podfile.lock #3701

Merged
merged 6 commits into from
Oct 26, 2022
Merged

Conversation

tomekzaw
Copy link
Member

@tomekzaw tomekzaw commented Oct 20, 2022

Description

Fixes #3696.

When compiling Reanimated 3.0.0-rc.3+ for iOS, we need to import RuntimeAdapter.h. This file exists in two locations:

$ find . -name RuntimeAdapter.h
./node_modules/react-native/ReactCommon/hermes/inspector/RuntimeAdapter.h
./ios/Pods/Headers/Private/React-hermes/reacthermes/RuntimeAdapter.h

For some reason I can't remember we couldn't use the instance from Pods/Headers/Private. So we need to use the one from node_modules and add node_modules/react-native/ReactCommon to HEADER_SEARCH_PATHS.

When running pod install, CocoaPods generates RNReanimated.podspec.json. The content of this file affects the checksum (md5 hash) of RNReanimated in Podfile.lock.

Currently, HEADER_SEARCH_PATHS contains the absolute path to ReactCommon directory. Since the path is absolute, it also contains the project root path, which is different between CI and local development, thus affects the checksum in Podfile.lock. This also affects v2 releases as we unified RNReanimated.podspec for 2.x and 3.x.

This PR changes the path to ReactCommon directory from absolute to relative from $(PODS_ROOT) which can be obtained as Pod::Config.instance.project_pods_root in Podspec.

Another option is to #import <React-hermes/reacthermes/RuntimeAdapter.h> instead of <hermes/inspector/RuntimeAdapter.h> and entirely remove path to ReactCommon directory from HEADER_SEARCH_PATHS.

Checked on a fresh RN 0.65.2 app with Reanimated installed from package.

@tomekzaw tomekzaw marked this pull request as ready for review October 20, 2022 15:31
@tomekzaw tomekzaw requested a review from piaskowyk October 20, 2022 15:32
@tomekzaw tomekzaw force-pushed the @tomekzaw/detect-podfile-changes branch 2 times, most recently from 90bcd8f to 9e01ccd Compare October 20, 2022 16:47
@tomekzaw tomekzaw force-pushed the @tomekzaw/detect-podfile-changes branch 3 times, most recently from 9144640 to 9e6bcf3 Compare October 24, 2022 06:50
@tomekzaw tomekzaw force-pushed the @tomekzaw/detect-podfile-changes branch from 5f5a779 to 4d6e443 Compare October 24, 2022 07:45
hannojg added a commit to margelo/expensify-app-fork that referenced this pull request Oct 25, 2022
software-mansion/react-native-reanimated#3701

Only applied parts, because on REA's main branch the ios project setup changed a bit so i needed to only use whats necessary for the current setup.\

This part of the patch can be reverted once the PR landed and we updated the REA version
@piaskowyk piaskowyk merged commit c45c78e into main Oct 26, 2022
@piaskowyk piaskowyk deleted the @tomekzaw/detect-podfile-changes branch October 26, 2022 09:48
piaskowyk pushed a commit that referenced this pull request Oct 26, 2022
Fixes #3696.

When compiling Reanimated 3.0.0-rc.3+ for iOS, we need to import
`RuntimeAdapter.h`. This file exists in two locations:

```
$ find . -name RuntimeAdapter.h
./node_modules/react-native/ReactCommon/hermes/inspector/RuntimeAdapter.h
./ios/Pods/Headers/Private/React-hermes/reacthermes/RuntimeAdapter.h
```

For some reason I can't remember we couldn't use the instance from
`Pods/Headers/Private`. So we need to use the one from node_modules and
add `node_modules/react-native/ReactCommon` to `HEADER_SEARCH_PATHS`.

When running `pod install`, CocoaPods generates
`RNReanimated.podspec.json`. The content of this file affects the
checksum (md5 hash) of `RNReanimated` in `Podfile.lock`.

Currently, `HEADER_SEARCH_PATHS` contains the absolute path to
`ReactCommon` directory. Since the path is absolute, it also contains
the project root path, which is different between CI and local
development, thus affects the checksum in `Podfile.lock`. This also
affects v2 releases as we unified RNReanimated.podspec for 2.x and 3.x.

This PR changes the path to `ReactCommon` directory from absolute to
relative from `$(PODS_ROOT)` which can be obtained as
`Pod::Config.instance.project_pods_root` in Podspec.

Another option is to `#import
<React-hermes/reacthermes/RuntimeAdapter.h>` instead of
`<hermes/inspector/RuntimeAdapter.h>` and entirely remove path to
`ReactCommon` directory from `HEADER_SEARCH_PATHS`.

Checked on a fresh RN 0.65.2 app with Reanimated installed from package.
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Description

Fixes software-mansion#3696.

When compiling Reanimated 3.0.0-rc.3+ for iOS, we need to import
`RuntimeAdapter.h`. This file exists in two locations:

```
$ find . -name RuntimeAdapter.h
./node_modules/react-native/ReactCommon/hermes/inspector/RuntimeAdapter.h
./ios/Pods/Headers/Private/React-hermes/reacthermes/RuntimeAdapter.h
```

For some reason I can't remember we couldn't use the instance from
`Pods/Headers/Private`. So we need to use the one from node_modules and
add `node_modules/react-native/ReactCommon` to `HEADER_SEARCH_PATHS`.

When running `pod install`, CocoaPods generates
`RNReanimated.podspec.json`. The content of this file affects the
checksum (md5 hash) of `RNReanimated` in `Podfile.lock`.

Currently, `HEADER_SEARCH_PATHS` contains the absolute path to
`ReactCommon` directory. Since the path is absolute, it also contains
the project root path, which is different between CI and local
development, thus affects the checksum in `Podfile.lock`. This also
affects v2 releases as we unified RNReanimated.podspec for 2.x and 3.x.

This PR changes the path to `ReactCommon` directory from absolute to
relative from `$(PODS_ROOT)` which can be obtained as
`Pod::Config.instance.project_pods_root` in Podspec.

Another option is to `#import
<React-hermes/reacthermes/RuntimeAdapter.h>` instead of
`<hermes/inspector/RuntimeAdapter.h>` and entirely remove path to
`ReactCommon` directory from `HEADER_SEARCH_PATHS`.

Checked on a fresh RN 0.65.2 app with Reanimated installed from package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2.11.0 causing diffs in Podfile.lock depending on if it was built on an ARM or x86 machine
2 participants