baibaichen commented on code in PR #12625:
URL: https://github.com/apache/gluten/pull/12625#discussion_r3672927258


##########
dev/vcpkg/ports/arrow/vcpkg.json:
##########
@@ -0,0 +1,149 @@
+{
+  "name": "arrow",
+  "version": "18.0.0",

Review Comment:
   Version alignment is reasonable, but it needs a separate change. A simple 
native 15->18 switch is unsafe: the standalone Arrow patches do not all apply 
to Arrow 18, and ppc64le builds locally install Arrow Java JNI artifacts while 
Spark 3.x expects Arrow 15.0.0 and Spark 4.x expects 18.1.0. This PR keeps the 
existing standalone path at 15 and limits its scope to vcpkg-managed Arrow 18; 
native/Java/PPC alignment is tracked in #12673.



##########
dev/vcpkg/ports/arrow/portfile.cmake:
##########
@@ -0,0 +1,152 @@
+vcpkg_download_distfile(
+    ARCHIVE_PATH
+    URLS 
"https://archive.apache.org/dist/arrow/arrow-${VERSION}/apache-arrow-${VERSION}.tar.gz";
+    FILENAME apache-arrow-${VERSION}.tar.gz
+    SHA512 
4df30ab5561da695eaa864422626b9898555d86ca56835c3b8a8ca93a1dbaf081582bb36e2440d1daf7e1dd48c76941f1152a4f25ce0dbcc1c2abe244a00c05e
+)
+vcpkg_extract_source_archive(
+    SOURCE_PATH
+    ARCHIVE ${ARCHIVE_PATH}
+    PATCHES
+        android.patch
+        msvc-static-name.patch
+        utf8proc.patch
+        thrift.patch
+        arrow-testing-boost.patch
+        arrow-testing-static-boost.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+    FEATURES
+        acero       ARROW_ACERO
+        compute     ARROW_COMPUTE
+        csv         ARROW_CSV
+        cuda        ARROW_CUDA
+        dataset     ARROW_DATASET
+        filesystem  ARROW_FILESYSTEM
+        flight      ARROW_FLIGHT
+        flightsql   ARROW_FLIGHT_SQL
+        gcs         ARROW_GCS
+        jemalloc    ARROW_JEMALLOC
+        json        ARROW_JSON
+        mimalloc    ARROW_MIMALLOC
+        orc         ARROW_ORC
+        parquet     ARROW_PARQUET
+        parquet     PARQUET_REQUIRE_ENCRYPTION
+        s3          ARROW_S3
+        testing     ARROW_TESTING
+)
+
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+    list(APPEND FEATURE_OPTIONS "-DARROW_USE_NATIVE_INT128=OFF")
+endif()
+
+string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" ARROW_BUILD_SHARED)
+string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "static" ARROW_BUILD_STATIC)
+string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" 
ARROW_DEPENDENCY_USE_SHARED)
+
+vcpkg_cmake_configure(
+    SOURCE_PATH "${SOURCE_PATH}/cpp"
+    OPTIONS
+        ${FEATURE_OPTIONS}
+        -DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED}
+        -DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC}
+        -DARROW_BUILD_TESTS=OFF
+        -DARROW_DEPENDENCY_SOURCE=SYSTEM
+        -DARROW_DEPENDENCY_USE_SHARED=${ARROW_DEPENDENCY_USE_SHARED}
+        -DARROW_PACKAGE_KIND=vcpkg
+        -DARROW_WITH_BROTLI=OFF
+        -DARROW_WITH_BZ2=OFF
+        -DARROW_WITH_LZ4=ON
+        -DARROW_WITH_SNAPPY=ON
+        -DARROW_WITH_ZLIB=ON
+        -DARROW_WITH_ZSTD=ON
+        -DBUILD_WARNING_LEVEL=PRODUCTION
+        -DZSTD_MSVC_LIB_PREFIX=
+    MAYBE_UNUSED_VARIABLES
+        ZSTD_MSVC_LIB_PREFIX
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_fixup_pkgconfig()
+
+if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/arrow_static.lib")
+    message(FATAL_ERROR "Installed lib file should be named 'arrow.lib' via 
patching the upstream build.")
+endif()
+
+if("dataset" IN_LIST FEATURES)
+    vcpkg_cmake_config_fixup(
+        PACKAGE_NAME arrowdataset
+        CONFIG_PATH lib/cmake/ArrowDataset
+        DO_NOT_DELETE_PARENT_CONFIG_PATH
+    )
+endif()
+
+if("acero" IN_LIST FEATURES)
+    vcpkg_cmake_config_fixup(
+        PACKAGE_NAME arrowacero
+        CONFIG_PATH lib/cmake/ArrowAcero
+        DO_NOT_DELETE_PARENT_CONFIG_PATH
+    )
+endif()

Review Comment:
   Leaving this unchanged. In `vcpkg_cmake_config_fixup`, `CONFIG_PATH` 
identifies the installed CMake package directory, while `PACKAGE_NAME` 
determines the destination under `share/`; it does not need to match the 
case-sensitive `find_package()` spelling. The upstream vcpkg Arrow port uses 
the same `PACKAGE_NAME arrowdataset` / `CONFIG_PATH lib/cmake/ArrowDataset` and 
`arrowacero` / `ArrowAcero` pairs. Keeping the lowercase destination follows 
the vcpkg package layout and the resulting configs are relocated correctly.



##########
dev/vcpkg/toolchain.cmake:
##########
@@ -33,11 +33,36 @@ set(VCPKG_HOST_TRIPLET $ENV{VCPKG_TRIPLET})
 set(VCPKG_INSTALLED_DIR $ENV{VCPKG_MANIFEST_DIR}/vcpkg_installed)
 set(VCPKG_INSTALL_OPTIONS --no-print-usage)
 
-# Force read CMAKE_PREFIX_PATH from env
-set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
-
 include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
 
+if(DEFINED ENV{GLUTEN_VCPKG_PREFER_CONFIG}

Review Comment:
   Addressed in 26d623e6a by removing `GLUTEN_VCPKG_PREFER_CONFIG`. The Velox 
configure now passes the standard `-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=OFF` 
option directly because Velox needs its `FindArrow.cmake` adapter to create the 
`arrow` and `arrow_testing` targets. Other vcpkg consumers retain the toolchain 
default of preferring config packages.



##########
dev/vcpkg/ports/arrow/portfile.cmake:
##########
@@ -0,0 +1,152 @@
+vcpkg_download_distfile(
+    ARCHIVE_PATH
+    URLS 
"https://archive.apache.org/dist/arrow/arrow-${VERSION}/apache-arrow-${VERSION}.tar.gz";
+    FILENAME apache-arrow-${VERSION}.tar.gz
+    SHA512 
4df30ab5561da695eaa864422626b9898555d86ca56835c3b8a8ca93a1dbaf081582bb36e2440d1daf7e1dd48c76941f1152a4f25ce0dbcc1c2abe244a00c05e
+)
+vcpkg_extract_source_archive(
+    SOURCE_PATH
+    ARCHIVE ${ARCHIVE_PATH}
+    PATCHES

Review Comment:
   Addressed in 84e3d827b. The patch list now distinguishes the compatibility 
patches inherited from the vcpkg Arrow 18.1.0 port from the two patches 
required by the static `arrow_testing` dependency used by Velox.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to