mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
e9eca07f52
Summary:
This partially reverts commit 58adc5e4b9.
Using an absolute path in a podspec is wrong, and causes checksum issues when installs are ran on different systems.
Example:
`pod install --deployment --clean-install` breaks on non-matching checksums on CI because the absolute path is not the same in that environment.
```
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Verifying no changes
[!] There were changes to the lockfile in deployment mode:
SPEC CHECKSUMS:
React-debug:
New Lockfile: 419922cde6c58cd5b9d43e4a09805146a7dd13a8
Old Lockfile: 1ce329843d8f9a9cbe0cdd9de264b20e89586734
React-NativeModulesApple:
New Lockfile: a683b0c999e76b7d15ad9d5eaf8b6308e710a93e
Old Lockfile: f82356d67a137295d098a98a03be5ee35871b5a5
React-runtimescheduler:
New Lockfile: 79f8dff11acbe36aaeece63553680d7a8272af96
Old Lockfile: 16c5282d43a0df50d7c68ebf0218aeeb642a7086
React-utils:
New Lockfile: 4fabb3cba786651e35bc41e610b0698fa24cecff
Old Lockfile: e7e9118d0e85b107bb06d1a5f72ec5db6bddb911
ReactCommon:
New Lockfile: af30fb021799e18c85a8e30ce799e15607e82212
Old Lockfile: f04f86f33c22e05dbf875789ea522ee486dace78
```
And even tho the change fixed an issue with pnpm, the issue it introduces with cocoapods I think is a bigger one.
## Changelog:
[INTERNAL] - Revert commit that makes podfile unstable
Pull Request resolved: https://github.com/facebook/react-native/pull/39177
Test Plan: Tested locally that the hashes are stable
Reviewed By: NickGerleman
Differential Revision: D48773887
Pulled By: cipolleschi
fbshipit-source-id: 96bcdbadc17a24fa9a8669f569d004bee6a03521
74 lines
3.1 KiB
Ruby
74 lines
3.1 KiB
Ruby
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
#
|
||
# This source code is licensed under the MIT license found in the
|
||
# LICENSE file in the root directory of this source tree.
|
||
|
||
require "json"
|
||
|
||
package = JSON.parse(File.read(File.join(__dir__, "..", "package.json")))
|
||
version = package['version']
|
||
|
||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||
if version == '1000.0.0'
|
||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
||
else
|
||
source[:tag] = "v#{version}"
|
||
end
|
||
|
||
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
|
||
folly_version = '2021.07.22.00'
|
||
boost_compiler_flags = '-Wno-documentation'
|
||
using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"
|
||
Pod::Spec.new do |s|
|
||
s.name = "ReactCommon"
|
||
s.module_name = "ReactCommon"
|
||
s.version = version
|
||
s.summary = "-" # TODO
|
||
s.homepage = "https://reactnative.dev/"
|
||
s.license = package["license"]
|
||
s.author = "Meta Platforms, Inc. and its affiliates"
|
||
s.platforms = { :ios => "12.4" }
|
||
s.source = source
|
||
s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility
|
||
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
||
"USE_HEADERMAP" => "YES",
|
||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
||
"GCC_WARN_PEDANTIC" => "YES" }
|
||
if ENV['USE_FRAMEWORKS']
|
||
s.header_mappings_dir = './'
|
||
end
|
||
|
||
# TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
|
||
# Note: Update this only when ready to minimize breaking changes.
|
||
s.subspec "turbomodule" do |ss|
|
||
ss.dependency "React-callinvoker", version
|
||
ss.dependency "React-perflogger", version
|
||
ss.dependency "React-cxxreact", version
|
||
ss.dependency "React-jsi", version
|
||
ss.dependency "RCT-Folly", folly_version
|
||
s.dependency "React-logger", version
|
||
ss.dependency "DoubleConversion"
|
||
ss.dependency "glog"
|
||
if using_hermes
|
||
ss.dependency "hermes-engine"
|
||
end
|
||
|
||
ss.subspec "bridging" do |sss|
|
||
sss.dependency "React-jsi", version
|
||
sss.source_files = "react/bridging/**/*.{cpp,h}"
|
||
sss.exclude_files = "react/bridging/tests"
|
||
sss.header_dir = "react/bridging"
|
||
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
|
||
if using_hermes
|
||
sss.dependency "hermes-engine"
|
||
end
|
||
end
|
||
|
||
ss.subspec "core" do |sss|
|
||
sss.source_files = "react/nativemodule/core/ReactCommon/**/*.{cpp,h}"
|
||
end
|
||
end
|
||
end
|