diff --git a/dev/builddeps-veloxbe.sh b/dev/builddeps-veloxbe.sh index 82c9cfc8d6c04..a1e93d9acb8b7 100755 --- a/dev/builddeps-veloxbe.sh +++ b/dev/builddeps-veloxbe.sh @@ -171,8 +171,9 @@ function concat_velox_param { if [ "$ENABLE_VCPKG" = "ON" ]; then # vcpkg will install static depends and init build environment - envs="$("$GLUTEN_DIR/dev/vcpkg/init.sh")" - eval "$envs" + bash $GLUTEN_DIR/dev/vcpkg/init.sh --build_tests=$BUILD_TESTS --enable_s3=$ENABLE_S3 \ + --enable_gcs=$ENABLE_GCS --enable_hdfs=$ENABLE_HDFS \ + --enable_abfs=$ENABLE_ABFS fi if [ "$SPARK_VERSION" = "3.2" ] || [ "$SPARK_VERSION" = "3.3" ] \ @@ -196,8 +197,8 @@ function build_velox { cd $GLUTEN_DIR/ep/build-velox/src # When BUILD_TESTS is on for gluten cpp, we need turn on VELOX_BUILD_TEST_UTILS via build_test_utils. ./build_velox.sh --enable_s3=$ENABLE_S3 --enable_gcs=$ENABLE_GCS --build_type=$BUILD_TYPE --enable_hdfs=$ENABLE_HDFS \ - --enable_abfs=$ENABLE_ABFS --enable_ep_cache=$ENABLE_EP_CACHE --build_test_utils=$BUILD_TESTS --build_tests=$BUILD_VELOX_TESTS --build_benchmarks=$BUILD_VELOX_BENCHMARKS \ - --num_threads=$NUM_THREADS + --enable_abfs=$ENABLE_ABFS --enable_ep_cache=$ENABLE_EP_CACHE --build_test_utils=$BUILD_TESTS \ + --build_tests=$BUILD_VELOX_TESTS --build_benchmarks=$BUILD_VELOX_BENCHMARKS --num_threads=$NUM_THREADS } function build_gluten_cpp { diff --git a/dev/vcpkg/init.sh b/dev/vcpkg/init.sh index e69aec94ab1f8..2599fb6193c2b 100755 --- a/dev/vcpkg/init.sh +++ b/dev/vcpkg/init.sh @@ -4,6 +4,41 @@ set -e exec 3>&1 >&2 +BUILD_TESTS=OFF +ENABLE_S3=OFF +ENABLE_GCS=OFF +ENABLE_HDFS=OFF +ENABLE_ABFS=OFF + +for arg in "$@"; do + case $arg in + --build_tests=*) + BUILD_TESTS=("${arg#*=}") + shift # Remove argument name from processing + ;; + --enable_s3=*) + ENABLE_S3=("${arg#*=}") + shift # Remove argument name from processing + ;; + --enable_gcs=*) + ENABLE_GCS=("${arg#*=}") + shift # Remove argument name from processing + ;; + --enable_hdfs=*) + ENABLE_HDFS=("${arg#*=}") + shift # Remove argument name from processing + ;; + --enable_abfs=*) + ENABLE_ABFS=("${arg#*=}") + shift # Remove argument name from processing + ;; + *) + echo "Unrecognized argument: $arg" + exit 1 + ;; + esac +done + SCRIPT_ROOT="$(realpath "$(dirname "$0")")" VCPKG_ROOT="$SCRIPT_ROOT/.vcpkg" VCPKG="$SCRIPT_ROOT/.vcpkg/vcpkg" @@ -22,6 +57,27 @@ sed -i "s/192374a68e2971f04974a194645726196d9b8ee7abd650d1e6f65f7aa2ccc9b186c3ed $VCPKG install --no-print-usage \ --triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" +if [ "$BUILD_TESTS" = "ON" ]; then + $VCPKG install --no-print-usage \ + --triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=duckdb +fi +if [ "$BUILD_S3" = "ON" ]; then + $VCPKG install --no-print-usage \ + --triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=velox-s3 +fi +if [ "$BUILD_GCS" = "ON" ]; then + $VCPKG install --no-print-usage \ + --triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=velox-gcs +fi +if [ "$BUILD_HDFS" = "ON" ]; then + $VCPKG install --no-print-usage \ + --triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=velox-hdfs +fi +if [ "$BUILD_ABFS" = "ON" ]; then + $VCPKG install --no-print-usage \ + --triplet="${VCPKG_TRIPLET}" --host-triplet="${VCPKG_TRIPLET}" --x-feature=velox-abfs +fi + VCPKG_TRIPLET_INSTALL_DIR=${SCRIPT_ROOT}/vcpkg_installed/${VCPKG_TRIPLET} EXPORT_TOOLS_PATH= EXPORT_TOOLS_PATH="${VCPKG_TRIPLET_INSTALL_DIR}/tools/protobuf:${EXPORT_TOOLS_PATH}" diff --git a/dev/vcpkg/vcpkg.json b/dev/vcpkg/vcpkg.json index 6eec2190d043d..344699f58a093 100644 --- a/dev/vcpkg/vcpkg.json +++ b/dev/vcpkg/vcpkg.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "builtin-baseline": "a7b6122f6b6504d16d96117336a0562693579933", "dependencies": ["jemalloc"], - "default-features": ["velox", "velox-s3", "velox-gcs", "velox-hdfs", "velox-abfs", "duckdb"], + "default-features": ["velox"], "features": { "velox": { "description": "Velox backend",