From 3d5324ad890d426b369184c25784a2ee20cff85d Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Mon, 16 Oct 2023 05:10:14 -0700 Subject: [PATCH] Remove unused dependency on Folly Futures (#40862) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/40862 The last usages of Folly Futures were deleted in D49073914, so we can remove this dependency from React Native. ## Changelog: [Internal] - remove folly usage in React-hermes Reviewed By: NickGerleman, cipolleschi Differential Revision: D50223640 fbshipit-source-id: 792fd7696c1463a81e25dbef7713620486cc94c7 --- .../ReactAndroid/src/main/jni/CMakeLists.txt | 1 - .../main/jni/third-party/folly/CMakeLists.txt | 58 ------------------- .../ReactCommon/hermes/React-hermes.podspec | 1 - .../third-party-podspecs/RCT-Folly.podspec | 39 +------------ packages/rn-tester/Podfile.lock | 7 --- 5 files changed, 1 insertion(+), 105 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt index e71987bab94..7161c476beb 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt +++ b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt @@ -190,7 +190,6 @@ add_executable(reactnative_unittest target_link_libraries(reactnative_unittest folly_runtime - folly_futures glog glog_init gtest_main diff --git a/packages/react-native/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt b/packages/react-native/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt index 30773335d6b..9cef8e89963 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +++ b/packages/react-native/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt @@ -68,61 +68,3 @@ target_compile_options(folly_runtime PUBLIC ${folly_FLAGS}) target_include_directories(folly_runtime PUBLIC .) target_link_libraries(folly_runtime glog double-conversion boost fmt) - -##################### -### folly_futures ### -##################### - -add_library(folly_futures STATIC - folly/CancellationToken.cpp - folly/ExceptionWrapper.cpp - folly/ExceptionString.cpp - folly/Executor.cpp - folly/Singleton.cpp - folly/SingletonThreadLocal.cpp - folly/Try.cpp - folly/concurrency/CacheLocality.cpp - folly/detail/AsyncTrace.cpp - folly/detail/MemoryIdler.cpp - folly/detail/ThreadLocalDetail.cpp - folly/fibers/Baton.cpp - folly/fibers/FiberManager.cpp - folly/fibers/Fiber.cpp - folly/fibers/GuardPageAllocator.cpp - folly/futures/detail/Core.cpp - folly/futures/Future.cpp - folly/futures/ThreadWheelTimekeeper.cpp - folly/executors/ExecutorWithPriority.cpp - folly/executors/InlineExecutor.cpp - folly/executors/TimedDrivableExecutor.cpp - folly/executors/QueuedImmediateExecutor.cpp - folly/io/async/AsyncTimeout.cpp - folly/io/async/EventBase.cpp - folly/io/async/EventBaseBackendBase.cpp - folly/io/async/EventBaseLocal.cpp - folly/io/async/EventHandler.cpp - folly/io/async/HHWheelTimer.cpp - folly/io/async/Request.cpp - folly/io/async/TimeoutManager.cpp - folly/io/async/VirtualEventBase.cpp - folly/lang/Exception.cpp - folly/lang/UncaughtExceptions.cpp - folly/memory/MallctlHelper.cpp - folly/memory/ReentrantAllocator.cpp - folly/portability/SysMembarrier.cpp - folly/synchronization/AsymmetricThreadFence.cpp - folly/synchronization/Hazptr.cpp - folly/synchronization/WaitOptions.cpp - folly/synchronization/detail/Sleeper.cpp - folly/system/Pid.cpp) - -target_compile_options(folly_futures - PRIVATE - -fexceptions - -fno-omit-frame-pointer - -frtti - -Wno-sign-compare - -Wno-unused-variable) - -target_include_directories(folly_futures PUBLIC .) -target_link_libraries(folly_futures glog double-conversion folly_runtime boost event fmt) diff --git a/packages/react-native/ReactCommon/hermes/React-hermes.podspec b/packages/react-native/ReactCommon/hermes/React-hermes.podspec index a60908fc5d5..d913696d070 100644 --- a/packages/react-native/ReactCommon/hermes/React-hermes.podspec +++ b/packages/react-native/ReactCommon/hermes/React-hermes.podspec @@ -47,7 +47,6 @@ Pod::Spec.new do |s| s.dependency "DoubleConversion" s.dependency "fmt", "9.1.0" s.dependency "glog" - s.dependency "RCT-Folly/Futures", folly_version s.dependency "hermes-engine" s.dependency "React-jsi" end diff --git a/packages/react-native/third-party-podspecs/RCT-Folly.podspec b/packages/react-native/third-party-podspecs/RCT-Folly.podspec index a96f25ab1f1..f3d69758c57 100644 --- a/packages/react-native/third-party-podspecs/RCT-Folly.podspec +++ b/packages/react-native/third-party-podspecs/RCT-Folly.podspec @@ -80,7 +80,7 @@ Pod::Spec.new do |spec| spec.libraries = "c++abi" # NOTE Apple-only: Keep c++abi here due to https://github.com/react-native-community/releases/issues/251 spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_ROOT)/libevent/include/\"", + "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"", # In dynamic framework (use_frameworks!) mode, ignore the unused and undefined boost symbols when generating the library. "OTHER_LDFLAGS" => "\"-Wl,-U,_jump_fcontext\" \"-Wl,-U,_make_fcontext\"" } @@ -109,43 +109,6 @@ Pod::Spec.new do |spec| 'folly/system/ThreadId.h' end - spec.subspec 'Futures' do |futures| - futures.dependency 'libevent' - futures.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => ["$(inherited)", "$(PODS_ROOT)/Headers/Public/libevent/event"] } - futures.source_files = 'folly/{CancellationToken,ExceptionString,ExceptionWrapper,ExceptionWrapper-inl,Executor,Singleton,SingletonThreadLocal,SharedMutex,Try}.{h,cpp}', - 'folly/chrono/Hardware.{h,cpp}', - 'folly/concurrency/*.{h,cpp}', - 'folly/detail/{AsyncTrace,Futex,Futex-inl,MemoryIdler,SingletonStackTrace,StaticSingletonManager,ThreadLocalDetail}.{h,cpp}', - 'folly/executors/*.{h,cpp}', - 'folly/executors/task_queue/*.{h,cpp}', - 'folly/executors/thread_factory/{NamedThreadFactory,ThreadFactory}.{h,cpp}', - 'folly/experimental/{ExecutionObserver,ReadMostlySharedPtr,SingleWriterFixedHashMap,TLRefCount}.{h,cpp}', - 'folly/experimental/**/*.h', - 'folly/experimental/coro/Coroutine.{h,cpp}', - 'folly/experimental/coro/Traits.{h,cpp}', - 'folly/fibers/*.{h,cpp}', - 'folly/futures/*.{h,cpp}', - 'folly/futures/detail/*.{h,cpp}', - 'folly/io/{Cursor,Cursor-inl,IOBuf,IOBufQueue}.{h,cpp}', - 'folly/io/async/{AtomicNotificationQueue,AtomicNotificationQueue-inl,AsyncTimeout,DelayedDestruction,DelayedDestructionBase,EventBase,EventBaseLocal,EventBaseManager,EventBaseAtomicNotificationQueue,EventBaseAtomicNotificationQueue-inl,EventBaseBackendBase,EventHandler,EventUtil,HHWheelTimer,HHWheelTimer-fwd,NotificationQueue,Request,TimeoutManager,VirtualEventBase}.{h,cpp}', - 'folly/lang/{SafeAssert,UncaughtExceptions}.{h,cpp}', - 'folly/memory/{MallctlHelper,ReentrantAllocator,SanitizeAddress}.{h,cpp}', - 'folly/portability/{GFlags,SysMembarrier,SysUio}.{h,cpp}', - 'folly/synchronization/*.{h,cpp}', - 'folly/synchronization/detail/*.{h,cpp}', - 'folly/system/{Pid,ThreadId,ThreadName,HardwareConcurrency}.{h,cpp}', - 'folly/tracing/{AsyncStack,AsyncStack-inl,StaticTracepoint}.{h,cpp}' - # TODO: Perhaps some of the wildcards above can be further trimmed down with some of these: - # - # 'folly/executors/{DrivableExecutor,InlineExecutor,QueuedImmediateExecutor,TimedDrivableExecutor}.{h,cpp}', - # 'folly/concurrency/{CacheLocality,UnboundedQueue}.{h,cpp}', - # 'folly/system/ThreadId.h', - # 'folly/synchronization/Hazptr{,-fwd,Domain,Holder,Obj,ObjLinked,Rec,ThrLocal}.{h,cpp}', - # 'folly/synchronization/{AsymmetricMemoryBarrier,AtomicStruct,Baton,MicroSpinLock,ParkingLot,RWSpinLock,SanitizeThread,SaturatingSemaphore,WaitOptions}.{h,cpp}', - # 'folly/synchronization/detail/{AtomicUtils,Sleeper,Spin}.{h,cpp}', - # 'folly/experimental/{ReadMostlySharedPtr,TLRefCount}.h', - end - # Folly has issues when compiled with iOS 10 set as deployment target # See https://github.com/facebook/folly/issues/1470 for details spec.platforms = min_supported_versions diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 24e5f8f1184..fa68cf7128c 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -96,12 +96,6 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - RCT-Folly/Futures (2023.08.07.00): - - boost - - DoubleConversion - - fmt (= 9.1.0) - - glog - - libevent - RCTRequired (1000.0.0) - RCTTypeSafety (1000.0.0): - FBLazyVector (= 1000.0.0) @@ -927,7 +921,6 @@ PODS: - glog - hermes-engine - RCT-Folly (= 2023.08.07.00) - - RCT-Folly/Futures (= 2023.08.07.00) - React-cxxreact (= 1000.0.0) - React-jsi - React-jsiexecutor (= 1000.0.0)