Skip to content

Commit

Permalink
bump Folly to 2024.10.14.00 (facebook#47033)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#47033

Lastest Folly has updates to fix build errors with LLVM 19 which is also llikely needed for NDK 27

- facebook/folly@bf46c8a

- also add folly's new dependency fast_float

Changelog:
[General][Changed] - Bump Folly to 2024.10.14.00

Reviewed By: cortinico

Differential Revision: D64372125
  • Loading branch information
alanleedev authored and facebook-github-bot committed Oct 23, 2024
1 parent aadb1d9 commit 12718f5
Show file tree
Hide file tree
Showing 38 changed files with 460 additions and 274 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ header_search_paths = [
"$(PODS_ROOT)/Headers/Private/React-Core",
"$(PODS_ROOT)/boost",
"$(PODS_ROOT)/DoubleConversion",
"$(PODS_ROOT)/fast_float/include",
"$(PODS_ROOT)/fmt/include",
"$(PODS_ROOT)/RCT-Folly",
"${PODS_ROOT}/Headers/Public/FlipperKit",
Expand Down
4 changes: 3 additions & 1 deletion packages/react-native/Libraries/Blob/React-RCTBlob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"$(PODS_ROOT)/boost\"",
"\"$(PODS_ROOT)/DoubleConversion\"",
"\"$(PODS_ROOT)/fast_float/include\"",
"\"$(PODS_ROOT)/fmt/include\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]
Expand All @@ -48,7 +49,8 @@ Pod::Spec.new do |s|
}

s.dependency "DoubleConversion"
s.dependency "fmt", "9.1.0"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "RCT-Folly", folly_version
s.dependency "React-jsi"
s.dependency "React-Core/RCTBlobHeaders"
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/React-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

socket_rocket_config = get_socket_rocket_config()
socket_rocket_version = socket_rocket_config[:version]
socket_rocket_version = socket_rocket_config[:version]

boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]

use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
use_hermes_flag = use_hermes ? "-DUSE_HERMES=1" : ""
Expand All @@ -50,6 +50,7 @@ header_search_paths = [
"$(PODS_TARGET_SRCROOT)/ReactCommon",
"$(PODS_ROOT)/boost",
"$(PODS_ROOT)/DoubleConversion",
"$(PODS_ROOT)/fast_float/include",
"$(PODS_ROOT)/fmt/include",
"$(PODS_ROOT)/RCT-Folly",
"${PODS_ROOT}/Headers/Public/FlipperKit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

socket_rocket_config = get_socket_rocket_config()
socket_rocket_version = socket_rocket_config[:version]
socket_rocket_version = socket_rocket_config[:version]

header_search_paths = [
"\"$(PODS_ROOT)/boost\"",
"\"$(PODS_TARGET_SRCROOT)/React/CoreModules\"",
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"$(PODS_ROOT)/DoubleConversion\"",
"\"$(PODS_ROOT)/fast_float/include\"",
"\"$(PODS_ROOT)/fmt/include\"",
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
]
Expand All @@ -47,7 +48,7 @@ Pod::Spec.new do |s|

s.ios.exclude_files = "PlatformStubs/**/*"
exclude_files = ["RCTStatusBarManager.mm"]
s.macos.exclude_files = exclude_files
s.macos.exclude_files = exclude_files
s.visionos.exclude_files = exclude_files
s.tvos.exclude_files = exclude_files

Expand All @@ -59,7 +60,8 @@ Pod::Spec.new do |s|
}
s.framework = "UIKit"
s.dependency "DoubleConversion"
s.dependency "fmt", "9.1.0"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "RCT-Folly", folly_version
s.dependency "RCTTypeSafety", version
s.dependency "React-Core/CoreModulesHeaders", version
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native/React/React-RCTFabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]
new_arch_flags = ENV['RCT_NEW_ARCH_ENABLED'] == '1' ? ' -DRCT_NEW_ARCH_ENABLED=1' : ''

header_search_paths = [
"\"$(PODS_TARGET_SRCROOT)/ReactCommon\"",
"\"$(PODS_ROOT)/boost\"",
"\"$(PODS_ROOT)/DoubleConversion\"",
"\"$(PODS_ROOT)/fast_float/include\"",
"\"$(PODS_ROOT)/fmt/include\"",
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/React/third-party.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
// LICENSE file in the root directory of this source tree.
//

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
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
OTHER_CFLAGS = -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1
25 changes: 25 additions & 0 deletions packages/react-native/ReactAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ val prefabHeadersDir = project.file("$buildDir/prefab-headers")
// Native versions which are defined inside the version catalog (libs.versions.toml)
val BOOST_VERSION = libs.versions.boost.get()
val DOUBLE_CONVERSION_VERSION = libs.versions.doubleconversion.get()
val FAST_FLOAT_VERSION = libs.versions.fastFloat.get()
val FMT_VERSION = libs.versions.fmt.get()
val FOLLY_VERSION = libs.versions.folly.get()
val GLOG_VERSION = libs.versions.glog.get()
Expand Down Expand Up @@ -183,6 +184,7 @@ val preparePrefab by
// react_nativemodule_core
Pair(File(buildDir, "third-party-ndk/boost/boost_1_83_0/").absolutePath, ""),
Pair(File(buildDir, "third-party-ndk/double-conversion/").absolutePath, ""),
Pair(File(buildDir, "third-party-ndk/fast_float/include/").absolutePath, ""),
Pair(File(buildDir, "third-party-ndk/fmt/include/").absolutePath, ""),
Pair(File(buildDir, "third-party-ndk/folly/").absolutePath, ""),
Pair(File(buildDir, "third-party-ndk/glog/exported/").absolutePath, ""),
Expand Down Expand Up @@ -312,6 +314,28 @@ val prepareFolly by
into("$thirdPartyNdkDir/folly")
}

val downloadFastFloat by
tasks.creating(Download::class) {
dependsOn(createNativeDepsDirectories)
src("https://github.com/fastfloat/fast_float/archive/v${FAST_FLOAT_VERSION}.tar.gz")
onlyIfModified(true)
overwrite(false)
retries(5)
quiet(true)
dest(File(downloadsDir, "fast_float-${FAST_FLOAT_VERSION}.tar.gz"))
}

val prepareFastFloat by
tasks.registering(Copy::class) {
dependsOn(if (dependenciesPath != null) emptyList() else listOf(downloadFastFloat))
from(dependenciesPath ?: tarTree(downloadFastFloat.dest))
from("src/main/jni/third-party/fast_float/")
include("fast_float-${FAST_FLOAT_VERSION}/include/**/*", "CMakeLists.txt")
eachFile { this.path = this.path.removePrefix("fast_float-${FAST_FLOAT_VERSION}/") }
includeEmptyDirs = false
into("$thirdPartyNdkDir/fast_float")
}

val downloadFmt by
tasks.creating(Download::class) {
dependsOn(createNativeDepsDirectories)
Expand Down Expand Up @@ -549,6 +573,7 @@ android {
"generateCodegenArtifactsFromSchema",
prepareBoost,
prepareDoubleConversion,
prepareFastFloat,
prepareFmt,
prepareFolly,
prepareGlog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ add_library(fbjni ALIAS fbjni::fbjni)
add_react_third_party_ndk_subdir(glog)
add_react_third_party_ndk_subdir(boost)
add_react_third_party_ndk_subdir(double-conversion)
add_react_third_party_ndk_subdir(fast_float)
add_react_third_party_ndk_subdir(fmt)
add_react_third_party_ndk_subdir(folly)
add_react_third_party_ndk_subdir(jsc)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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.

cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(-std=c++20 -fexceptions)

add_library(fast_float INTERFACE)

target_include_directories(fast_float INTERFACE include)
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ SET(folly_FLAGS
SET(folly_runtime_SRC
folly/Conv.cpp
folly/Demangle.cpp
folly/dynamic.cpp
folly/FileUtil.cpp
folly/Format.cpp
folly/json_pointer.cpp
folly/json.cpp
folly/ScopeGuard.cpp
folly/SharedMutex.cpp
folly/String.cpp
Expand All @@ -42,6 +39,9 @@ SET(folly_runtime_SRC
folly/detail/SplitStringSimd.cpp
folly/detail/UniqueInstance.cpp
folly/hash/SpookyHashV2.cpp
folly/json/dynamic.cpp
folly/json/json_pointer.cpp
folly/json/json.cpp
folly/lang/CString.cpp
folly/lang/SafeAssert.cpp
folly/lang/ToAscii.cpp
Expand All @@ -67,4 +67,4 @@ target_compile_options(folly_runtime
target_compile_options(folly_runtime PUBLIC ${folly_FLAGS})

target_include_directories(folly_runtime PUBLIC .)
target_link_libraries(folly_runtime glog double-conversion boost fmt)
target_link_libraries(folly_runtime glog double-conversion boost fmt fast_float)
5 changes: 3 additions & 2 deletions packages/react-native/ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ folly_version = folly_config[:version]
folly_dep_name = folly_config[:dep_name]

boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]
react_native_path = ".."

Pod::Spec.new do |s|
Expand Down Expand Up @@ -54,7 +54,8 @@ Pod::Spec.new do |s|
s.dependency "React-logger"
s.dependency "glog"
s.dependency "DoubleConversion"
s.dependency "fmt", "9.1.0"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "React-Core"
s.dependency "React-debug"
s.dependency "React-featureflags"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ folly_version = folly_config[:version]
folly_dep_name = folly_config[:dep_name]

boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]
react_native_path = ".."

Pod::Spec.new do |s|
Expand All @@ -34,6 +34,7 @@ Pod::Spec.new do |s|
"\"$(PODS_ROOT)/Headers/Private/Yoga\"",
"\"$(PODS_TARGET_SRCROOT)\"",
"\"$(PODS_ROOT)/DoubleConversion\"",
"\"$(PODS_ROOT)/fast_float/include\"",
"\"$(PODS_ROOT)/fmt/include\"",
]

Expand Down Expand Up @@ -75,7 +76,8 @@ Pod::Spec.new do |s|
s.dependency "React-logger"
s.dependency "glog"
s.dependency "DoubleConversion"
s.dependency "fmt", "9.1.0"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "React-Core"
s.dependency "React-debug"
s.dependency "React-featureflags"
Expand Down
6 changes: 4 additions & 2 deletions packages/react-native/ReactCommon/React-FabricImage.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ folly_version = folly_config[:version]
folly_dep_name = folly_config[:dep_name]

boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]
react_native_path = ".."

header_search_path = [
Expand All @@ -31,6 +31,7 @@ header_search_path = [
"\"$(PODS_ROOT)/RCT-Folly\"",
"\"$(PODS_ROOT)/Headers/Private/Yoga\"",
"\"$(PODS_ROOT)/DoubleConversion\"",
"\"$(PODS_ROOT)/fast_float/include\"",
"\"$(PODS_ROOT)/fmt/include\"",
]

Expand Down Expand Up @@ -75,7 +76,8 @@ Pod::Spec.new do |s|
s.dependency "React-logger"
s.dependency "glog"
s.dependency "DoubleConversion"
s.dependency "fmt", "9.1.0"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "React-ImageManager"
s.dependency "React-utils"
s.dependency "Yoga"
Expand Down
7 changes: 4 additions & 3 deletions packages/react-native/ReactCommon/ReactCommon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]
using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"

Pod::Spec.new do |s|
Expand All @@ -35,7 +35,7 @@ Pod::Spec.new do |s|
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)/fmt/include\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
"USE_HEADERMAP" => "YES",
"DEFINES_MODULE" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
Expand All @@ -54,7 +54,8 @@ Pod::Spec.new do |s|
ss.dependency "RCT-Folly", folly_version
ss.dependency "React-logger", version
ss.dependency "DoubleConversion"
ss.dependency "fmt", "9.1.0"
ss.dependency "fast_float", "6.1.4"
ss.dependency "fmt", "11.0.2"
ss.dependency "glog"
if using_hermes
ss.dependency "hermes-engine"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-cxxreact"
Expand All @@ -36,14 +36,15 @@ Pod::Spec.new do |s|
s.exclude_files = "SampleCxxModule.*"
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)/fmt/include\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fas_float/include\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
}
s.header_dir = "cxxreact"

s.dependency "boost"
s.dependency "DoubleConversion"
s.dependency "fmt", "9.1.0"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "RCT-Folly", folly_version
s.dependency "glog"
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/ReactCommon/hermes/React-hermes.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-hermes"
Expand All @@ -47,7 +47,8 @@ Pod::Spec.new do |s|
s.dependency "React-perflogger", version
s.dependency "RCT-Folly", folly_version
s.dependency "DoubleConversion"
s.dependency "fmt", "9.1.0"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "glog"
s.dependency "hermes-engine"
s.dependency "React-jsi"
Expand Down
7 changes: 4 additions & 3 deletions packages/react-native/ReactCommon/jsi/React-jsi.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-jsi"
Expand All @@ -38,12 +38,13 @@ Pod::Spec.new do |s|

s.header_dir = "jsi"
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)/fmt/include\"",
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
"DEFINES_MODULE" => "YES" }

s.dependency "boost"
s.dependency "DoubleConversion"
s.dependency "fmt", "9.1.0"
s.dependency "fast_float", "6.1.4"
s.dependency "fmt", "11.0.2"
s.dependency "RCT-Folly", folly_version
s.dependency "glog"

Expand Down
Loading

0 comments on commit 12718f5

Please sign in to comment.