Skip to content

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

Description

@louiszawadzki

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 :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions