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

Podfile hashes encode absolute file path #38492

Closed
stianjensen opened this issue Jul 18, 2023 · 5 comments
Closed

Podfile hashes encode absolute file path #38492

stianjensen opened this issue Jul 18, 2023 · 5 comments

Comments

@stianjensen
Copy link
Contributor

Description

After upgrading to 0.72.x, we're seeing an issue generating Podfile.lock with some of the new packages added. Specifically:

  • React-debug
  • React-NativeModulesApple
  • React-runtimescheduler
  • React-utils
  • ReactCommon

My theory is that this is due to absolute paths to files on my machine are being used as part of the checksum generation, which means it will always be different on every computer.

It is not simply an issue of running pod update {pod_name} that usually works when the problem is just that the podspec file has been changed without bumping the version number.

React Native Version

0.72.3

Output of npx react-native info

System:
  OS: macOS 13.3.1
  CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Memory: 7.41 GB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 16.13.2
    path: ~/.nvm/versions/node/v16.13.2/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 8.1.2
    path: ~/.nvm/versions/node/v16.13.2/bin/npm
  Watchman:
    version: 2023.06.08.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.0
    path: /Users/stiaje/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2020.3 AI-203.7717.56.2031.7784292
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.12
    path: /usr/local/opt/openjdk@11/bin/javac
  Ruby:
    version: 2.7.3
    path: /Users/stiaje/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.3
    wanted: 0.72.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

If you run pod install --deployment you'll get an error because the hashes for the listed dependencies above have changed, and if not, the Podfile.lock will just keep changing between each computer.

Snack, code example, screenshot, or link to a repository

Here's a previous commit that fixed a similar issue in an earlier version of react native:
bdfe2a5

And a suggested patch for that earlier issue:
#31121 (comment)

@stianjensen
Copy link
Contributor Author

Here's also another earlier PR that tried to switch from absolute to relative paths in order to avoid this issue:
#31195

@mortentangen
Copy link

Seems like the absolute path in header_mappings_dir was introduced in v0.72.2

@Shahaed
Copy link

Shahaed commented Aug 28, 2023

Seems like the absolute path in header_mappings_dir was introduced in v0.72.2

That line is in: node_modules/react-native/ReactCommon/react/debug/React-debug.podspec.
React-NativeModulesApple, React-runtimescheduler, React-utils, ReactCommon all have dependencies on React-debug.

@koenpunt has #39177 #39178 out to resolve these

@Shahaed
Copy link

Shahaed commented Aug 30, 2023

#39177 was resolved with 16fc065 so this issue can be closed too?

@cortinico
Copy link
Contributor

Closing as @cipolleschi handled all the cases where Podfiles where referencing absolute paths

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

No branches or pull requests

4 participants