From a3cb4ab6ccf3a3ebec4fe6146dd1ea0ae91feebd Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 15 Dec 2024 15:42:03 -0500 Subject: [PATCH 1/3] Arrow: Enable Zstd --- A/Arrow/build_tarballs.jl | 15 +++++++++++++-- A/Arrow/bundled/patches/windows-zstd.patch | 13 +++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 A/Arrow/bundled/patches/windows-zstd.patch diff --git a/A/Arrow/build_tarballs.jl b/A/Arrow/build_tarballs.jl index eea8a490845..ad55ba00df6 100644 --- a/A/Arrow/build_tarballs.jl +++ b/A/Arrow/build_tarballs.jl @@ -3,7 +3,9 @@ using BinaryBuilder, Pkg name = "Arrow" -version = v"18.1.0" +# This installs Arrow 18.1.0. +# We declare this as 18.1.1 because we enabled the Zstd library, changing the package dependencies. +version = v"18.1.1" # Collection of sources required to complete build sources = [ @@ -48,11 +50,19 @@ CMAKE_FLAGS=( -DARROW_WITH_SNAPPY=ON -DARROW_WITH_UTF8PROC=OFF -DARROW_WITH_ZLIB=ON - -DARROW_WITH_ZSTD=OFF + -DARROW_WITH_ZSTD=ON -DPARQUET_BUILD_EXECUTABLES=OFF + -DZSTD_ROOT=${prefix} -Dxsimd_SOURCE=AUTO ) +if [[ $target == *mingw32* ]]; then + # Cmake doesn't find the zstd library on Windows. It does find + # zstd, but it somehow can't determine the path to the actual + # library. + CMAKE_FLAGS+=(-DZSTD_LIB=/workspace/destdir/lib/libzstd.dll.a) +fi + cmake -B cmake-build "${CMAKE_FLAGS[@]}" cmake --build cmake-build --parallel ${nproc} cmake --install cmake-build @@ -76,6 +86,7 @@ dependencies = [ Dependency("Lz4_jll"), Dependency("Thrift_jll"; compat="0.21"), Dependency("Zlib_jll"), + Dependency("Zstd_jll"; compat="1.5.6"), Dependency("boost_jll"; compat="=1.79.0"), Dependency("brotli_jll"; compat="1.1.0"), Dependency("snappy_jll"; compat="1.2.1"), diff --git a/A/Arrow/bundled/patches/windows-zstd.patch b/A/Arrow/bundled/patches/windows-zstd.patch new file mode 100644 index 00000000000..5248184c710 --- /dev/null +++ b/A/Arrow/bundled/patches/windows-zstd.patch @@ -0,0 +1,13 @@ +Installing Arrow with Zstd fails on Windows. Reported upstream as + + +--- a/cpp/cmake_modules/FindzstdAlt.cmake ++++ b/cpp/cmake_modules/FindzstdAlt.cmake +@@ -136,6 +136,7 @@ + endif() + set_target_properties(${zstd_TARGET} + PROPERTIES IMPORTED_LOCATION "${ZSTD_LIB}" ++ IMPORTED_IMPLIB /workspace/destdir/bin/libzstd-1.dll + INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}") + message(STATUS "Zstandard library: ${ZSTD_LIB}") + message(STATUS "Zstandard include directory: ${ZSTD_INCLUDE_DIR}") From c155b1f245a56437e42fd3b94f797ab9576c2d1d Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 15 Dec 2024 15:52:27 -0500 Subject: [PATCH 2/3] Arrow: Update patches --- A/Arrow/build_tarballs.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/A/Arrow/build_tarballs.jl b/A/Arrow/build_tarballs.jl index ad55ba00df6..e9396ed0095 100644 --- a/A/Arrow/build_tarballs.jl +++ b/A/Arrow/build_tarballs.jl @@ -19,10 +19,13 @@ script = raw""" cd $WORKSPACE/srcdir/arrow -# Set toolchain for building external deps -for f in ${WORKSPACE}/srcdir/patches/*.patch; do - atomic_patch -p1 ${f} -done +atomic_patch -p1 ${WORKSPACE}/srcdir/patches/boost.patch +atomic_patch -p1 ${WORKSPACE}/srcdir/patches/windows.patch +if [[ $target == *mingw32* ]]; then + # This hard-codes the name and location of the zstd library and + # must not be applied on other architectures + atomic_patch -p1 ${WORKSPACE}/srcdir/patches/windows-zstd.patch +fi cd cpp @@ -52,7 +55,6 @@ CMAKE_FLAGS=( -DARROW_WITH_ZLIB=ON -DARROW_WITH_ZSTD=ON -DPARQUET_BUILD_EXECUTABLES=OFF - -DZSTD_ROOT=${prefix} -Dxsimd_SOURCE=AUTO ) From c8aff2f4c1127844880943fd8d070b23dbc215eb Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 21 Dec 2024 11:49:02 -0500 Subject: [PATCH 3/3] Update A/Arrow/build_tarballs.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com> --- A/Arrow/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/A/Arrow/build_tarballs.jl b/A/Arrow/build_tarballs.jl index e9396ed0095..2e8f9256fdb 100644 --- a/A/Arrow/build_tarballs.jl +++ b/A/Arrow/build_tarballs.jl @@ -62,7 +62,7 @@ if [[ $target == *mingw32* ]]; then # Cmake doesn't find the zstd library on Windows. It does find # zstd, but it somehow can't determine the path to the actual # library. - CMAKE_FLAGS+=(-DZSTD_LIB=/workspace/destdir/lib/libzstd.dll.a) + CMAKE_FLAGS+=(-DZSTD_LIB="${prefix}/lib/libzstd.dll.a") fi cmake -B cmake-build "${CMAKE_FLAGS[@]}"