-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Diff in Podfile.lock when runs in different machines #31121
Comments
|
|
We have the same problem, each machine generates a different
|
System info:
|
I think the issue comes from here: react-native/scripts/react_native_pods.rb Line 191 in 00bc09c
The object assigned to |
The root cause of this is absolute pathing in script_phase, you can inspect the resolved spec file by running: pod ipc spec node_modules/react-native/React/FBReactNativeSpec/FBReactNativeSpec.podspec you should see something like: {
"name": "FBReactNativeSpec",
"version": "0.64.0",
"summary": "-",
"homepage": "https://reactnative.dev/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "10.0"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.64.0"
},
"source_files": "**/*.{c,h,m,mm,cpp}",
"header_dir": "FBReactNativeSpec",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)/React/FBReactNativeSpec\" \"$(PODS_ROOT)/RCT-Folly\""
},
"dependencies": {
"RCT-Folly": [
"2020.01.13.00"
],
"RCTRequired": [
"0.64.0"
],
"RCTTypeSafety": [
"0.64.0"
],
"React-Core": [
"0.64.0"
],
"React-jsi": [
"0.64.0"
],
"ReactCommon/turbomodule/core": [
"0.64.0"
]
},
"script_phases": {
"name": "Generate Specs",
"input_files": [
"<absolute project path>/node_modules/react-native/scripts/../Libraries"
],
"output_files": [
"$(DERIVED_FILE_DIR)/codegen-FBReactNativeSpec.log",
"<absolute project path>/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h",
"<absolute project path>/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm"
],
"script": "set -o pipefail\n\nbash -l -c 'SRCS_DIR=<absolute project path>/node_modules/react-native/scripts/../Libraries CODEGEN_MODULES_OUTPUT_DIR=<absolute project path>/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec CODEGEN_MODULES_LIBRARY_NAME=FBReactNativeSpec <absolute project path>/node_modules/react-native/scripts/generate-specs.sh' 2>&1 | tee \"${SCRIPT_OUTPUT_FILE_0}\"",
"execution_position": "before_compile",
"show_env_vars_in_log": true
},
"prepare_command": "mkdir -p <absolute project path>/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec && touch <absolute project path>/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h <absolute project path>/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm"
} |
I've created a patch file that seems to solve the problem, i might have missed something but it seems to be working great for me and builds are passing, i had a look at the generated code output too and it seems to all be there. Could be cleaned up a bit but the main issue with the current approach is that diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb
index 2a8affb..a807b2b 100644
--- a/node_modules/react-native/scripts/react_native_pods.rb
+++ b/node_modules/react-native/scripts/react_native_pods.rb
@@ -149,7 +149,7 @@ def use_react_native_codegen!(spec, options={})
return if ENV['DISABLE_CODEGEN'] == '1'
# The path to react-native (e.g. react_native_path)
- prefix = options[:path] ||= File.join(__dir__, "..")
+ prefix = options[:path] ||= '$PODS_TARGET_SRCROOT/../../'
# The path to JavaScript files
srcs_dir = options[:srcs_dir] ||= File.join(prefix, "Libraries")
@@ -192,10 +192,12 @@ def use_react_native_codegen!(spec, options={})
:name => 'Generate Specs',
:input_files => [srcs_dir],
:output_files => ["$(DERIVED_FILE_DIR)/codegen-#{codegen_modules_library_name}.log"].concat(generated_files),
- :script => "set -o pipefail\n\nbash -l -c '#{env_vars} CODEGEN_MODULES_LIBRARY_NAME=#{codegen_modules_library_name} #{File.join(__dir__, "generate-specs.sh")}' 2>&1 | tee \"${SCRIPT_OUTPUT_FILE_0}\"",
+ :script => "set -o pipefail\n\nbash -l -c '#{env_vars} CODEGEN_MODULES_LIBRARY_NAME=#{codegen_modules_library_name} #{File.join("$PODS_TARGET_SRCROOT/../../scripts", "generate-specs.sh")}' 2>&1 | tee \"${SCRIPT_OUTPUT_FILE_0}\"",
:execution_position => :before_compile,
:show_env_vars_in_log => true
}
- spec.prepare_command = "#{mkdir_command} && touch #{generated_files.reduce() { |str, file| str + " " + file }}"
+
+
+ spec.prepare_command = "#{mkdir_command.sub prefix, '../../'} && touch #{generated_files.reduce() { |str, file| (str.sub prefix, '../../') + " " + (file.sub prefix, '../../') }}"
end
now if you run {
"name": "FBReactNativeSpec",
"version": "0.64.0",
"summary": "-",
"homepage": "https://reactnative.dev/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "10.0"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.64.0"
},
"source_files": "**/*.{c,h,m,mm,cpp}",
"header_dir": "FBReactNativeSpec",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)/React/FBReactNativeSpec\" \"$(PODS_ROOT)/RCT-Folly\""
},
"dependencies": {
"RCT-Folly": [
"2020.01.13.00"
],
"RCTRequired": [
"0.64.0"
],
"RCTTypeSafety": [
"0.64.0"
],
"React-Core": [
"0.64.0"
],
"React-jsi": [
"0.64.0"
],
"ReactCommon/turbomodule/core": [
"0.64.0"
]
},
"script_phases": {
"name": "Generate Specs",
"input_files": [
"$PODS_TARGET_SRCROOT/../../Libraries"
],
"output_files": [
"$(DERIVED_FILE_DIR)/codegen-FBReactNativeSpec.log",
"$PODS_TARGET_SRCROOT/../../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h",
"$PODS_TARGET_SRCROOT/../../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm"
],
"script": "set -o pipefail\n\nbash -l -c 'SRCS_DIR=$PODS_TARGET_SRCROOT/../../Libraries CODEGEN_MODULES_OUTPUT_DIR=$PODS_TARGET_SRCROOT/../../React/FBReactNativeSpec/FBReactNativeSpec CODEGEN_MODULES_LIBRARY_NAME=FBReactNativeSpec $PODS_TARGET_SRCROOT/../../scripts/generate-specs.sh' 2>&1 | tee \"${SCRIPT_OUTPUT_FILE_0}\"",
"execution_position": "before_compile",
"show_env_vars_in_log": true
},
"prepare_command": "mkdir -p ../../React/FBReactNativeSpec/FBReactNativeSpec && touch ../../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h ../../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm"
} |
I have encountered this same problem and reported it here: #31193 (sorry, I did not find this issue report before). For me fixing the prefix in |
I'm encountering a a similar behaviour with diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index a27ec70a8..8ff577408 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -673,7 +673,7 @@ SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
BVLinearGradient: 0d985ec461359c82bc254f26d11008bdae50d17a
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
- DoubleConversion: cde416483dac037923206447da6e1454df403714
+ DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
FBLazyVector: 7b423f9e248eae65987838148c36eec1dbfe0b53
FBReactNativeSpec: 976b4f05ee6cfd75377064c69875f5dd09bb992d
FBSDKCoreKit: 4afd6ff53d8133a433dbcda44451c9498f8c6ce4
@@ -686,7 +686,7 @@ SPEC CHECKSUMS:
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
Flipper-RSocket: 127954abe8b162fcaf68d2134d34dc2bd7076154
FlipperKit: 8a20b5c5fcf9436cac58551dc049867247f64b00
- glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
+ glog: 1f3da668190260b06b429bb211bfbee5cd790c28
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3
OneSignal: fa98eaa90372bb367b6a4a1c1622ffb9832c7600 |
@habovh I use The versions in
|
@mlazari so my discrepancy probably comes from something else, I'll keep investigating. Thanks for making sure this issue was not related! |
@habovh I’ve been seeing |
@sonicdoe I've come to the same conclusion. However I fixed it by running |
@chrisglein What's the status on this? Our team has been running into this issue, constantly ping-ponging |
No status drive by me - I've just been helping tag issues. I have no iOS expertise myself. But since there are a number of people hitting this let me see if I can flag the right folks to take a look. |
This specific issue should have been resolved with this commit: 751708d The issue could be closed. |
We've been scratching our heads for a while now, trying to figure out why our CI cache isn't cooperating. It appears that there's an inconsistency after installing pods on a different machine. Is this the only issue, or are there any specific pods that might be messing with the checksum stability? |
Has the same three packages: DoubleConversion, boost and glog which differ on m1 and intel procs --- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -1106,10 +1106,10 @@ SPEC CHECKSUMS:
Amplitude: 10f20d4436fdcd38ddd5be1da7033fcc21f4143e
amplitude-react-native: 6e5b9e38c53e11a86f62f874a42cf176e2b82c86
AnalyticsConnector: a53214d38ae22734c6266106c0492b37832633a9
- boost: a7c83b31436843459a1961bfd74b96033dc77234
+ boost: 57d2868c099736d80fcd648bf211b4431e51a558
BVLinearGradient: 880f91a7854faff2df62518f0281afb1c60d49a3
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
- DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
+ DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 5fbbff1d7734827299274638deb8ba3024f6c597
FBReactNativeSpec: 638095fe8a01506634d77b260ef8a322019ac671
Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06
@@ -1132,7 +1132,7 @@ SPEC CHECKSUMS:
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
- glog: 5337263514dd6f09803962437687240c5dc39aa4
+ glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
GoogleAppMeasurement: 70ce9aa438cff1cfb31ea3e660bcc67734cb716e
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 |
@Reeywhaar If you try to remove pod caches and reinstall pods on both computers, does it fix the issue?
|
Nope, no luck, tried updating said pods, install with repo-update, update with repo-update, cleaning cache with |
I've also found someone in google with exact same hashes for boost, glog and DoubleConversion, which means it is not some per-machine hash: https://gitlab.ow2.org/RocketChat/Rocket.Chat.ReactNative/-/blob/5e8e359fa8d9f48d9207c2256fff9524aa231e74/ios/Podfile.lock |
@Reeywhaar I have the same hashes as the green ones in your example on my Mac Mini with M1:
|
Indeed! Updating pods on m1 resolved the issue. Now I have correct hashes (e.g |
The general problem with glog, DoubleConversion etc. is simply that their podspecs are often updated without bumping the version number at the same time. The hashes in your podfile is a checksum of that package's podspec file, which cocoapods only expects to change when its version number changes. This confuses cocoapods, so you need to explicitly update these packages to be able to get the correct new hash when updating react-native. In our project we just have a permanent list of some packages to always call update on when resolving new versions (just make sure to also not run this update command on CI, where you want to only install from your lockfile). Our Makefile pod install target is basically this:
|
For those running into an issue with boost today, the jfrog mirror is currently down -> boostorg/boost#842 |
@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. |
@danidaryaweesh If you have access to the filesystem , you can update the podspec file to point at Sourceforge |
Where is the file ? |
@sanduluca If you have the node_modules installed, you should find it under this path: /node_modules/react-native/third-party-podspecs/boost.podspec |
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. 😢 Tanks in advance!
|
@jordiepasman Did you try this #31121 (comment) ? |
I'm upgrading an app from 0.72.9 to 0.73.2 and also get
I've tried #31121 (comment), result is the same |
You have to run 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): By explicitly calling |
Running Using Xcode 14.3.1 instead of Xcode 14.2 on CI helped though. |
@storm2513 I think the checksum in your Podfile.lock file is correct, I have the same one in my projects ( |
Tracked down the reason why you get different checksums for react-native/packages/react-native/third-party-podspecs/glog.podspec Lines 41 to 42 in 1387725
These lines cause 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). |
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. |
This issue was closed because it has been stalled for 7 days with no activity. |
Description
When we run
pod install
we have different hashes inFBReactNativeSpec
. 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
React Native version:
The text was updated successfully, but these errors were encountered: