From 7c6f8e9147967d3c841b8cd3213bd2d7eb26c9e7 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Wed, 8 Apr 2020 05:01:10 -0700 Subject: [PATCH] Make the sample app build for generic iOS Device (#992) Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/992 Right now our sample app's fail to build when built against "Generic iOS Device", but it built successfully when built against simulator. Reason being all the simulators are 64 bit's, but when built against generic iOS device type, it didn't work for all the architecture as our Flipper and Flipper-Folly pod had 64bit architecture in their settings. But as soon as you build Flipper-Folly for standard architecture, RCU.cpp fails to build as that file is incompatible for lower standard architecture. Got the following error {F233400670} But, we do not need that file of Folly to build Flipper and RSocket. Thus in the podfile I have excluded it from its source. Also along with it I upgraded both Folly and RSocket to the latest releases. Even with this changes i got one more problem, our openssl static library is not bitcode enabled for arm architecture, this error popped up when built against "Generic iOS Device". Right now I have disabled bitcode, the proper fix of this would be to find a dependency of openssl which is bitcode enabled. Its really hard to find the proper cocoapod dependency of openssl which is bitcode enabled. But disabling bitcode is not a big ask, also people will face this error only when they try to publish flipper in their release. I discovered this problem from an issue posted in [RN](https://github.com/react-native-community/upgrade-support/issues/35), it also takes care of this issue. Reviewed By: passy Differential Revision: D20897590 fbshipit-source-id: 8c79d239572bb7efe2d65b2a7f1cfe8c608c1df4 --- Flipper.podspec | 5 ++--- FlipperKit.podspec | 2 +- iOS/Podspecs/Flipper-Folly.podspec | 8 +++++--- iOS/Podspecs/Flipper-RSocket.podspec | 6 +++--- iOS/Sample/Sample.xcodeproj/project.pbxproj | 4 ++++ iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj | 4 ++++ 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Flipper.podspec b/Flipper.podspec index 9cdd1ab4f..49078d3e1 100644 --- a/Flipper.podspec +++ b/Flipper.podspec @@ -17,14 +17,13 @@ Pod::Spec.new do |spec| spec.public_header_files = 'xplat/Flipper/*.h','xplat/utils/*.h' spec.source_files = 'xplat/Flipper/*.{h,cpp,m,mm}','xplat/Flipper/utils/*.{h,cpp,m,mm}' spec.libraries = "stdc++" - spec.dependency 'Flipper-Folly', '~> 2.1' - spec.dependency 'Flipper-RSocket', '~> 1.0' + spec.dependency 'Flipper-Folly', '~> 2.2' + spec.dependency 'Flipper-RSocket', '~> 1.1' spec.compiler_flags = '-DFLIPPER_OSS=1 -DFB_SONARKIT_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0 -Wall -std=c++14 -Wno-global-constructors' spec.platforms = { :ios => "8.0" } spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", - "ARCHS" => "${ARCHS_STANDARD_64_BIT}", "CLANG_CXX_LANGUAGE_STANDARD" => "c++14", "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Flipper-RSocket\" \"$(PODS_ROOT)/Flipper-DoubleConversion\"" } end diff --git a/FlipperKit.podspec b/FlipperKit.podspec index 4d53ee016..f1dc65293 100644 --- a/FlipperKit.podspec +++ b/FlipperKit.podspec @@ -50,7 +50,7 @@ Pod::Spec.new do |spec| spec.subspec 'FBCxxFollyDynamicConvert' do |ss| ss.header_dir = 'FBCxxFollyDynamicConvert' ss.compiler_flags = folly_compiler_flags - ss.dependency 'Flipper-Folly', '~> 2.1' + ss.dependency 'Flipper-Folly', '~> 2.2' ss.source_files = 'iOS/FlipperKit/FBCxxFollyDynamicConvert/**/*.{h,mm}' # We set these files as private headers since they only need to be accessed # by other FlipperKit source files diff --git a/iOS/Podspecs/Flipper-Folly.podspec b/iOS/Podspecs/Flipper-Folly.podspec index 55e17c32d..0504f654f 100644 --- a/iOS/Podspecs/Flipper-Folly.podspec +++ b/iOS/Podspecs/Flipper-Folly.podspec @@ -5,13 +5,13 @@ Pod::Spec.new do |spec| spec.name = 'Flipper-Folly' - spec.version = '2.1.1' + spec.version = '2.2.0' spec.license = { :type => 'Apache License, Version 2.0' } spec.homepage = 'https://github.com/facebook/folly' spec.summary = 'An open-source C++ library developed and used at Facebook.' spec.authors = 'Facebook' spec.source = { :git => 'https://github.com/facebook/folly.git', - :tag => "v2019.03.25.00"} + :tag => "v2020.04.06.00"} spec.module_name = 'folly' spec.dependency 'boost-for-react-native' spec.dependency 'Flipper-Glog' @@ -29,6 +29,7 @@ Pod::Spec.new do |spec| -Wno-comment -Wno-return-type -Wno-global-constructors' + spec.source_files = "folly/*.h", "folly/concurrency/*.h", "folly/container/*.h", @@ -58,6 +59,7 @@ Pod::Spec.new do |spec| "folly/synchronization/detail/*.h", "folly/system/*.h", "folly/tracing/*.h", + "folly/chrono/*.h", "folly/*.cpp", "folly/concurrency/*.cpp", "folly/container/detail/*.cpp", @@ -81,6 +83,7 @@ Pod::Spec.new do |spec| "folly/synchronization/*.cpp", "folly/system/*.cpp" + spec.exclude_files = "folly/synchronization/Rcu.cpp", "folly/synchronization/Rcu.h" spec.header_mappings_dir = 'folly' spec.header_dir = 'folly' spec.libraries = "stdc++" @@ -88,7 +91,6 @@ Pod::Spec.new do |spec| spec.public_header_files = "folly/**/*.h" spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", - "ARCHS" => "${ARCHS_STANDARD_64_BIT}", "CLANG_CXX_LANGUAGE_STANDARD" => "c++11", "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Flipper-DoubleConversion\"" } diff --git a/iOS/Podspecs/Flipper-RSocket.podspec b/iOS/Podspecs/Flipper-RSocket.podspec index 39b6f7220..7e668c789 100644 --- a/iOS/Podspecs/Flipper-RSocket.podspec +++ b/iOS/Podspecs/Flipper-RSocket.podspec @@ -5,12 +5,12 @@ Pod::Spec.new do |spec| spec.name = 'Flipper-RSocket' - spec.version = '1.0.0' + spec.version = '1.1.0' spec.license = { :type => 'MIT' } spec.homepage = 'https://github.com/rsocket/rsocket-cpp' spec.summary = 'C++ implementation of RSocket' spec.authors = 'Facebook' - spec.source = { :git => 'https://github.com/priteshrnandgaonkar/rsocket-cpp.git', :tag => "0.10.4"} + spec.source = { :git => 'https://github.com/priteshrnandgaonkar/rsocket-cpp.git', :tag => "0.11.0"} spec.module_name = 'RSocket' spec.static_framework = true spec.source_files = 'rsocket/benchmarks/*', @@ -25,7 +25,7 @@ Pod::Spec.new do |spec| spec.libraries = "stdc++" spec.compiler_flags = '-std=c++1y' - spec.dependency 'Flipper-Folly', '~> 2.0' + spec.dependency 'Flipper-Folly', '~> 2.2' spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0 -frtti -fexceptions -std=c++14 diff --git a/iOS/Sample/Sample.xcodeproj/project.pbxproj b/iOS/Sample/Sample.xcodeproj/project.pbxproj index 1abe82d3d..3496d633d 100644 --- a/iOS/Sample/Sample.xcodeproj/project.pbxproj +++ b/iOS/Sample/Sample.xcodeproj/project.pbxproj @@ -335,6 +335,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + ENABLE_BITCODE = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", @@ -437,6 +439,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + ENABLE_BITCODE = NO; GCC_NO_COMMON_BLOCKS = YES; HEADER_SEARCH_PATHS = ( "$(inherited)", diff --git a/iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj b/iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj index 2728c4d5c..412a3b157 100644 --- a/iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj +++ b/iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj @@ -332,6 +332,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"", @@ -384,6 +386,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + ENABLE_BITCODE = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"",