facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.11k stars 24.32k forks source link

Diff in Podfile.lock when runs in different machines #31121

Closed franciscomorais closed 1 month ago

franciscomorais commented 3 years ago

Description

When we run pod install we have different hashes in FBReactNativeSpec. This is because I think the building scripts are using full paths to generate the hash. For example, on the same machine if we rename the project directory, the hash will be different.

I think the PR that injects this bug is this.

Steps To Reproduce

1 - install node dependencies: yarn 2 - install ios pods dependencies: pod install 3 - create a commit in git: git commit -m "whatever your want" 4 - rename project folder: cd ../.. && mv projectSample projectSample2 && cd projectSample2/ios 5 - runs again pods installation command: pod install

Expected Results

Podfile.lock doesn't have diffs after run pod install --repo-update.

Founded Results

   ...
   FBLazyVector: 5776f027522ce1b2415982c48c8407c95966c60f
-  FBReactNativeSpec: 162f37a35ac13f9ef7ef0a77973a21393ba0dbab
+  FBReactNativeSpec: 7594b4ffdc73f2695967c9f7c766cf3c26da86a8
   Flipper: d3da1aa199aad94455ae725e9f3aa43f3ec17021
   ...

React Native version:

Module Version
react 17.0.1
react-native 0.64.0-rc.4
jnak commented 10 months ago

For those running into an issue with boost today, the jfrog mirror is currently down -> https://github.com/boostorg/boost/issues/842

danidaryaweesh commented 10 months ago

@jnak I'm running into the issue today after upgrading cocoaPods to the latest version. So we only have to wait for them to fit? or what can we do, appreciate your help here.

jnak commented 10 months ago

@danidaryaweesh If you have access to the filesystem , you can update the podspec file to point at Sourceforge

Screenshot 2023-12-31 at 2 34 36 PM
sanduluca commented 10 months ago

@danidaryaweesh If you have access to the filesystem , you can update the podspec file to point at Sourceforge

Screenshot 2023-12-31 at 2 34 36 PM

Where is the file ?

danidaryaweesh commented 10 months ago

@sanduluca If you have the node_modules installed, you should find it under this path: /node_modules/react-native/third-party-podspecs/boost.podspec

jordiepasman commented 9 months ago

Boost looks fixed I think with the new RN versions, but I currently have the following issue that seems related or similar to the error message.

I try to upgrade an app from 0.71.8 to 0.73.2, i get this issue. 😢 Maybe someone have any idea what causes this issue and if there is a way to solve it?

Tanks in advance!

Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Verifying no changes
[!] There were changes to the lockfile in deployment mode:
SPEC CHECKSUMS:
  glog:
    New Lockfile: ..........
    Old Lockfile: ..........
mlazari commented 9 months ago

@jordiepasman Did you try this https://github.com/facebook/react-native/issues/31121#issuecomment-1825568692 ?

storm2513 commented 9 months ago

I'm upgrading an app from 0.72.9 to 0.73.2 and also get glog checksum issue on CI:

[!] There were changes to the lockfile in deployment mode:
SPEC CHECKSUMS:
  glog:
    New Lockfile: 035f1e36e53b355cf70f6434d161b36e7d21fecd
    Old Lockfile: c5d68082e772fa1c511173d6b30a9de2c05a69a2

I've tried https://github.com/facebook/react-native/issues/31121#issuecomment-1825568692, result is the same

stianjensen commented 9 months ago

I'm upgrading an app from 0.72.9 to 0.73.2 and also get glog checksum issue on CI:

You have to run pod update glog once locally before committing changes to your Pod lockfile. The reason is that react-native keeps changing the contents of the glog podspec file (which the checksum is computed from), without changing its version number at the same time. This confuses cocoapods.

Check the history here where you see that the contents of the podspec is changed, but there version number is not (not even for the next release of react-native): https://github.com/facebook/react-native/commits/fd0ca4dd6209d79ac8c93dbffac2e3dca1caeadc/packages/react-native/third-party-podspecs/glog.podspec

By explicitly calling pod update glog (or bundle exec pod update glog if you don't have a global cocoapods install), you're forcing it to 'pull the latest version' (only from your node_modules though, so you do get the version you want anyway). This way you should get the same version as a fresh box on your CI, instead of a stale version from your local cache (which cocoapods thinks is valid since they have the same version number).

storm2513 commented 9 months ago

Running pod update glog (and bundle exec pod repo update) doesn't lead to changes to Podfile.lock, glog checksum stays the same.

Using Xcode 14.3.1 instead of Xcode 14.2 on CI helped though.

mlazari commented 9 months ago

@storm2513 I think the checksum in your Podfile.lock file is correct, I have the same one in my projects (glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2), that's why it doesn't changes. Probably it was some caching issue on CI.

stianjensen commented 8 months ago

Using Xcode 14.3.1 instead of Xcode 14.2 on CI helped though.

Tracked down the reason why you get different checksums for glogdepending on Xcode version if you use a mix of pre-14.3 and newer versions: https://github.com/facebook/react-native/blob/1387725aabd42e02646899a36a2f76731268191c/packages/react-native/third-party-podspecs/glog.podspec#L41-L42

These lines cause DEFINES_MODULE to flip between YES and NO in the generated podspec, which results in different checksums for the file.

I don't think cocoapods has a good general answer to having lockfiles shared between Xcode versions (at least not with the level of dynamic code in podspec files that react-native – necessarily – uses).

react-native-bot commented 2 months ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

react-native-bot commented 1 month ago

This issue was closed because it has been stalled for 7 days with no activity.