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

pod install generates a new checksum in Podfile.lock for every root location #58

Open
louiszawadzki opened this issue Oct 21, 2024 · 0 comments

Comments

@louiszawadzki
Copy link

louiszawadzki commented Oct 21, 2024

Hi!

We are facing an issue that is preventing us from adding Skottie to our project.

Steps to reproduce from scratch

  • Create React Native project
  • Install react-native-skottie: yarn add react-native-skottie
  • Install react-native-skia: yarn add @shopify/react-native-skia
  • Run (cd ios && bundle exec pod install)
  • Install the same project on another machine or at another location
  • Run (cd ios && bundle exec pod install)

Expectation: No change in Podfile.lock
Actual behaviour: checksum for pod react-native-skia-skottie has changes in Podfile.lock

This is a problem for us for 2 reasons:

  1. Every time a developer runs bundle exec pod install they have a file change in git
  2. On our CI we check that there is no git change after installing pods, which fails because of this

Reproduce the issue quickly with this repo

Investigation

I believe the checksum from cocoapods is generated from the output of pod ipc spec ../node_modules/react-native-skottie/react-native-skia-skottie.podspec - you can run it from the SkottiePodsIssue as yarn podipc and it will write the output to a pod.json file at the root.

When running the command, I see that it includes the absolute path where the project is located on the machine (/Users/me/SkottiePodsIssue in the exemple below): https://github.com/louiszawadzki/SkottiePodsIssue/blob/main/pod.json

This is because we use the absolute path to react-native-skia in the podspec: https://github.com/margelo/react-native-skottie/blob/main/package/react-native-skia-skottie.podspec#L7

Proposed solution

I would suggest to use the ${PROJECT_DIR} env variable that is available during the iOS build phase as suggested here https://stackoverflow.com/a/33359337. However I'm not sure this would work with prepare_command.

If you want to I can create a PR with this change :)

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

No branches or pull requests

1 participant