From 18420934ed674149ff95928d44f144103668e718 Mon Sep 17 00:00:00 2001 From: Adonis Ling Date: Tue, 14 Jan 2025 14:48:34 +0800 Subject: [PATCH] [fix](third-party) Fix wrong download url --- .github/workflows/build-thirdparty.yml | 82 ++++++++++++++++++++++++-- thirdparty/build-thirdparty.sh | 11 +++- thirdparty/patches/brpc-1.2.0-02.patch | 68 +++++++++++++++++++++ thirdparty/vars.sh | 2 +- 4 files changed, 155 insertions(+), 8 deletions(-) create mode 100644 thirdparty/patches/brpc-1.2.0-02.patch diff --git a/.github/workflows/build-thirdparty.yml b/.github/workflows/build-thirdparty.yml index 442b60da7e2151..dd4204742045d5 100644 --- a/.github/workflows/build-thirdparty.yml +++ b/.github/workflows/build-thirdparty.yml @@ -32,7 +32,7 @@ jobs: thirdparty_changes: ${{ steps.filter.outputs.thirdparty_changes }} steps: - name: Checkout ${{ github.ref }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false submodules: recursive @@ -51,8 +51,23 @@ jobs: if: ${{ needs.changes.outputs.thirdparty_changes == 'true' }} runs-on: ubuntu-22.04 steps: + - name: Checkout easimon/maximize-build-space + run: | + git clone -b v7 https://github.com/easimon/maximize-build-space + + - name: Maximize build space + uses: ./maximize-build-space + with: + root-reserve-mb: 4096 + swap-size-mb: 8192 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' + remove-codeql: 'true' + remove-docker-images: 'true' + - name: Checkout ${{ github.ref }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download run: | @@ -92,7 +107,6 @@ jobs: ) sudo apt update - sudo apt upgrade --yes sudo DEBIAN_FRONTEND=noninteractive apt install --yes "${packages[@]}" mkdir -p "${DEFAULT_DIR}" @@ -115,10 +129,10 @@ jobs: name: Build Third Party Libraries (macOS) needs: changes if: ${{ needs.changes.outputs.thirdparty_changes == 'true' }} - runs-on: macos-12 + runs-on: macos-13 steps: - name: Checkout ${{ github.ref }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download run: | @@ -130,6 +144,7 @@ jobs: - name: Prepare run: | packages=( + 'm4' 'automake' 'autoconf' 'libtool' @@ -150,12 +165,67 @@ jobs: 'maven' 'node' 'llvm@15' + 'llvm@16' ) - brew install "${packages[@]}" + brew install "${packages[@]}" || true - name: Build run: | + export MACOSX_DEPLOYMENT_TARGET=12.0 + + cd thirdparty + ./build-thirdparty.sh -j "$(nproc)" + + build_macos_arm64: + name: Build Third Party Libraries (macOS-arm64) + needs: changes + if: ${{ needs.changes.outputs.thirdparty_changes == 'true' }} + runs-on: macos-14 + steps: + - name: Checkout ${{ github.ref }} + uses: actions/checkout@v4 + + - name: Download + run: | + cd thirdparty + curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-source.tgz \ + -o doris-thirdparty-source.tgz + tar -zxvf doris-thirdparty-source.tgz + + - name: Prepare + run: | + packages=( + 'm4' + 'automake' + 'autoconf' + 'libtool' + 'pkg-config' + 'texinfo' + 'coreutils' + 'gnu-getopt' + 'python@3' + 'cmake' + 'ninja' + 'ccache' + 'bison' + 'byacc' + 'gettext' + 'wget' + 'pcre' + 'openjdk@11' + 'maven' + 'node' + 'llvm@15' + 'llvm@16' + ) + + brew install "${packages[@]}" || true + + - name: Build + run: | + export MACOSX_DEPLOYMENT_TARGET=12.0 + cd thirdparty ./build-thirdparty.sh -j "$(nproc)" diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index 784cfcb852d079..44bef0199aabe3 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -1249,11 +1249,20 @@ build_aws_sdk() { rm -rf "${BUILD_DIR}" + if [[ "${KERNEL}" == 'Darwin' ]]; then + # Use llvm@16 to build aws-c-cal instead of llvm@15 + USE_LLVM_16="-DCMAKE_C_COMPILER=$(brew --prefix)/opt/llvm@16/bin/clang" + else + USE_LLVM_16='' + fi + # -Wno-nonnull gcc-11 "${CMAKE_CMD}" -G "${GENERATOR}" -B"${BUILD_DIR}" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" \ -DCMAKE_PREFIX_PATH="${TP_INSTALL_DIR}" -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTING=OFF \ -DCURL_LIBRARY_RELEASE="${TP_INSTALL_DIR}/lib/libcurl.a" -DZLIB_LIBRARY_RELEASE="${TP_INSTALL_DIR}/lib/libz.a" \ - -DBUILD_ONLY="core;s3;s3-crt;transfer" -DCMAKE_CXX_FLAGS="-Wno-nonnull -Wno-deprecated-declarations" -DCPP_STANDARD=17 + -DBUILD_ONLY="core;s3;s3-crt;transfer" \ + ${USE_LLVM_16:+${USE_LLVM_16}} \ + -DCMAKE_CXX_FLAGS="-Wno-nonnull -Wno-deprecated-declarations" -DCPP_STANDARD=17 cd "${BUILD_DIR}" diff --git a/thirdparty/patches/brpc-1.2.0-02.patch b/thirdparty/patches/brpc-1.2.0-02.patch new file mode 100644 index 00000000000000..37d8a1ef3a80f5 --- /dev/null +++ b/thirdparty/patches/brpc-1.2.0-02.patch @@ -0,0 +1,68 @@ +diff --git a/src/butil/file_util_mac.mm b/src/butil/file_util_mac.mm +index 25a731b..02bcc70 100644 +--- a/src/butil/file_util_mac.mm ++++ b/src/butil/file_util_mac.mm +@@ -4,6 +4,7 @@ + + #include "butil/file_util.h" + ++#import + #import + #include + +diff --git a/src/butil/mac/bundle_locations.h b/src/butil/mac/bundle_locations.h +index 0c425f3..5c7d763 100644 +--- a/src/butil/mac/bundle_locations.h ++++ b/src/butil/mac/bundle_locations.h +@@ -9,6 +9,7 @@ + #include "butil/files/file_path.h" + + #if defined(__OBJC__) ++#import + #import + #else // __OBJC__ + class NSBundle; +diff --git a/src/butil/mac/foundation_util.h b/src/butil/mac/foundation_util.h +index 12b8e66..e206cb5 100644 +--- a/src/butil/mac/foundation_util.h ++++ b/src/butil/mac/foundation_util.h +@@ -15,6 +15,7 @@ + #include "butil/mac/scoped_cftyperef.h" + + #if defined(__OBJC__) ++#import + #import + @class NSFont; + @class UIFont; +@@ -29,6 +30,7 @@ class UIFont; + #if defined(OS_IOS) + #include + #else ++#include + #include + #endif + +diff --git a/src/butil/strings/sys_string_conversions_mac.mm b/src/butil/strings/sys_string_conversions_mac.mm +index 804b614..f362b3b 100644 +--- a/src/butil/strings/sys_string_conversions_mac.mm ++++ b/src/butil/strings/sys_string_conversions_mac.mm +@@ -4,6 +4,7 @@ + + #include "butil/strings/sys_string_conversions.h" + ++#import + #import + + #include +diff --git a/src/butil/threading/platform_thread_mac.mm b/src/butil/threading/platform_thread_mac.mm +index 2291301..9a31553 100644 +--- a/src/butil/threading/platform_thread_mac.mm ++++ b/src/butil/threading/platform_thread_mac.mm +@@ -4,6 +4,7 @@ + + #include "butil/threading/platform_thread.h" + ++#import + #import + #include + #include diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh index 0bb3c17abbb37c..cb8aff7fa5ef28 100644 --- a/thirdparty/vars.sh +++ b/thirdparty/vars.sh @@ -174,7 +174,7 @@ RAGEL_SOURCE=ragel-6.10 RAGEL_MD5SUM="748cae8b50cffe9efcaa5acebc6abf0d" # boost -BOOST_DOWNLOAD="https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz" +BOOST_DOWNLOAD="https://archives.boost.io/release/1.73.0/source/boost_1_73_0.tar.gz" BOOST_NAME=boost_1_73_0.tar.gz BOOST_SOURCE=boost_1_73_0 BOOST_MD5SUM="4036cd27ef7548b8d29c30ea10956196"