Skip to content

Commit

Permalink
Make the sample app build for generic iOS Device
Browse files Browse the repository at this point in the history
Summary:
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](react-native-community/upgrade-support#35), it also takes care of this issue.

Reviewed By: passy

Differential Revision: D20897590

fbshipit-source-id: 0891d3d43d37317f5eb439a41fba6b22f7e0a2bc
  • Loading branch information
priteshrnandgaonkar authored and facebook-github-bot committed Apr 8, 2020
1 parent 1a794c5 commit 43d62fc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
5 changes: 2 additions & 3 deletions Flipper.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion FlipperKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions iOS/Podspecs/Flipper-Folly.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -81,14 +83,14 @@ 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++"

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\""
}
Expand Down
6 changes: 3 additions & 3 deletions iOS/Podspecs/Flipper-RSocket.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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/*',
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions iOS/Sample/Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down Expand Up @@ -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)",
Expand Down
4 changes: 4 additions & 0 deletions iOS/SampleSwift/SampleSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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\"",
Expand Down Expand Up @@ -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\"",
Expand Down

0 comments on commit 43d62fc

Please sign in to comment.