This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 249b688663 [chore](github) Add a workflow to check BE UT on macOS 
(#14506)
249b688663 is described below

commit 249b6886632c5638cdf5f6b014200df0455bd6ca
Author: Adonis Ling <[email protected]>
AuthorDate: Wed Nov 23 08:38:28 2022 +0800

    [chore](github) Add a workflow to check BE UT on macOS (#14506)
---
 .github/workflows/be-ut-clang.yml                  | 18 +++----
 .../workflows/{be-ut-clang.yml => be-ut-mac.yml}   | 61 ++++++++++++----------
 be/src/runtime/CMakeLists.txt                      |  2 +-
 be/src/runtime/thread_context.h                    |  2 +-
 .../vec/aggregate_functions/agg_collect_test.cpp   |  2 +-
 build.sh                                           |  6 +--
 run-be-ut.sh                                       | 10 ++--
 7 files changed, 53 insertions(+), 48 deletions(-)

diff --git a/.github/workflows/be-ut-clang.yml 
b/.github/workflows/be-ut-clang.yml
index 4e52acc516..5e2914ebdd 100644
--- a/.github/workflows/be-ut-clang.yml
+++ b/.github/workflows/be-ut-clang.yml
@@ -38,8 +38,8 @@ jobs:
       - name: Ccache ${{ github.ref }}
         uses: ./.github/actions/ccache-action
         with:
-          key: ${{ github.ref }} (BE UT Clang)
-          max-size: "1G"
+          key: BE UT Clang
+          max-size: "2G"
 
       - name: Paths filter
         uses: ./.github/actions/paths-filter
@@ -55,19 +55,12 @@ jobs:
         if: ${{ steps.filter.outputs.be_changes == 'true' }}
         run: |
           export DEFAULT_DIR='/opt/doris'
-          export 
PATH="${DEFAULT_DIR}/ldb-toolchain/bin/:${DEFAULT_DIR}/thirdparty/installed/bin/:${PATH}"
-          export DORIS_THIRDPARTY="${DEFAULT_DIR}/thirdparty"
 
           mkdir "${DEFAULT_DIR}"
-
           wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.12/ldb_toolchain_gen.sh
 \
             -q -O /tmp/ldb_toolchain_gen.sh
           bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
 
-          mkdir -p "${DORIS_THIRDPARTY}/installed"
-          docker run --rm 
--mount=type=bind,source="${DORIS_THIRDPARTY}/installed",target=/installed \
-            apache/doris:build-env-ldb-toolchain-latest bash -c 'mv 
/var/local/thirdparty/installed/* /installed'
-
           sudo apt update
           sudo apt upgrade --yes
           sudo DEBIAN_FRONTEND=noninteractive apt install --yes tzdata byacc
@@ -76,6 +69,13 @@ jobs:
           sudo ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
           sudo dpkg-reconfigure --frontend noninteractive tzdata
 
+          pushd thirdparty
+          curl -L 
https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-linux-x86_64.tar.xz
 \
+            -o doris-thirdparty-prebuilt-linux-x86_64.tar.xz
+          tar -xvf doris-thirdparty-prebuilt-linux-x86_64.tar.xz
+          popd
+
+          export 
PATH="${DEFAULT_DIR}/ldb-toolchain/bin/:$(pwd)/thirdparty/installed/bin/:${PATH}"
           DORIS_TOOLCHAIN=clang ./run-be-ut.sh -j "$(nproc)" --run --clean
 
       - name: Skip UT ${{ github.ref }}
diff --git a/.github/workflows/be-ut-clang.yml b/.github/workflows/be-ut-mac.yml
similarity index 55%
copy from .github/workflows/be-ut-clang.yml
copy to .github/workflows/be-ut-mac.yml
index 4e52acc516..76ec00988c 100644
--- a/.github/workflows/be-ut-clang.yml
+++ b/.github/workflows/be-ut-mac.yml
@@ -15,19 +15,19 @@
 # specific language governing permissions and limitations
 # under the License.
 
-name: BE UT (Clang)
+name: BE UT (macOS)
 
 on:
   pull_request:
 
 concurrency:
-  group: ${{ github.ref }} (BE UT Clang)
+  group: ${{ github.ref }} (BE UT macOS)
   cancel-in-progress: true
 
 jobs:
   run-ut:
-    name: BE UT (Clang)
-    runs-on: ubuntu-20.04
+    name: BE UT (macOS)
+    runs-on: macos-12
     steps:
       - name: Checkout
         uses: actions/checkout@v3
@@ -38,8 +38,8 @@ jobs:
       - name: Ccache ${{ github.ref }}
         uses: ./.github/actions/ccache-action
         with:
-          key: ${{ github.ref }} (BE UT Clang)
-          max-size: "1G"
+          key: BE UT macOS
+          max-size: "2G"
 
       - name: Paths filter
         uses: ./.github/actions/paths-filter
@@ -54,29 +54,36 @@ jobs:
       - name: Run UT ${{ github.ref }}
         if: ${{ steps.filter.outputs.be_changes == 'true' }}
         run: |
-          export DEFAULT_DIR='/opt/doris'
-          export 
PATH="${DEFAULT_DIR}/ldb-toolchain/bin/:${DEFAULT_DIR}/thirdparty/installed/bin/:${PATH}"
-          export DORIS_THIRDPARTY="${DEFAULT_DIR}/thirdparty"
+          cellars=(
+            'automake'
+            'autoconf'
+            'libtool'
+            'pkg-config'
+            'texinfo'
+            'coreutils'
+            'gnu-getopt'
+            'python'
+            'cmake'
+            'ninja'
+            'ccache'
+            'bison'
+            'byacc'
+            'gettext'
+            'wget'
+            'pcre'
+            'openjdk@11'
+            'maven'
+            'node'
+          )
+          brew install "${cellars[@]}"
 
-          mkdir "${DEFAULT_DIR}"
+          pushd thirdparty
+          curl -L 
https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
 \
+            -o doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
+          tar -xvf doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
+          popd
 
-          wget 
https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.12/ldb_toolchain_gen.sh
 \
-            -q -O /tmp/ldb_toolchain_gen.sh
-          bash /tmp/ldb_toolchain_gen.sh "${DEFAULT_DIR}/ldb-toolchain"
-
-          mkdir -p "${DORIS_THIRDPARTY}/installed"
-          docker run --rm 
--mount=type=bind,source="${DORIS_THIRDPARTY}/installed",target=/installed \
-            apache/doris:build-env-ldb-toolchain-latest bash -c 'mv 
/var/local/thirdparty/installed/* /installed'
-
-          sudo apt update
-          sudo apt upgrade --yes
-          sudo DEBIAN_FRONTEND=noninteractive apt install --yes tzdata byacc
-
-          # set timezone
-          sudo ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
-          sudo dpkg-reconfigure --frontend noninteractive tzdata
-
-          DORIS_TOOLCHAIN=clang ./run-be-ut.sh -j "$(nproc)" --run --clean
+          ./run-be-ut.sh --run -j "$(nproc)" --clean
 
       - name: Skip UT ${{ github.ref }}
         if: ${{ steps.filter.outputs.be_changes == 'false' }}
diff --git a/be/src/runtime/CMakeLists.txt b/be/src/runtime/CMakeLists.txt
index 69af332894..a615463922 100644
--- a/be/src/runtime/CMakeLists.txt
+++ b/be/src/runtime/CMakeLists.txt
@@ -113,7 +113,7 @@ if (WITH_MYSQL)
         )
 endif()
 
-if (USE_JEMALLOC)
+if (USE_JEMALLOC AND USE_MEM_TRACKER)
     set(RUNTIME_FILES ${RUNTIME_FILES}
         memory/jemalloc_hook.cpp
         )
diff --git a/be/src/runtime/thread_context.h b/be/src/runtime/thread_context.h
index 32962315ac..e586143b8e 100644
--- a/be/src/runtime/thread_context.h
+++ b/be/src/runtime/thread_context.h
@@ -383,7 +383,7 @@ private:
 #define THREAD_MEM_TRACKER_TRANSFER_TO(size, tracker) (void)0
 #define THREAD_MEM_TRACKER_TRANSFER_FROM(size, tracker) (void)0
 #define CONSUME_MEM_TRACKER(size) (void)0
-#define TRY_CONSUME_MEM_TRACKER(size) (void)0
+#define TRY_CONSUME_MEM_TRACKER(size, fail_ret) (void)0
 #define RELEASE_MEM_TRACKER(size) (void)0
 #define TRY_RELEASE_MEM_TRACKER(size) (void)0
 #define RETURN_IF_CATCH_BAD_ALLOC(stmt) (stmt)
diff --git a/be/test/vec/aggregate_functions/agg_collect_test.cpp 
b/be/test/vec/aggregate_functions/agg_collect_test.cpp
index 28e31ca58c..609fc41210 100644
--- a/be/test/vec/aggregate_functions/agg_collect_test.cpp
+++ b/be/test/vec/aggregate_functions/agg_collect_test.cpp
@@ -57,7 +57,7 @@ public:
                     auto item = std::string("item") + std::to_string(i);
                     input_col->insert_data(item.c_str(), item.size());
                 } else {
-                    auto item = FieldType(i);
+                    auto item = FieldType(static_cast<uint64_t>(i));
                     input_col->insert_data(reinterpret_cast<const 
char*>(&item), 0);
                 }
             }
diff --git a/build.sh b/build.sh
index 56ba97f687..936241cd65 100755
--- a/build.sh
+++ b/build.sh
@@ -272,11 +272,7 @@ if [[ -z "${USE_MEM_TRACKER}" ]]; then
     fi
 fi
 if [[ -z "${USE_JEMALLOC}" ]]; then
-    if [[ "$(uname -s)" != 'Darwin' ]]; then
-        USE_JEMALLOC='ON'
-    else
-        USE_JEMALLOC='OFF'
-    fi
+    USE_JEMALLOC='ON'
 fi
 if [[ -z "${STRICT_MEMORY_USE}" ]]; then
     STRICT_MEMORY_USE='OFF'
diff --git a/run-be-ut.sh b/run-be-ut.sh
index f66d65a64e..ad43ce3f22 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -39,6 +39,8 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && 
pwd)"
 
 export DORIS_HOME="${ROOT}"
 
+. "${DORIS_HOME}/env.sh"
+
 # Check args
 usage() {
     echo "
@@ -72,8 +74,6 @@ fi
 
 eval set -- "${OPTS}"
 
-PARALLEL="$(($(nproc) / 5 + 1))"
-
 CLEAN=0
 RUN=0
 BUILD_BENCHMARK_TOOL='OFF'
@@ -113,6 +113,10 @@ if [[ "$#" != 1 ]]; then
     done
 fi
 
+if [[ -z "${PARALLEL}" ]]; then
+    PARALLEL="$(($(nproc) / 5 + 1))"
+fi
+
 CMAKE_BUILD_TYPE="${BUILD_TYPE:-ASAN}"
 CMAKE_BUILD_TYPE="$(echo "${CMAKE_BUILD_TYPE}" | awk '{ print(toupper($0)) }')"
 
@@ -122,8 +126,6 @@ echo "Get params:
 "
 echo "Build Backend UT"
 
-. "${DORIS_HOME}/env.sh"
-
 CMAKE_BUILD_DIR="${DORIS_HOME}/be/ut_build_${CMAKE_BUILD_TYPE}"
 if [[ "${CLEAN}" -eq 1 ]]; then
     rm -rf "${CMAKE_BUILD_DIR}"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to