Skip to content

Commit 73b41b5

Browse files
authored
[RN][iOS][0.76] Bump folly to fix xcode 16.3 removed traits (facebook#50431)
* Update Gemfile for Ruby > 3.2 * [RN]Bump folly to fix issue with Xcode 16.3
1 parent 63c3508 commit 73b41b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+516
-323
lines changed

packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ header_search_paths = [
3232
"$(PODS_ROOT)/Headers/Private/React-Core",
3333
"$(PODS_ROOT)/boost",
3434
"$(PODS_ROOT)/DoubleConversion",
35+
"$(PODS_ROOT)/fast_float/include",
3536
"$(PODS_ROOT)/fmt/include",
3637
"$(PODS_ROOT)/RCT-Folly",
3738
"${PODS_ROOT}/Headers/Public/FlipperKit",

packages/react-native/Libraries/Blob/React-RCTBlob.podspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ header_search_paths = [
2424
"\"$(PODS_ROOT)/RCT-Folly\"",
2525
"\"$(PODS_ROOT)/boost\"",
2626
"\"$(PODS_ROOT)/DoubleConversion\"",
27+
"\"$(PODS_ROOT)/fast_float/include\"",
2728
"\"$(PODS_ROOT)/fmt/include\"",
2829
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
2930
]
@@ -48,7 +49,8 @@ Pod::Spec.new do |s|
4849
}
4950

5051
s.dependency "DoubleConversion"
51-
s.dependency "fmt", "9.1.0"
52+
s.dependency "fast_float"
53+
s.dependency "fmt"
5254
s.dependency "RCT-Folly", folly_version
5355
s.dependency "React-jsi"
5456
s.dependency "React-Core/RCTBlobHeaders"

packages/react-native/React-Core.podspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ folly_compiler_flags = folly_config[:compiler_flags]
2121
folly_version = folly_config[:version]
2222

2323
socket_rocket_config = get_socket_rocket_config()
24-
socket_rocket_version = socket_rocket_config[:version]
24+
socket_rocket_version = socket_rocket_config[:version]
2525

2626
boost_compiler_flags = '-Wno-documentation'
2727

@@ -49,6 +49,7 @@ header_search_paths = [
4949
"$(PODS_TARGET_SRCROOT)/ReactCommon",
5050
"$(PODS_ROOT)/boost",
5151
"$(PODS_ROOT)/DoubleConversion",
52+
"$(PODS_ROOT)/fast_float/include",
5253
"$(PODS_ROOT)/fmt/include",
5354
"$(PODS_ROOT)/RCT-Folly",
5455
"${PODS_ROOT}/Headers/Public/FlipperKit",

packages/react-native/React/CoreModules/React-CoreModules.podspec

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ folly_config = get_folly_config()
2020
folly_compiler_flags = folly_config[:compiler_flags]
2121
folly_version = folly_config[:version]
2222

23-
socket_rocket_config = get_socket_rocket_config()
24-
socket_rocket_version = socket_rocket_config[:version]
25-
2623
header_search_paths = [
2724
"\"$(PODS_ROOT)/boost\"",
2825
"\"$(PODS_TARGET_SRCROOT)/React/CoreModules\"",
2926
"\"$(PODS_ROOT)/RCT-Folly\"",
3027
"\"$(PODS_ROOT)/DoubleConversion\"",
28+
"\"$(PODS_ROOT)/fast_float/include\"",
3129
"\"$(PODS_ROOT)/fmt/include\"",
3230
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
3331
]
@@ -51,14 +49,15 @@ Pod::Spec.new do |s|
5149
}
5250
s.framework = "UIKit"
5351
s.dependency "DoubleConversion"
54-
s.dependency "fmt", "9.1.0"
55-
s.dependency "RCT-Folly", folly_version
56-
s.dependency "RCTTypeSafety", version
57-
s.dependency "React-Core/CoreModulesHeaders", version
58-
s.dependency "React-RCTImage", version
59-
s.dependency "React-jsi", version
52+
s.dependency "fast_float"
53+
s.dependency "fmt"
54+
s.dependency "RCT-Folly"
55+
s.dependency "RCTTypeSafety"
56+
s.dependency "React-Core/CoreModulesHeaders"
57+
s.dependency "React-RCTImage"
58+
s.dependency "React-jsi"
6059
s.dependency 'React-RCTBlob'
61-
s.dependency "SocketRocket", socket_rocket_version
60+
s.dependency "SocketRocket"
6261
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
6362

6463
add_dependency(s, "ReactCodegen")

packages/react-native/React/CxxModule/RCTCxxMethod.mm

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,22 @@ - (id)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray
9898
NSNumber *id2 = arguments[arguments.count - 1];
9999

100100
second = ^(std::vector<folly::dynamic> args) {
101-
[bridge enqueueCallback:id2 args:convertFollyDynamicToId(folly::dynamic(args.begin(), args.end()))];
101+
folly::dynamic obj = folly::dynamic::array;
102+
for (auto &arg : args) {
103+
obj.push_back(std::move(arg));
104+
}
105+
[bridge enqueueCallback:id2 args:convertFollyDynamicToId(std::move(obj))];
102106
};
103107
} else {
104108
id1 = arguments[arguments.count - 1];
105109
}
106110

107111
first = ^(std::vector<folly::dynamic> args) {
108-
[bridge enqueueCallback:id1 args:convertFollyDynamicToId(folly::dynamic(args.begin(), args.end()))];
112+
folly::dynamic obj = folly::dynamic::array;
113+
for (auto &arg : args) {
114+
obj.push_back(std::move(arg));
115+
}
116+
[bridge enqueueCallback:id1 args:convertFollyDynamicToId(std::move(obj))];
109117
};
110118
}
111119

packages/react-native/React/React-RCTFabric.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ header_search_paths = [
2626
"\"$(PODS_TARGET_SRCROOT)/ReactCommon\"",
2727
"\"$(PODS_ROOT)/boost\"",
2828
"\"$(PODS_ROOT)/DoubleConversion\"",
29+
"\"$(PODS_ROOT)/fast_float/include\"",
2930
"\"$(PODS_ROOT)/fmt/include\"",
3031
"\"$(PODS_ROOT)/RCT-Folly\"",
3132
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",

packages/react-native/React/third-party.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
// LICENSE file in the root directory of this source tree.
99
//
1010

11-
HEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_83_0 $(SRCROOT)/../third-party/folly-2024.01.01.00 $(SRCROOT)/../third-party/glog-0.3.5/src
11+
HEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_83_0 $(SRCROOT)/../third-party/folly-2024.10.14.00 $(SRCROOT)/../third-party/glog-0.3.5/src
1212
OTHER_CFLAGS = -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1

packages/react-native/ReactAndroid/build.gradle.kts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ val prefabHeadersDir = project.file("$buildDir/prefab-headers")
6666
// Native versions which are defined inside the version catalog (libs.versions.toml)
6767
val BOOST_VERSION = libs.versions.boost.get()
6868
val DOUBLE_CONVERSION_VERSION = libs.versions.doubleconversion.get()
69+
val FAST_FLOAT_VERSION = libs.versions.fastFloat.get()
6970
val FMT_VERSION = libs.versions.fmt.get()
7071
val FOLLY_VERSION = libs.versions.folly.get()
7172
val GLOG_VERSION = libs.versions.glog.get()
@@ -179,6 +180,7 @@ val preparePrefab by
179180
// react_nativemodule_core
180181
Pair(File(buildDir, "third-party-ndk/boost/boost_1_83_0/").absolutePath, ""),
181182
Pair(File(buildDir, "third-party-ndk/double-conversion/").absolutePath, ""),
183+
Pair(File(buildDir, "third-party-ndk/fast_float/include/").absolutePath, ""),
182184
Pair(File(buildDir, "third-party-ndk/fmt/include/").absolutePath, ""),
183185
Pair(File(buildDir, "third-party-ndk/folly/").absolutePath, ""),
184186
Pair(File(buildDir, "third-party-ndk/glog/exported/").absolutePath, ""),
@@ -304,6 +306,27 @@ val prepareFolly by
304306
includeEmptyDirs = false
305307
into("$thirdPartyNdkDir/folly")
306308
}
309+
val downloadFastFloat by
310+
tasks.creating(Download::class) {
311+
dependsOn(createNativeDepsDirectories)
312+
src("https://github.com/fastfloat/fast_float/archive/v${FAST_FLOAT_VERSION}.tar.gz")
313+
onlyIfModified(true)
314+
overwrite(false)
315+
retries(5)
316+
quiet(true)
317+
dest(File(downloadsDir, "fast_float-${FAST_FLOAT_VERSION}.tar.gz"))
318+
}
319+
320+
val prepareFastFloat by
321+
tasks.registering(Copy::class) {
322+
dependsOn(if (dependenciesPath != null) emptyList() else listOf(downloadFastFloat))
323+
from(dependenciesPath ?: tarTree(downloadFastFloat.dest))
324+
from("src/main/jni/third-party/fast_float/")
325+
include("fast_float-${FAST_FLOAT_VERSION}/include/**/*", "CMakeLists.txt")
326+
eachFile { this.path = this.path.removePrefix("fast_float-${FAST_FLOAT_VERSION}/") }
327+
includeEmptyDirs = false
328+
into("$thirdPartyNdkDir/fast_float")
329+
}
307330

308331
val downloadFmt by
309332
tasks.creating(Download::class) {
@@ -541,6 +564,7 @@ android {
541564
"generateCodegenArtifactsFromSchema",
542565
prepareBoost,
543566
prepareDoubleConversion,
567+
prepareFastFloat,
544568
prepareFmt,
545569
prepareFolly,
546570
prepareGlog,

packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ add_library(fbjni ALIAS fbjni::fbjni)
4949
add_react_third_party_ndk_subdir(glog)
5050
add_react_third_party_ndk_subdir(boost)
5151
add_react_third_party_ndk_subdir(double-conversion)
52+
add_react_third_party_ndk_subdir(fast_float)
5253
add_react_third_party_ndk_subdir(fmt)
5354
add_react_third_party_ndk_subdir(folly)
5455
add_react_third_party_ndk_subdir(jsc)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under the MIT license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
6+
cmake_minimum_required(VERSION 3.13)
7+
set(CMAKE_VERBOSE_MAKEFILE on)
8+
9+
add_compile_options(-std=c++20 -fexceptions)
10+
11+
add_library(fast_float INTERFACE)
12+
13+
target_include_directories(fast_float INTERFACE include)

0 commit comments

Comments
 (0)