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

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

Closed
shamilovtim opened this issue Oct 20, 2022 · 3 comments · Fixed by #3701
Labels
Platform: iOS This issue is specific to iOS Reproducible 🎉

Comments

@shamilovtim
Copy link
Contributor

Description

We run CI on an x86 macOS container. My personal machine is an M1 Max. After bumping 2.10.0 -> 2.11.0 of reanimated we're getting non deterministic diffs in the Podfile.lock md5 hash depending on if Pods were built on an ARM machine or x86 machine

-  RNReanimated: 097e693137613d46d013634c9d25a88e7c64da1e
+  RNReanimated: 81bec259b82a8bd2902557e48ef36290be15f389

This causes our project to fail building on CI:
Screen Shot 2022-10-19 at 7 53 17 PM

Since the Pod is constructed locally, I assume the problem is in the source code of a podspec change to 2.11.0. And indeed, the Podspec did change: 2.10.0...2.11.0#diff-2f3e36d153f0b1ce894c5dd8afad3b4119dd38054d65d7a593f60cf2762edf1a.

Steps to reproduce

  1. yarn on an x86 machine
  2. yarn on an M1 machine

There should be a diff in Podfile.lock

Snack or a link to a repository

N/A build issue

Reanimated version

2.11.0

React Native version

0.68.3

Platforms

iOS

JavaScript runtime

JSC

Workflow

Expo bare workflow

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

@shamilovtim shamilovtim added the Needs review Issue is ready to be reviewed by a maintainer label Oct 20, 2022
@github-actions github-actions bot added the Missing repro This issue need minimum repro scenario label Oct 20, 2022
@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added the Platform: iOS This issue is specific to iOS label Oct 20, 2022
@Waltari10
Copy link

Waltari10 commented Oct 20, 2022

Facing a similar issue with the checksum changing in CI. My local machine is M1 and the build machine is an Intel Mac machine. The node_module/react-native-reanimated seems exactly the same when diffed, but the checksum ends up being different in podfile.lock.

EDIT: also downgrading to v2.10.0 fixes it.

@tomekzaw
Copy link
Member

tomekzaw commented Oct 20, 2022

Hey @shamilovtim, thanks for reporting this issue. At this moment the root cause of this issue is unknown to me. I've tried installing Reanimated in a fresh RN 0.68.3 app both on M1 and Intel machine but obviously the hashes are different due to different project paths. I found this issue in CocoaPods repo (CocoaPods/CocoaPods#11455) and compared RNReanimated.podspec.json generated by both machines but they are identical, excluding the path in HEADER_SEARCH_PATHS field.

Edit: actually, HEADER_SEARCH_PATHS contains the absolute path to ReactCommon directory so this might be the reason why it's different on CI than locally. In other words, it doesn't matter if it's an Intel or M1-based Mac - it's the project path that makes a difference here.

Edit: I was able to reproduce the issue on CI as well.

Edit: I've submitted a PR #3701 that should fix this issue.

@tomekzaw tomekzaw added Reproducible 🎉 and removed Missing repro This issue need minimum repro scenario Needs review Issue is ready to be reviewed by a maintainer labels Oct 20, 2022
piaskowyk pushed a commit that referenced this issue Oct 26, 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.
piaskowyk pushed a commit that referenced this issue 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 issue 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
Platform: iOS This issue is specific to iOS Reproducible 🎉
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants