From d1124f44edec642407d73e62f6a8e2b08a313590 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 11 Apr 2022 10:26:42 -0700 Subject: [PATCH 01/10] Initial removal of GNUSTL, doesn't change directory. --- .github/workflows/cpp-packaging.yml | 2 +- app/src/include/firebase/app.h | 5 ----- build_scripts/android/build.sh | 6 +++--- build_scripts/android/package.sh | 2 +- build_scripts/desktop/get_variant.sh | 3 --- release_build_files/readme.md | 10 +++++++--- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index 48604ecbee..d4da29c8ed 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -243,7 +243,7 @@ jobs: strategy: fail-fast: false matrix: - stl: ["c++", "gnustl"] + stl: ["c++"] steps: - name: fetch SDK uses: actions/checkout@v2.3.1 diff --git a/app/src/include/firebase/app.h b/app/src/include/firebase/app.h index 1758703391..6b81bc42ed 100644 --- a/app/src/include/firebase/app.h +++ b/app/src/include/firebase/app.h @@ -50,11 +50,6 @@ namespace internal { class AppInternal; } // namespace internal -#if FIREBASE_PLATFORM_ANDROID && defined(__GLIBCXX__) -#warning \ - "Firebase support for gnustl is deprecated and will be removed in the next major release. Please use libc++ instead." -#endif - /// @brief Reports whether a Firebase module initialized successfully. enum InitResult { /// The given library was successfully initialized. diff --git a/build_scripts/android/build.sh b/build_scripts/android/build.sh index f2373e3ea9..3e43c54c16 100755 --- a/build_scripts/android/build.sh +++ b/build_scripts/android/build.sh @@ -7,7 +7,7 @@ sourcepath=$2 stl=$3 if [[ -z "${buildpath}" || -z "${sourcepath}" ]]; then - echo "Usage: $0 [c++|gnustl]" + echo "Usage: $0 [c++]" exit 1 fi @@ -16,11 +16,11 @@ if [[ ! -d "${sourcepath}" ]]; then exit 2 fi -if [[ "${stl}" == "c++" || "${stl}" == "gnustl" ]]; then +if [[ "${stl}" == "c++" ]]; then export FIREBASE_ANDROID_STL="${stl}"_static elif [[ ! -z "${stl}" ]]; then echo "Invalid STL specified." - echo "Valid STLs are: 'c++' (default) or 'gnustl'" + echo "Valid STLs are: 'c++' (default)" exit 2 fi diff --git a/build_scripts/android/package.sh b/build_scripts/android/package.sh index 220e6181ed..5761c82857 100755 --- a/build_scripts/android/package.sh +++ b/build_scripts/android/package.sh @@ -2,7 +2,7 @@ # Copyright 2020 Google LLC -readonly -a allowed_stl_variants=("c++" "gnustl") +readonly -a allowed_stl_variants=("c++") builtpath=$1 packagepath=$2 stl=$3 diff --git a/build_scripts/desktop/get_variant.sh b/build_scripts/desktop/get_variant.sh index 981dbffaf3..9f5bf1254a 100755 --- a/build_scripts/desktop/get_variant.sh +++ b/build_scripts/desktop/get_variant.sh @@ -124,9 +124,6 @@ for c in $(echo "${filename}" | tr "[:upper:]" "[:lower:]" | tr "_.-" "\n\n\n"); c++) stl=c++ ;; - gnustl) - stl=gnustl - ;; cxx11) linux_abi=cxx11 ;; diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 7e51e3b9a7..cdaea1c600 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -53,9 +53,8 @@ libs/ios/ARCH | iOS static libraries (compiled against libs/android/ARCH/STL | Android (GCC 4.8+ compatible) static | | libraries for each architecture and STL | | variant. -| | _STL variants available:_ +| | _STL variant available:_ | | * `c++`: LLVM libc++ runtime (recommended) -| | * `gnustl`: GNU STL (deprecated) | | More information can be found in the | | [NDK C++ Helper Runtimes](https://developer.android.com/ndk/guides/cpp-support.html#runtimes) | | documentation. @@ -567,7 +566,12 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes -### Upcoming Release +### 9.0.0 +- Changes + - General (Android): Firebase support for gnustl (also known as libstdc++) + has been removed. Please use libc++ instead. + +### 8.11.0 - Changes - Firestore/Database (Desktop): Upgrade LevelDb dependency to 1.23 ([#886](https://github.com/firebase/firebase-cpp-sdk/pull/886)). From 9f325d22d8ed0babe580b55b3e47bc497b9cf3a5 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 11 Apr 2022 10:44:13 -0700 Subject: [PATCH 02/10] Change NDK we build with to r21e. --- build_scripts/android/build.sh | 30 ++++++-------- build_scripts/android/install_prereqs.sh | 50 ++++++++++++------------ release_build_files/readme.md | 2 + 3 files changed, 39 insertions(+), 43 deletions(-) diff --git a/build_scripts/android/build.sh b/build_scripts/android/build.sh index 3e43c54c16..c88559fabb 100755 --- a/build_scripts/android/build.sh +++ b/build_scripts/android/build.sh @@ -36,21 +36,15 @@ absbuildpath=$( pwd -P ) cd "${origpath}" # If NDK_ROOT is not set or is the wrong version, use to the version in /tmp. -if [[ -z "${NDK_ROOT}" || ! $(grep -q "Pkg\.Revision = 16\." "${NDK_ROOT}/source.properties") ]]; then - if [[ ! -d /tmp/android-ndk-r16b ]]; then - echo "Recommended NDK version r16b not present in /tmp." - if [[ ! -z "${stl}" ]]; then - echo "STL may only be specified if using the recommended NDK version." - echo "Please run install_prereqs.sh script and try again." - exit 2 - else - echo "Please run install_prereqs.sh if you wish to use the recommended NDK version." - echo "Continuing with default NDK..." - sleep 2 - fi +if [[ -z "${NDK_ROOT}" || ! $(grep -q "Pkg\.Revision = 21\." "${NDK_ROOT}/source.properties") ]]; then + if [[ ! -d /tmp/android-ndk-r21e ]]; then + echo "Recommended NDK version r21e not present in /tmp." + echo "Please run install_prereqs.sh if you wish to use the recommended NDK version." + echo "Continuing with default NDK..." + sleep 2 fi - export NDK_ROOT=/tmp/android-ndk-r16b - export ANDROID_NDK_HOME=/tmp/android-ndk-r16b + export NDK_ROOT=/tmp/android-ndk-r21e + export ANDROID_NDK_HOME=/tmp/android-ndk-r21e fi cd "${sourcepath}" set +e @@ -72,16 +66,16 @@ set -e declare -a paths for lib in *; do if [[ -d "${lib}/build" ]]; then - paths+=("${lib}/build") + paths+=("${lib}/build") fi if [[ -d "${lib}/.externalNativeBuild" ]]; then - paths+=("${lib}/.externalNativeBuild") + paths+=("${lib}/.externalNativeBuild") fi if [[ -d "${lib}/${lib}_resources/build" ]]; then - paths+=("${lib}/${lib}_resources/build") + paths+=("${lib}/${lib}_resources/build") fi if [[ -d "${lib}/${lib}_java/build" ]]; then - paths+=("${lib}/${lib}_java/build") + paths+=("${lib}/${lib}_java/build") fi done set -x diff --git a/build_scripts/android/install_prereqs.sh b/build_scripts/android/install_prereqs.sh index ffc601da2d..6bb0f19d7e 100755 --- a/build_scripts/android/install_prereqs.sh +++ b/build_scripts/android/install_prereqs.sh @@ -21,11 +21,11 @@ else # Retry up to 10 times because Curl has a tendency to timeout on # Github runners. for retry in {1..10} error; do - if [[ $retry == "error" ]]; then exit 5; fi - curl -LSs \ + if [[ $retry == "error" ]]; then exit 5; fi + curl -LSs \ "https://download.sysinternals.com/files/Strings.zip" \ --output Strings.zip && break - sleep 300 + sleep 300 done set -e unzip -q Strings.zip && rm -f Strings.zip @@ -60,29 +60,29 @@ if [[ -z "${ANDROID_HOME}" ]]; then exit 1 fi -if [[ -z "${NDK_ROOT}" || -z $(grep "Pkg\.Revision = 16\." "${NDK_ROOT}/source.properties") ]]; then - if [[ -d /tmp/android-ndk-r16b && \ - -n $(grep "Pkg\.Revision = 16\." "/tmp/android-ndk-r16b/source.properties") ]]; then - echo "Using NDK r16b in /tmp/android-ndk-r16b". +if [[ -z "${NDK_ROOT}" || -z $(grep "Pkg\.Revision = 21\." "${NDK_ROOT}/source.properties") ]]; then + if [[ -d /tmp/android-ndk-r21e && \ + -n $(grep "Pkg\.Revision = 21\." "/tmp/android-ndk-r21e/source.properties") ]]; then + echo "Using NDK r21e in /tmp/android-ndk-r21e". else echo "NDK_ROOT environment variable is not set, or NDK version is incorrect." - echo "This build requires NDK r16b for STLPort compatibility, downloading..." - if [[ -z $(which curl) ]]; then - echo "Error, could not run 'curl' to download NDK. Is it in your PATH?" - exit 1 - fi - set +e - # Retry up to 10 times because Curl has a tendency to timeout on - # Github runners. - for retry in {1..10} error; do - if [[ $retry == "error" ]]; then exit 5; fi - curl --http1.1 -LSs \ - "https://dl.google.com/android/repository/android-ndk-r16b-${platform}-x86_64.zip" \ - --output /tmp/android-ndk-r16b.zip && break - sleep 300 - done - set -e - (cd /tmp && unzip -oq android-ndk-r16b.zip && rm -f android-ndk-r16b.zip) - echo "NDK r16b has been downloaded into /tmp/android-ndk-r16b" + echo "This build recommends NDK r21e, downloading..." + if [[ -z $(which curl) ]]; then + echo "Error, could not run 'curl' to download NDK. Is it in your PATH?" + exit 1 + fi + set +e + # Retry up to 10 times because Curl has a tendency to timeout on + # Github runners. + for retry in {1..10} error; do + if [[ $retry == "error" ]]; then exit 5; fi + curl --http1.1 -LSs \ + "https://dl.google.com/android/repository/android-ndk-r21e-${platform}-x86_64.zip" \ + --output /tmp/android-ndk-r21e.zip && break + sleep 300 + done + set -e + (cd /tmp && unzip -oq android-ndk-r21e.zip && rm -f android-ndk-r21e.zip) + echo "NDK r21e has been downloaded into /tmp/android-ndk-r21e" fi fi diff --git a/release_build_files/readme.md b/release_build_files/readme.md index cdaea1c600..0edb21e248 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -568,6 +568,8 @@ code. ## Release Notes ### 9.0.0 - Changes + - General (Android): On Android, Firebase C++ is now built against NDK + version r21e. - General (Android): Firebase support for gnustl (also known as libstdc++) has been removed. Please use libc++ instead. From fab0033f0f61fbd25167808aa21a6e59473d991a Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Wed, 20 Apr 2022 11:45:35 -0700 Subject: [PATCH 03/10] Change cached NDK from r16b to r21e. --- .github/workflows/android.yml | 10 +++++----- .github/workflows/cpp-packaging.yml | 4 ++-- .github/workflows/integration_tests.yml | 4 ++-- external/vcpkg | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b15871c789..a62c9b5e4d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -92,18 +92,18 @@ jobs: id: cache_ndk uses: actions/cache@v2 with: - path: /tmp/android-ndk-r16b - key: android-ndk-${{ matrix.os }}-r16b + path: /tmp/android-ndk-r21e + key: android-ndk-${{ matrix.os }}-r21e - name: Check cached NDK shell: bash if: steps.cache_ndk.outputs.cache-hit != 'true' run: | # If the NDK failed to download from the cache, but there is a - # /tmp/android-ndk-r16b directory, it's incomplete, so remove it. - if [[ -d "/tmp/android-ndk-r16b" ]]; then + # /tmp/android-ndk-r21e directory, it's incomplete, so remove it. + if [[ -d "/tmp/android-ndk-r21e" ]]; then echo "Removing incomplete download of NDK" - rm -rf /tmp/android-ndk-r16b + rm -rf /tmp/android-ndk-r21e fi - name: Update homebrew (avoid bintray errors) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index d4da29c8ed..bcdb08fe91 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -261,8 +261,8 @@ jobs: id: cache_ndk uses: actions/cache@v2 with: - path: /tmp/android-ndk-r16b - key: android-ndk-${{ matrix.os }}-r16b + path: /tmp/android-ndk-r21e + key: android-ndk-${{ matrix.os }}-r21e - name: install prerequisites run: sdk-src/build_scripts/android/install_prereqs.sh diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 5460f63d34..a42a4e8680 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -433,8 +433,8 @@ jobs: id: cache_ndk uses: actions/cache@v2 with: - path: /tmp/android-ndk-r16b - key: android-ndk-${{ matrix.os }}-r16b + path: /tmp/android-ndk-r21e + key: android-ndk-${{ matrix.os }}-r21e - name: Setup python uses: actions/setup-python@v2 with: diff --git a/external/vcpkg b/external/vcpkg index 773516ecf6..5293c8685a 160000 --- a/external/vcpkg +++ b/external/vcpkg @@ -1 +1 @@ -Subproject commit 773516ecf6014d89cc69b11bb54605ad4be56694 +Subproject commit 5293c8685a9d1b880a334b40a40a73ee667a294f From 0ab848c2594c179819ac4d99e5f6bb0a848065a4 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Fri, 22 Apr 2022 17:55:33 -0700 Subject: [PATCH 04/10] Change all NDK cache paths from r16b to r21e to reflect updated version. --- .github/workflows/android.yml | 10 +++++----- .github/workflows/cpp-packaging.yml | 4 ++-- .github/workflows/integration_tests.yml | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b15871c789..a62c9b5e4d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -92,18 +92,18 @@ jobs: id: cache_ndk uses: actions/cache@v2 with: - path: /tmp/android-ndk-r16b - key: android-ndk-${{ matrix.os }}-r16b + path: /tmp/android-ndk-r21e + key: android-ndk-${{ matrix.os }}-r21e - name: Check cached NDK shell: bash if: steps.cache_ndk.outputs.cache-hit != 'true' run: | # If the NDK failed to download from the cache, but there is a - # /tmp/android-ndk-r16b directory, it's incomplete, so remove it. - if [[ -d "/tmp/android-ndk-r16b" ]]; then + # /tmp/android-ndk-r21e directory, it's incomplete, so remove it. + if [[ -d "/tmp/android-ndk-r21e" ]]; then echo "Removing incomplete download of NDK" - rm -rf /tmp/android-ndk-r16b + rm -rf /tmp/android-ndk-r21e fi - name: Update homebrew (avoid bintray errors) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index 48604ecbee..ec1d1a37af 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -261,8 +261,8 @@ jobs: id: cache_ndk uses: actions/cache@v2 with: - path: /tmp/android-ndk-r16b - key: android-ndk-${{ matrix.os }}-r16b + path: /tmp/android-ndk-r21e + key: android-ndk-${{ runner.os }}-r21e - name: install prerequisites run: sdk-src/build_scripts/android/install_prereqs.sh diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 5460f63d34..a42a4e8680 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -433,8 +433,8 @@ jobs: id: cache_ndk uses: actions/cache@v2 with: - path: /tmp/android-ndk-r16b - key: android-ndk-${{ matrix.os }}-r16b + path: /tmp/android-ndk-r21e + key: android-ndk-${{ matrix.os }}-r21e - name: Setup python uses: actions/setup-python@v2 with: From 6a2cdbc1cfe5aa2f51c9ac0ce980549269fd6dcd Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 2 May 2022 16:21:38 -0700 Subject: [PATCH 05/10] Remove "recommended" text for required STL variant. --- external/vcpkg | 2 +- release_build_files/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/vcpkg b/external/vcpkg index 5293c8685a..773516ecf6 160000 --- a/external/vcpkg +++ b/external/vcpkg @@ -1 +1 @@ -Subproject commit 5293c8685a9d1b880a334b40a40a73ee667a294f +Subproject commit 773516ecf6014d89cc69b11bb54605ad4be56694 diff --git a/release_build_files/readme.md b/release_build_files/readme.md index eae8828ec8..1dce92d55e 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -54,7 +54,7 @@ libs/android/ARCH/STL | Android (GCC 4.8+ compatible) static | | libraries for each architecture and STL | | variant. | | _STL variant available:_ -| | * `c++`: LLVM libc++ runtime (recommended) +| | * `c++`: LLVM libc++ runtime | | More information can be found in the | | [NDK C++ Helper Runtimes](https://developer.android.com/ndk/guides/cpp-support.html#runtimes) | | documentation. From 85f527cb9a1ebd2d07e31b5e3611b3f9cdf94631 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 2 May 2022 16:34:07 -0700 Subject: [PATCH 06/10] Remove "stl" directory from the Android library path component. --- .github/workflows/cpp-packaging.yml | 16 +++++++--------- build_scripts/android/build.sh | 11 +++-------- build_scripts/android/package.sh | 16 ++++------------ build_scripts/desktop/get_variant.sh | 4 ++-- release_build_files/readme.md | 8 +++----- 5 files changed, 19 insertions(+), 36 deletions(-) diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index 7440a7934d..8ef02e6dae 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -237,13 +237,11 @@ jobs: path: firebase-cpp-sdk-ios-tvos-package.tgz build_and_package_android: - name: build-and-package-android-${{matrix.stl}} + name: build-and-package-android runs-on: ubuntu-latest if: ${{ github.event.inputs.downloadPublicVersion == '' && github.event.inputs.downloadPreviousRun == '' }} strategy: fail-fast: false - matrix: - stl: ["c++"] steps: - name: fetch SDK uses: actions/checkout@v2.3.1 @@ -269,10 +267,10 @@ jobs: - name: build sdk run: | - sdk-src/build_scripts/android/build.sh firebase-cpp-sdk-android-${{ matrix.stl }}-build sdk-src ${{ matrix.stl }} - sdk-src/build_scripts/android/package.sh firebase-cpp-sdk-android-${{ matrix.stl }}-build firebase-cpp-sdk-android-${{ matrix.stl }}-package ${{ matrix.stl }} - cd firebase-cpp-sdk-android-${{ matrix.stl }}-package - tar -czhf ../firebase-cpp-sdk-android-${{ matrix.stl}}-package.tgz . + sdk-src/build_scripts/android/build.sh firebase-cpp-sdk-android-build sdk-src + sdk-src/build_scripts/android/package.sh firebase-cpp-sdk-android-build firebase-cpp-sdk-android-package + cd firebase-cpp-sdk-android-package + tar -czhf ../firebase-cpp-sdk-android-package.tgz . - name: Print built libraries shell: bash @@ -292,8 +290,8 @@ jobs: - name: upload artifacts uses: actions/upload-artifact@v2.2.2 with: - name: firebase-cpp-sdk-android-${{ matrix.stl }}-package - path: firebase-cpp-sdk-android-${{ matrix.stl }}-package.tgz + name: firebase-cpp-sdk-android-package + path: firebase-cpp-sdk-android-package.tgz build_desktop: name: build-${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }} diff --git a/build_scripts/android/build.sh b/build_scripts/android/build.sh index c88559fabb..f23f02b40d 100755 --- a/build_scripts/android/build.sh +++ b/build_scripts/android/build.sh @@ -4,7 +4,6 @@ buildpath=$1 sourcepath=$2 -stl=$3 if [[ -z "${buildpath}" || -z "${sourcepath}" ]]; then echo "Usage: $0 [c++]" @@ -16,13 +15,9 @@ if [[ ! -d "${sourcepath}" ]]; then exit 2 fi -if [[ "${stl}" == "c++" ]]; then - export FIREBASE_ANDROID_STL="${stl}"_static -elif [[ ! -z "${stl}" ]]; then - echo "Invalid STL specified." - echo "Valid STLs are: 'c++' (default)" - exit 2 -fi +# Force libc++ STL. This should be the NDK's default, but specify it here +# just to be sure. +export FIREBASE_ANDROID_STL=c++_static origpath=$( pwd -P ) diff --git a/build_scripts/android/package.sh b/build_scripts/android/package.sh index 5761c82857..e1b90e12b0 100755 --- a/build_scripts/android/package.sh +++ b/build_scripts/android/package.sh @@ -2,22 +2,14 @@ # Copyright 2020 Google LLC -readonly -a allowed_stl_variants=("c++") builtpath=$1 packagepath=$2 -stl=$3 -if [[ -z "${builtpath}" || -z "${packagepath}" || -z "${stl}" ]]; then - echo "Usage: $0 " - echo "STL variant is one of: ${allowed_stl_variants[*]}" +if [[ -z "${builtpath}" || -z "${packagepath}" ]]; then + echo "Usage: $0 " exit 1 fi -if [[ ! " ${allowed_stl_variants[@]} " =~ " ${stl} " ]]; then - echo "Invalid STL variant '${stl}'. Allowed STL variants: ${allowed_stl_variants[*]}" - exit 2 -fi - if [[ ! -d "${builtpath}/app/build" ]]; then echo "Built Android SDK not found at path '${builtpath}'." exit 2 @@ -38,7 +30,7 @@ cd "${origpath}" mkdir -p "${destpath}/libs/android" -# Copy each platform's libraries to the destination directory for this STL variant. +# Copy each platform's libraries to the destination directory. cd "${sourcepath}" # Make sure we only copy the libraries in product_list (specified in packaging.conf) for product in ${product_list[*]}; do @@ -49,7 +41,7 @@ for product in ${product_list[*]}; do for cpudir in "${dir}"/*; do cpu=$(basename ${cpudir}) libsrc="${sourcepath}/${cpudir}/libfirebase_${product}.a" - libdest="${destpath}/libs/android/${cpu}/${stl}" + libdest="${destpath}/libs/android/${cpu} mkdir -p "${libdest}" cp -f "${libsrc}" "${libdest}/" done diff --git a/build_scripts/desktop/get_variant.sh b/build_scripts/desktop/get_variant.sh index 9f5bf1254a..16db1f6a75 100755 --- a/build_scripts/desktop/get_variant.sh +++ b/build_scripts/desktop/get_variant.sh @@ -184,9 +184,9 @@ case ${os} in ;; android) if [[ -z "${arch}" ]]; then - echo -n "${stl}" + echo -n "." else - echo -n "${arch}/${stl}" + echo -n "${arch}" fi ;; *) diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 1dce92d55e..982ab2620f 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -50,11 +50,9 @@ libs/ios/ARCH | iOS static libraries (compiled against | | libc++) | | Multi-architecture libraries are | | provided in the *universal* directory. -libs/android/ARCH/STL | Android (GCC 4.8+ compatible) static -| | libraries for each architecture and STL -| | variant. -| | _STL variant available:_ -| | * `c++`: LLVM libc++ runtime +libs/android/ARCH | Android (GCC 4.8+ compatible) static +| | libraries for each architecture. Only the +| | LLVM libc++ STL runtime ("c++") is supported. | | More information can be found in the | | [NDK C++ Helper Runtimes](https://developer.android.com/ndk/guides/cpp-support.html#runtimes) | | documentation. From ea0a0d7d5177c88ca57112f872005abb4659ce96 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 2 May 2022 16:39:57 -0700 Subject: [PATCH 07/10] Remove STL specification from CMake and gradle files. --- CMakeLists.txt | 5 ----- admob/build.gradle | 8 +------- analytics/build.gradle | 8 +------- app/build.gradle | 8 +------- auth/build.gradle | 8 +------- database/build.gradle | 8 +------- dynamic_links/build.gradle | 8 +------- firestore/build.gradle | 8 +------- functions/build.gradle | 8 +------- installations/build.gradle | 8 +------- messaging/build.gradle | 8 +------- release_build_files/CMakeLists.txt | 4 +--- release_build_files/readme.md | 3 ++- remote_config/build.gradle | 8 +------- storage/build.gradle | 8 +------- 15 files changed, 15 insertions(+), 93 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d3410f251..cb610fdc90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,11 +81,6 @@ option(FIREBASE_GITHUB_ACTION_BUILD option(FIREBASE_QUICK_TEST "Enable quick tests will skip tests which requires access to the SECRET" OFF) -set(FIREBASE_ANDROID_STL "" CACHE STRING "STL implementation to use.") -if (NOT FIREBASE_ANDROID_STL STREQUAL "") - set(ANDROID_STL ${FIREBASE_ANDROID_STL}) -endif() - set(FIREBASE_PYTHON_EXECUTABLE "python" CACHE FILEPATH "The Python interpreter to use, such as one from a venv") diff --git a/admob/build.gradle b/admob/build.gradle index 6b54fd5f33..f1b5a00c52 100644 --- a/admob/build.gradle +++ b/admob/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_ADMOB=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_ADMOB=ON' } } } diff --git a/analytics/build.gradle b/analytics/build.gradle index 9395803986..b10304768b 100644 --- a/analytics/build.gradle +++ b/analytics/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_ANALYTICS=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_ANALYTICS=ON' } } } diff --git a/app/build.gradle b/app/build.gradle index 9ed5f73643..89edc14b32 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -67,8 +62,7 @@ android { cmake { targets 'firebase_app' // Don't configure all the cmake subprojects. - arguments '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + arguments '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF' } } } diff --git a/auth/build.gradle b/auth/build.gradle index 831c181747..1874f97383 100644 --- a/auth/build.gradle +++ b/auth/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_AUTH=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_AUTH=ON' } } } diff --git a/database/build.gradle b/database/build.gradle index 8739434d0f..bafe7785db 100644 --- a/database/build.gradle +++ b/database/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_DATABASE=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_DATABASE=ON' } } } diff --git a/dynamic_links/build.gradle b/dynamic_links/build.gradle index 1db97b2d96..570514f91d 100644 --- a/dynamic_links/build.gradle +++ b/dynamic_links/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_DYNAMIC_LINKS=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_DYNAMIC_LINKS=ON' } } } diff --git a/firestore/build.gradle b/firestore/build.gradle index 13b22de7c8..a06792599a 100644 --- a/firestore/build.gradle +++ b/firestore/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -72,8 +67,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_FIRESTORE=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_FIRESTORE=ON' } } } diff --git a/functions/build.gradle b/functions/build.gradle index c350b092f1..0376db0837 100644 --- a/functions/build.gradle +++ b/functions/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_FUNCTIONS=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_FUNCTIONS=ON' } } } diff --git a/installations/build.gradle b/installations/build.gradle index 783689c6d4..123c87465a 100644 --- a/installations/build.gradle +++ b/installations/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_INSTALLATIONS=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_INSTALLATIONS=ON' } } } diff --git a/messaging/build.gradle b/messaging/build.gradle index e6399fc77a..238265ca37 100644 --- a/messaging/build.gradle +++ b/messaging/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_MESSAGING=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_MESSAGING=ON' } } } diff --git a/release_build_files/CMakeLists.txt b/release_build_files/CMakeLists.txt index 239acca6ea..fae75b12e8 100644 --- a/release_build_files/CMakeLists.txt +++ b/release_build_files/CMakeLists.txt @@ -24,10 +24,8 @@ endif () # Determine the location of the libraries to use based on the platform. if(ANDROID) - string(REPLACE "_" ";" SPLIT_STL ${ANDROID_STL}) - list(GET SPLIT_STL 0 STL_DIR) set(FIREBASE_SDK_LIBDIR - "${FIREBASE_CPP_SDK_DIR}/libs/android/${ANDROID_ABI}/${STL_DIR}") + "${FIREBASE_CPP_SDK_DIR}/libs/android/${ANDROID_ABI}") elseif(APPLE) if(IOS) set(FIREBASE_SDK_LIBDIR ${FIREBASE_CPP_SDK_DIR}/libs/ios/universal) diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 982ab2620f..df49e73326 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -569,7 +569,8 @@ code. - General (Android): On Android, Firebase C++ is now built against NDK version r21e. - General (Android): Firebase support for gnustl (also known as libstdc++) - has been removed. Please use libc++ instead. + has been removed. Please use libc++ instead. Android libraries have been + moved from libs/android/ARCH/STL to libs/android/ARCH. - Storage (Desktop): Set Content-Type HTTP header when uploading with custom metadata. diff --git a/remote_config/build.gradle b/remote_config/build.gradle index 28f582eff4..35c1790010 100644 --- a/remote_config/build.gradle +++ b/remote_config/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_REMOTE_CONFIG=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_REMOTE_CONFIG=ON' } } } diff --git a/storage/build.gradle b/storage/build.gradle index 2c2b6bc50a..fe388e51c0 100644 --- a/storage/build.gradle +++ b/storage/build.gradle @@ -30,11 +30,6 @@ allprojects { apply plugin: 'com.android.library' -ext { - firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL') - firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : '' -} - android { compileSdkVersion 28 buildToolsVersion '28.0.3' @@ -71,8 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_STORAGE=ON', - "-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}" + '-DFIREBASE_INCLUDE_STORAGE=ON'" } } } From 52e35b9e685c9242a9f8a51f1e72493a801dd801 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 2 May 2022 16:48:02 -0700 Subject: [PATCH 08/10] Fix gradle error --- storage/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/build.gradle b/storage/build.gradle index fe388e51c0..0e3b9a0da7 100644 --- a/storage/build.gradle +++ b/storage/build.gradle @@ -66,7 +66,7 @@ android { // Only include needed project. arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON', '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF', - '-DFIREBASE_INCLUDE_STORAGE=ON'" + '-DFIREBASE_INCLUDE_STORAGE=ON' } } } From e7022775df34cb42d3281df11bbb7923638fe218 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 2 May 2022 16:50:04 -0700 Subject: [PATCH 09/10] Remove any mention of STL. --- build_scripts/android/build.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build_scripts/android/build.sh b/build_scripts/android/build.sh index f23f02b40d..16e4d456ab 100755 --- a/build_scripts/android/build.sh +++ b/build_scripts/android/build.sh @@ -15,10 +15,6 @@ if [[ ! -d "${sourcepath}" ]]; then exit 2 fi -# Force libc++ STL. This should be the NDK's default, but specify it here -# just to be sure. -export FIREBASE_ANDROID_STL=c++_static - origpath=$( pwd -P ) mkdir -p "${buildpath}" From 6c28a9e27165c220f39923230c54e44a3e9e7c7c Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Mon, 2 May 2022 17:08:52 -0700 Subject: [PATCH 10/10] Fix missing quote --- build_scripts/android/package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/android/package.sh b/build_scripts/android/package.sh index e1b90e12b0..553b9aca56 100755 --- a/build_scripts/android/package.sh +++ b/build_scripts/android/package.sh @@ -41,7 +41,7 @@ for product in ${product_list[*]}; do for cpudir in "${dir}"/*; do cpu=$(basename ${cpudir}) libsrc="${sourcepath}/${cpudir}/libfirebase_${product}.a" - libdest="${destpath}/libs/android/${cpu} + libdest="${destpath}/libs/android/${cpu}" mkdir -p "${libdest}" cp -f "${libsrc}" "${libdest}/" done