Skip to content

Commit

Permalink
Upgrade folly to v2018.10.22.00 for iOS (#21976)
Browse files Browse the repository at this point in the history
Summary:
Fixes #20302 (For iOS)

Note:
------

1. Checked the changes did not break CocoaPods integration.
2. The change for glog copying header into exported/ is to prevent build break for folly.
    `folly/detail/Demangle.h` will try to use libstdc++'s demangle.h. Unfortunately, glog also has a demangle.h in source code. So I copy exported headers and only search headers in exported/ folder during build.
Pull Request resolved: #21976

Reviewed By: hramos

Differential Revision: D12818131

Pulled By: fkgozali

fbshipit-source-id: b3c637d09d1b3adde0ea15c82eb56e28f846885b
  • Loading branch information
Kudo authored and facebook-github-bot committed Oct 29, 2018
1 parent a316dc6 commit a70625a
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 84 deletions.
16 changes: 8 additions & 8 deletions RNTester/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- boost-for-react-native (1.63.0)
- DoubleConversion (1.1.6)
- Folly (2016.10.31.00):
- Folly (2018.10.22.00):
- boost-for-react-native
- DoubleConversion
- glog
Expand All @@ -11,22 +11,22 @@ PODS:
- React/Core (1000.0.0):
- yoga (= 1000.0.0.React)
- React/CxxBridge (1000.0.0):
- Folly (= 2016.10.31.00)
- Folly (= 2018.10.22.00)
- React/Core
- React/cxxreact
- React/jsiexecutor
- React/cxxreact (1000.0.0):
- boost-for-react-native (= 1.63.0)
- Folly (= 2016.10.31.00)
- Folly (= 2018.10.22.00)
- React/jsinspector
- React/DevSupport (1000.0.0):
- React/Core
- React/RCTWebSocket
- React/fishhook (1000.0.0)
- React/jsi (1000.0.0):
- Folly (= 2016.10.31.00)
- Folly (= 2018.10.22.00)
- React/jsiexecutor (1000.0.0):
- Folly (= 2016.10.31.00)
- Folly (= 2018.10.22.00)
- React/cxxreact
- React/jsi
- React/jsinspector (1000.0.0)
Expand Down Expand Up @@ -104,9 +104,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
Folly: c89ac2d5c6ab169cd7397ef27485c44f35f742c7
glog: 848747cb7af3aac910395f03626d7f63636e8ce6
React: 8cb457c5485e7640094a7df86fcdb6d1e56e182c
Folly: cd7933b82a5f7673ed71bafe631f44a575ae77ab
glog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d
React: 9b873b38b92ed8012d7cdf3b965477095ed364c4
yoga: b1ce48b6cf950b98deae82838f5173ea7cf89e85

PODFILE CHECKSUM: 7af77fbc34af9646e8c6389e7e2c0b4663bb16d9
Expand Down
2 changes: 1 addition & 1 deletion React.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else
end

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
folly_version = '2016.10.31.00'
folly_version = '2018.10.22.00'

Pod::Spec.new do |s|
s.name = "React"
Expand Down
196 changes: 126 additions & 70 deletions React/React.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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_63_0 $(SRCROOT)/../third-party/folly-2016.10.31.00 $(SRCROOT)/../third-party/glog-0.3.5/src
HEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_63_0 $(SRCROOT)/../third-party/folly-2018.10.22.00 $(SRCROOT)/../third-party/glog-0.3.5/src
OTHER_CFLAGS = -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1
9 changes: 9 additions & 0 deletions scripts/ios-configure-glog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,12 @@ cat << EOF >> src/config.h
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF

# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"
2 changes: 1 addition & 1 deletion scripts/ios-install-third-party.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ SCRIPTDIR=$(cd $(dirname "$0") && pwd)
fetch_and_unpack glog-0.3.5.tar.gz https://github.com/google/glog/archive/v0.3.5.tar.gz 61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc "\"$SCRIPTDIR/ios-configure-glog.sh\""
fetch_and_unpack double-conversion-1.1.6.tar.gz https://github.com/google/double-conversion/archive/v1.1.6.tar.gz 1c7d88afde3aaeb97bb652776c627b49e132e8e0
fetch_and_unpack boost_1_63_0.tar.gz https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz c3f57e1d22a995e608983effbb752b54b6eab741
fetch_and_unpack folly-2016.10.31.00.tar.gz https://github.com/facebook/folly/archive/v2016.10.31.00.tar.gz fb8cdf8962d8c9d0c20a150b6ec3b75d1fa50696
fetch_and_unpack folly-2018.10.22.00.tar.gz https://github.com/facebook/folly/archive/v2018.10.22.00.tar.gz f70a75bfeb394363d2049a846bba118ffb3b368a
21 changes: 18 additions & 3 deletions third-party-podspecs/Folly.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'Folly'
spec.version = '2016.10.31.00'
spec.version = '2018.10.22.00'
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.'
Expand All @@ -12,18 +12,33 @@ Pod::Spec.new do |spec|
spec.dependency 'DoubleConversion'
spec.dependency 'glog'
spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
spec.source_files = 'folly/Bits.cpp',
spec.source_files = 'folly/String.cpp',
'folly/Conv.cpp',
'folly/Demangle.cpp',
'folly/Format.cpp',
'folly/ScopeGuard.cpp',
'folly/StringBase.cpp',
'folly/Unicode.cpp',
'folly/dynamic.cpp',
'folly/json.cpp',
'folly/json_pointer.cpp',
'folly/container/detail/F14Table.cpp',
'folly/detail/Demangle.cpp',
'folly/hash/SpookyHashV2.cpp',
'folly/lang/Assume.cpp',
'folly/lang/ColdClass.cpp',
'folly/portability/BitsFunctexcept.cpp',
'folly/detail/MallocImpl.cpp'
'folly/memory/detail/MallocImpl.cpp'
# workaround for https://github.com/facebook/react-native/issues/14326
spec.preserve_paths = 'folly/*.h',
'folly/container/*.h',
'folly/container/detail/*.h',
'folly/detail/*.h',
'folly/functional/*.h',
'folly/hash/*.h',
'folly/lang/*.h',
'folly/memory/*.h',
'folly/memory/detail/*.h',
'folly/portability/*.h'
spec.libraries = "stdc++"
spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
Expand Down

0 comments on commit a70625a

Please sign in to comment.