From b56c1f37dcdfc0bf9e81ddf17ed0e82e55dc2f35 Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Thu, 7 Apr 2022 04:50:30 -0700 Subject: [PATCH] Bump boost for Android to 1.76 to align with iOS + fix (#33565) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: The reason why I'm working on this is to reduce the delta between this and the react-native-macos fork, in particular with the android patch folder "Build": https://github.com/microsoft/react-native-macos/tree/main/android-patches/patches/Build (it's a long story) While checking the changes in there, I noticed that one of them was a bump of boost. Looking back into main (here), I then noticed that there have been two bumps to boot in the repo so far: * a combo update 5 years ago to 1.63: * https://github.com/facebook/react-native/commit/193afff92620621b5f2ca2702acf06de0b5090ec * https://github.com/facebook/react-native/commit/5c24a9110aa1602430eff199d05421e2eb660416 * and an update for the iOS side to 1.76 by Kudo last year: https://github.com/facebook/react-native/pull/31840 So this quickly turned into this: the PR wants to re-align the version of boost used in both iOS and Android. I explored the option of bumping both to 1.78 (latest at the time of writing: https://www.boost.org/users/history/version_1_78_0.html) but then I noticed that there's a Flipper dependency, `Flipper-Boost-iOSX`, on the iOS pods side that has been released only once and it seems to imply that it's 1.76 only compatible https://github.com/priteshrnandgaonkar/Flipper-Boost-iOSX/releases/tag/1.76.0.1.11. So going to 1.78 at least for now seems like a no-go, and I've settled for just aligning everything to 1.76 and just like iOS, move away from `boost-for-react-native` in favour of the original one. While doing so, I also noticed that the `React/third-party.xcconfig` still had a reference to 1.68 instead of 1.76 which seems like a leftover from Kudo's PR... it's probably because it was not doing anything in the first place, so lmk if you want me to delete it. ## Changelog [Android] [Changed] - Bump boost for Android to 1.76 to align with iOS Pull Request resolved: https://github.com/facebook/react-native/pull/33565 Test Plan: CI is green (aside an unrelated ios rntester job that is also broken on main) ✅ Locally both RNTester and new app work: Screenshot 2022-04-05 at 16 42 31 Screenshot 2022-04-05 at 18 06 01 Reviewed By: sshic Differential Revision: D35433032 Pulled By: cortinico fbshipit-source-id: 0d93f61f8c26eda1dd04127a8b20e799ab6828cb --- React/third-party.xcconfig | 2 +- ReactAndroid/Android-prebuilt.mk | 2 +- ReactAndroid/build.gradle | 4 ++-- ReactAndroid/gradle.properties | 2 +- ReactAndroid/src/main/jni/third-party/boost/Android.mk | 4 ++-- ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/React/third-party.xcconfig b/React/third-party.xcconfig index 63c2bcd93a9e00..7850a61a03f54d 100644 --- a/React/third-party.xcconfig +++ b/React/third-party.xcconfig @@ -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-2021.06.28.00 $(SRCROOT)/../third-party/glog-0.3.5/src +HEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_76_0 $(SRCROOT)/../third-party/folly-2021.06.28.00 $(SRCROOT)/../third-party/glog-0.3.5/src OTHER_CFLAGS = -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 diff --git a/ReactAndroid/Android-prebuilt.mk b/ReactAndroid/Android-prebuilt.mk index d7d0d593e95f30..269cf0ac0aa522 100644 --- a/ReactAndroid/Android-prebuilt.mk +++ b/ReactAndroid/Android-prebuilt.mk @@ -34,7 +34,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := folly_runtime LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libfolly_runtime.so LOCAL_EXPORT_C_INCLUDES := \ - $(THIRD_PARTY_NDK_DIR)/boost/boost_1_63_0 \ + $(THIRD_PARTY_NDK_DIR)/boost/boost_1_76_0 \ $(THIRD_PARTY_NDK_DIR)/double-conversion \ $(THIRD_PARTY_NDK_DIR)/folly # Note: Sync with folly/Android.mk. diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 993643d3468966..41f7a3ce8be411 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -32,7 +32,7 @@ def thirdPartyNdkDir = new File("$buildDir/third-party-ndk") def reactNativeRootDir = projectDir.parent // You need to have following folders in this directory: -// - boost_1_63_0 +// - boost_1_76_0 // - double-conversion-1.1.6 // - folly-deprecate-dynamic-initializer // - glog-0.3.5 @@ -56,7 +56,7 @@ task createNativeDepsDirectories { } task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) { - src("https://github.com/react-native-community/boost-for-react-native/releases/download/v${BOOST_VERSION.replace("_", ".")}-0/boost_${BOOST_VERSION}.tar.gz") + src("https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION.replace("_", ".")}/source/boost_${BOOST_VERSION}.tar.gz") onlyIfNewer(true) overwrite(false) dest(new File(downloadsDir, "boost_${BOOST_VERSION}.tar.gz")) diff --git a/ReactAndroid/gradle.properties b/ReactAndroid/gradle.properties index 6360eefd6b650b..b93514dfb511f0 100644 --- a/ReactAndroid/gradle.properties +++ b/ReactAndroid/gradle.properties @@ -16,7 +16,7 @@ FRESCO_VERSION=2.5.0 OKHTTP_VERSION=4.9.2 SO_LOADER_VERSION=0.10.3 -BOOST_VERSION=1_63_0 +BOOST_VERSION=1_76_0 DOUBLE_CONVERSION_VERSION=1.1.6 FOLLY_VERSION=2021.06.28.00 FMT_VERSION=6.2.1 diff --git a/ReactAndroid/src/main/jni/third-party/boost/Android.mk b/ReactAndroid/src/main/jni/third-party/boost/Android.mk index 7e888b7bb84574..032f8a8b3fc9fc 100644 --- a/ReactAndroid/src/main/jni/third-party/boost/Android.mk +++ b/ReactAndroid/src/main/jni/third-party/boost/Android.mk @@ -6,8 +6,8 @@ include $(CLEAR_VARS) # They are required for Folly futures to compile successfully. LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/asm/$(TARGET_ARCH_ABI)/*.S) -LOCAL_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0 -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/boost_1_76_0 +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/boost_1_76_0 LOCAL_MODULE := boost diff --git a/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt index 19f8786245355a..3d0cbec7e50956 100644 --- a/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt @@ -18,5 +18,5 @@ add_library(boost STATIC ${boostasm_SRC}) set_target_properties(boost PROPERTIES LINKER_LANGUAGE CXX) -target_include_directories(boost PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost_1_63_0) +target_include_directories(boost PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost_1_76_0)