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

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit e88a87e729e739edadb7ccff20da82dedb5b6855
Author: Adonis Ling <[email protected]>
AuthorDate: Fri Jan 6 01:23:37 2023 +0800

    [fix](macOS) Failed to run BE UT due to syscall to map cache into shared 
region failed (#15641)
    
    According to the post https://developer.apple.com/forums/thread/676684, the 
executable whose size is bigger than 2G may fail to start. The size of the 
executable `doris_be_test` generated by run-be-ut.sh is 2.1G (> 2G) now and we 
can't run it on macOS (arm64).
    
    We can separate the debug info from the executable `doris_be_test` to 
reduce the size. After that, we can run `doris_be_test` successfully.
---
 be/CMakeLists.txt      |  2 --
 be/test/CMakeLists.txt | 11 ++++++++++-
 build.sh               |  7 ++++++-
 run-be-ut.sh           |  5 ++++-
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 915c207189..cf51ddc492 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -492,8 +492,6 @@ if ("${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86" OR 
"${CMAKE_BUILD_TARGET_ARCH}"
     if (USE_AVX2)
         set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -mavx2")
     endif()
-    # set -mlzcnt for leading zero count used by simdjson
-    set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -msse4.2")
 endif()
 set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-attributes -DS2_USE_GFLAGS 
-DS2_USE_GLOG")
 
diff --git a/be/test/CMakeLists.txt b/be/test/CMakeLists.txt
index e604715c5c..a7a8f8b4e6 100644
--- a/be/test/CMakeLists.txt
+++ b/be/test/CMakeLists.txt
@@ -396,7 +396,16 @@ add_executable(doris_be_test
 )
 
 target_link_libraries(doris_be_test ${TEST_LINK_LIBS})
-set_target_properties(doris_be_test PROPERTIES COMPILE_FLAGS 
"-fno-access-control" ENABLE_EXPORTS 1)
+set_target_properties(doris_be_test PROPERTIES COMPILE_FLAGS 
"-fno-access-control")
+
+if (OS_MACOSX AND ARCH_ARM)
+    find_program(DSYMUTIL NAMES dsymutil)
+    message(STATUS "dsymutil found: ${DSYMUTIL}")
+    add_custom_command(TARGET doris_be_test POST_BUILD
+        COMMAND ${DSYMUTIL} $<TARGET_FILE:doris_be_test>
+        COMMAND ${CMAKE_STRIP} -S $<TARGET_FILE:doris_be_test>
+    )
+endif()
 
 if (BUILD_BENCHMARK_TOOL AND BUILD_BENCHMARK_TOOL STREQUAL "ON")
     add_executable(benchmark_tool
diff --git a/build.sh b/build.sh
index b55aa7a7e1..9ecf89dfca 100755
--- a/build.sh
+++ b/build.sh
@@ -228,7 +228,12 @@ if [[ ! -f 
"${DORIS_THIRDPARTY}/installed/lib/libbacktrace.a" ]]; then
     echo "Thirdparty libraries need to be build ..."
     # need remove all installed pkgs because some lib like lz4 will throw 
error if its lib alreay exists
     rm -rf "${DORIS_THIRDPARTY}/installed"
-    "${DORIS_THIRDPARTY}/build-thirdparty.sh" -j "${PARALLEL}"
+
+    if [[ "${CLEAN}" -eq 0 ]]; then
+        "${DORIS_THIRDPARTY}/build-thirdparty.sh" -j "${PARALLEL}"
+    else
+        "${DORIS_THIRDPARTY}/build-thirdparty.sh" -j "${PARALLEL}" --clean
+    fi
 fi
 
 if [[ "${CLEAN}" -eq 1 && "${BUILD_BE}" -eq 0 && "${BUILD_FE}" -eq 0 && 
"${BUILD_SPARK_DPP}" -eq 0 ]]; then
diff --git a/run-be-ut.sh b/run-be-ut.sh
index c3e76a0d6a..eb695545dc 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -107,7 +107,6 @@ if [[ "$#" != 1 ]]; then
             ;;
         *)
             usage
-            exit 0
             ;;
         esac
     done
@@ -128,6 +127,10 @@ echo "Build Backend UT"
 
 CMAKE_BUILD_DIR="${DORIS_HOME}/be/ut_build_${CMAKE_BUILD_TYPE}"
 if [[ "${CLEAN}" -eq 1 ]]; then
+    pushd "${DORIS_HOME}/gensrc"
+    make clean
+    popd
+
     rm -rf "${CMAKE_BUILD_DIR}"
     rm -rf "${DORIS_HOME}/be/output"
 fi


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

Reply via email to