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

morningman 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 406db6da925 [Improve](build-script)Add be-extension-ignore to ignore 
avro-scanner when building release packages (#32699)
406db6da925 is described below

commit 406db6da925dd377552f2d91268baf65e77d6d76
Author: wudongliang <46414265+donglian...@users.noreply.github.com>
AuthorDate: Fri Mar 22 22:54:19 2024 +0800

    [Improve](build-script)Add be-extension-ignore to ignore avro-scanner when 
building release packages (#32699)
---
 build-for-release.sh |  2 +-
 build.sh             | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/build-for-release.sh b/build-for-release.sh
index 2a7569aaa30..bdf95b76b56 100755
--- a/build-for-release.sh
+++ b/build-for-release.sh
@@ -145,7 +145,7 @@ echo "JAR:  ${OUTPUT_EXT}"
 
 sh build.sh --clean &&
     USE_AVX2="${_USE_AVX2}" sh build.sh &&
-    USE_AVX2="${_USE_AVX2}" sh build.sh --be --meta-tool
+    USE_AVX2="${_USE_AVX2}" sh build.sh --be --meta-tool --be-extension-ignore 
avro-scanner
 
 echo "Begin to pack"
 rm -rf "${OUTPUT}"
diff --git a/build.sh b/build.sh
index 4b8f240f314..dbd89f4aa1e 100755
--- a/build.sh
+++ b/build.sh
@@ -49,6 +49,7 @@ Usage: $0 <options>
      --spark-dpp            build Spark DPP application. Default ON.
      --hive-udf             build Hive UDF library for Spark Load. Default ON.
      --be-java-extensions   build Backend java extensions. Default ON.
+     --be-extension-ignore  build be-java-extensions package, choose which 
modules to ignore. Multiple modules separated by commas.
      --clean                clean and build target
      --output               specify the output directory
      -j                     build Backend parallel
@@ -71,6 +72,7 @@ Usage: $0 <options>
     $0 --be --fe                            build Backend, Frontend, Spark Dpp 
application and Java UDF library
     $0 --be --coverage                      build Backend with coverage enabled
     $0 --be --output PATH                   build Backend, the result will be 
output to PATH(relative paths are available)
+    $0 --be-extension-ignore avro-scanner   build be-java-extensions, choose 
which modules to ignore. Multiple modules separated by commas, like 
--be-extension-ignore avro-scanner,hudi-scanner
 
     USE_AVX2=0 $0 --be                      build Backend and not using AVX2 
instruction.
     USE_AVX2=0 STRIP_DEBUG_INFO=ON $0       build all and not using AVX2 
instruction, and strip the debug info for Backend
@@ -127,6 +129,7 @@ if ! OPTS="$(getopt \
     -l 'spark-dpp' \
     -l 'hive-udf' \
     -l 'be-java-extensions' \
+    -l 'be-extension-ignore:' \
     -l 'clean' \
     -l 'coverage' \
     -l 'help' \
@@ -240,6 +243,10 @@ else
             DORIS_OUTPUT="$2"
             shift 2
             ;;
+        --be-extension-ignore)
+            BE_EXTENSION_IGNORE="$2"
+            shift 2
+            ;;
         --)
             shift
             break
@@ -501,6 +508,14 @@ if [[ "${BUILD_BE_JAVA_EXTENSIONS}" -eq 1 ]]; then
     modules+=("be-java-extensions/max-compute-scanner")
     modules+=("be-java-extensions/avro-scanner")
     modules+=("be-java-extensions/preload-extensions")
+
+    # If the BE_EXTENSION_IGNORE variable is not empty, remove the modules 
that need to be ignored from FE_MODULES
+    if [[ -n "${BE_EXTENSION_IGNORE}" ]]; then
+        IFS=',' read -r -a ignore_modules <<<"${BE_EXTENSION_IGNORE}"
+        for module in "${ignore_modules[@]}"; do
+            modules=("${modules[@]/be-java-extensions\/${module}/}")
+        done
+    fi
 fi
 FE_MODULES="$(
     IFS=','
@@ -778,6 +793,27 @@ EOF
     extensions_modules+=("avro-scanner")
     extensions_modules+=("preload-extensions")
 
+    if [[ -n "${BE_EXTENSION_IGNORE}" ]]; then
+        IFS=',' read -r -a ignore_modules <<<"${BE_EXTENSION_IGNORE}"
+        new_modules=()
+        for module in "${extensions_modules[@]}"; do
+            module=${module// /}
+            if [[ -n "${module}" ]]; then
+                ignore=0
+                for ignore_module in "${ignore_modules[@]}"; do
+                    if [[ "${module}" == "${ignore_module}" ]]; then
+                        ignore=1
+                        break
+                    fi
+                done
+                if [[ "${ignore}" -eq 0 ]]; then
+                    new_modules+=("${module}")
+                fi
+            fi
+        done
+        extensions_modules=("${new_modules[@]}")
+    fi
+
     BE_JAVA_EXTENSIONS_DIR="${DORIS_OUTPUT}/be/lib/java_extensions/"
     rm -rf "${BE_JAVA_EXTENSIONS_DIR}"
     mkdir "${BE_JAVA_EXTENSIONS_DIR}"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to