From f1644d21f126fa85c4198704b050f9f37b5187a8 Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Mon, 13 May 2024 14:00:01 +1200 Subject: [PATCH 01/11] Use vcpkg as cpp dependency source --- .github/workflows/ruby.yml | 8 +++++++- ci/scripts/cpp_build.sh | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 04f944f56c66..49948c68a34e 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -313,6 +313,8 @@ jobs: strategy: fail-fast: false env: + ARROW_DEPENDENCY_SOURCE: VCPKG + ARROW_DEPENDENCY_USE_SHARED: OFF ARROW_BOOST_USE_SHARED: OFF ARROW_BUILD_BENCHMARKS: OFF ARROW_BUILD_SHARED: ON @@ -387,11 +389,15 @@ jobs: env: # We can invalidate the current cache by updating this. CACHE_VERSION: "2024-05-09" + - name: Build C++ VCPKG dependencies + shell: cmd + run: | + vcpkg\vcpkg.exe install --triplet x64-windows --x-manifest-root cpp --x-install-root build\cpp\vcpkg_installed - name: Build C++ shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" + bash -c "VCPKG_ROOT=\"$(pwd)/vcpkg\" ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" - name: Build GLib shell: cmd run: | diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh index 6a3a53f2533c..3ee7fbd9d19c 100755 --- a/ci/scripts/cpp_build.sh +++ b/ci/scripts/cpp_build.sh @@ -137,6 +137,7 @@ else -DARROW_C_FLAGS_RELWITHDEBINFO="${ARROW_C_FLAGS_RELWITHDEBINFO:-}" \ -DARROW_DATASET=${ARROW_DATASET:-OFF} \ -DARROW_DEPENDENCY_SOURCE=${ARROW_DEPENDENCY_SOURCE:-AUTO} \ + -DARROW_DEPENDENCY_USE_SHARED=${ARROW_DEPENDENCY_USE_SHARED:-ON} \ -DARROW_ENABLE_THREADING=${ARROW_ENABLE_THREADING:-ON} \ -DARROW_ENABLE_TIMING_TESTS=${ARROW_ENABLE_TIMING_TESTS:-ON} \ -DARROW_EXTRA_ERROR_CONTEXT=${ARROW_EXTRA_ERROR_CONTEXT:-OFF} \ From 3f9eae05f415385354aacab7772093c4112c82eb Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Tue, 14 May 2024 10:21:56 +1200 Subject: [PATCH 02/11] Fix using static utf8proc from vcpkg --- cpp/cmake_modules/Usevcpkg.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpp/cmake_modules/Usevcpkg.cmake b/cpp/cmake_modules/Usevcpkg.cmake index b6192468da34..01f10476ce3b 100644 --- a/cpp/cmake_modules/Usevcpkg.cmake +++ b/cpp/cmake_modules/Usevcpkg.cmake @@ -249,4 +249,7 @@ if(CMAKE_HOST_WIN32) set(ZSTD_MSVC_STATIC_LIB_SUFFIX "" CACHE STRING "") + set(utf8proc_MSVC_STATIC_LIB_SUFFIX + "" + CACHE STRING "") endif() From 82937e1145cc3cb7b9769f2c7a1d72a5ee436626 Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Fri, 24 May 2024 16:49:46 +1200 Subject: [PATCH 03/11] Use nuget caching with GitHub actions storage --- .github/workflows/ruby.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 49948c68a34e..12d81d083930 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -313,6 +313,7 @@ jobs: strategy: fail-fast: false env: + VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' ARROW_DEPENDENCY_SOURCE: VCPKG ARROW_DEPENDENCY_USE_SHARED: OFF ARROW_BOOST_USE_SHARED: OFF @@ -389,6 +390,19 @@ jobs: env: # We can invalidate the current cache by updating this. CACHE_VERSION: "2024-05-09" + - name: Setup NuGet credentials for vcpkg caching + shell: bash + run: | + `./vcpkg/vcpkg.exe fetch nuget | tail -n 1` \ + sources add \ + -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \ + -storepasswordincleartext \ + -name "GitHub" \ + -username "$GITHUB_REPOSITORY_OWNER" \ + -password "${{ secrets.GITHUB_TOKEN }}" + `./vcpkg/vcpkg.exe fetch nuget | tail -n 1` \ + setapikey "${{ secrets.GITHUB_TOKEN }}" \ + -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" - name: Build C++ VCPKG dependencies shell: cmd run: | From fd90776f35c510efda4609703b7352d80400d42c Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Mon, 27 May 2024 10:30:22 +1200 Subject: [PATCH 04/11] Add package write permissions --- .github/workflows/ruby.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 12d81d083930..8fbfdcd8204c 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -347,6 +347,8 @@ jobs: CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/dist" CMAKE_UNITY_BUILD: ON + permissions: + packages: write steps: - name: Disable Crash Dialogs run: | From 73836f38003395b007d1d2ce51b6f4a06cfc1035 Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Mon, 27 May 2024 12:05:23 +1200 Subject: [PATCH 05/11] Enable building Flight and zlib --- .github/workflows/ruby.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 8fbfdcd8204c..2a9301d8afb9 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -323,8 +323,8 @@ jobs: ARROW_BUILD_TESTS: OFF ARROW_ACERO: ON ARROW_DATASET: ON - ARROW_FLIGHT: OFF - ARROW_FLIGHT_SQL: OFF + ARROW_FLIGHT: ON + ARROW_FLIGHT_SQL: ON ARROW_GANDIVA: OFF ARROW_HDFS: OFF ARROW_HOME: "${{ github.workspace }}/dist" @@ -340,7 +340,7 @@ jobs: ARROW_WITH_LZ4: OFF ARROW_WITH_OPENTELEMETRY: OFF ARROW_WITH_SNAPPY: ON - ARROW_WITH_ZLIB: OFF + ARROW_WITH_ZLIB: ON ARROW_WITH_ZSTD: ON BOOST_SOURCE: BUNDLED CMAKE_CXX_STANDARD: "17" From 3ed2d0286373834ef924ba903f998d0f28233eaa Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Mon, 27 May 2024 21:41:02 +1200 Subject: [PATCH 06/11] Use dollar-parenthesis syntax rather than backticks Co-authored-by: Sutou Kouhei --- .github/workflows/ruby.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 2a9301d8afb9..0ec57cd891fd 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -395,14 +395,14 @@ jobs: - name: Setup NuGet credentials for vcpkg caching shell: bash run: | - `./vcpkg/vcpkg.exe fetch nuget | tail -n 1` \ + $(vcpkg/vcpkg.exe fetch nuget | tail -n 1) \ sources add \ -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \ -storepasswordincleartext \ -name "GitHub" \ -username "$GITHUB_REPOSITORY_OWNER" \ -password "${{ secrets.GITHUB_TOKEN }}" - `./vcpkg/vcpkg.exe fetch nuget | tail -n 1` \ + $(vcpkg/vcpkg.exe fetch nuget | tail -n 1) \ setapikey "${{ secrets.GITHUB_TOKEN }}" \ -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" - name: Build C++ VCPKG dependencies From 333542cd38b2f22995beb15ed1bb4b3815530358 Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Mon, 27 May 2024 21:46:25 +1200 Subject: [PATCH 07/11] Tidy up from code review --- .github/workflows/ruby.yml | 1 - cpp/cmake_modules/Usevcpkg.cmake | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 0ec57cd891fd..f3a71bb6e23d 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -342,7 +342,6 @@ jobs: ARROW_WITH_SNAPPY: ON ARROW_WITH_ZLIB: ON ARROW_WITH_ZSTD: ON - BOOST_SOURCE: BUNDLED CMAKE_CXX_STANDARD: "17" CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/dist" diff --git a/cpp/cmake_modules/Usevcpkg.cmake b/cpp/cmake_modules/Usevcpkg.cmake index 01f10476ce3b..37a732f4b85a 100644 --- a/cpp/cmake_modules/Usevcpkg.cmake +++ b/cpp/cmake_modules/Usevcpkg.cmake @@ -237,6 +237,9 @@ set(LZ4_ROOT CACHE STRING "") if(CMAKE_HOST_WIN32) + set(utf8proc_MSVC_STATIC_LIB_SUFFIX + "" + CACHE STRING "") set(LZ4_MSVC_LIB_PREFIX "" CACHE STRING "") @@ -249,7 +252,4 @@ if(CMAKE_HOST_WIN32) set(ZSTD_MSVC_STATIC_LIB_SUFFIX "" CACHE STRING "") - set(utf8proc_MSVC_STATIC_LIB_SUFFIX - "" - CACHE STRING "") endif() From 07d33e5ac7c67267284d3d13a9e5ae43e63d77e3 Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Mon, 27 May 2024 21:53:52 +1200 Subject: [PATCH 08/11] Sort env variables alphabetically --- .github/workflows/ruby.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index f3a71bb6e23d..6492a960109c 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -313,16 +313,15 @@ jobs: strategy: fail-fast: false env: - VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' - ARROW_DEPENDENCY_SOURCE: VCPKG - ARROW_DEPENDENCY_USE_SHARED: OFF + ARROW_ACERO: ON ARROW_BOOST_USE_SHARED: OFF ARROW_BUILD_BENCHMARKS: OFF ARROW_BUILD_SHARED: ON ARROW_BUILD_STATIC: OFF ARROW_BUILD_TESTS: OFF - ARROW_ACERO: ON ARROW_DATASET: ON + ARROW_DEPENDENCY_SOURCE: VCPKG + ARROW_DEPENDENCY_USE_SHARED: OFF ARROW_FLIGHT: ON ARROW_FLIGHT_SQL: ON ARROW_GANDIVA: OFF @@ -346,6 +345,7 @@ jobs: CMAKE_GENERATOR: Ninja CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/dist" CMAKE_UNITY_BUILD: ON + VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' permissions: packages: write steps: From 6338e708dc24df903063a5c4a006847f7f84d4df Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Mon, 27 May 2024 21:57:41 +1200 Subject: [PATCH 09/11] Set VCPKG_ROOT in job env --- .github/workflows/ruby.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 6492a960109c..cd5364913399 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -346,6 +346,7 @@ jobs: CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/dist" CMAKE_UNITY_BUILD: ON VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' + VCPKG_ROOT: "${{ github.workspace }}/vcpkg" permissions: packages: write steps: @@ -365,7 +366,7 @@ jobs: - name: Install vcpkg shell: bash run: | - ci/scripts/install_vcpkg.sh ./vcpkg + ci/scripts/install_vcpkg.sh "$(cygpath --unix "${VCPKG_ROOT}")" - name: Install meson run: | python -m pip install meson @@ -412,9 +413,9 @@ jobs: shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - bash -c "VCPKG_ROOT=\"$(pwd)/vcpkg\" ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" + bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" - name: Build GLib shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - bash -c "VCPKG_ROOT=\"$(pwd)/vcpkg\" ci/scripts/c_glib_build.sh $(pwd) $(pwd)/build" + bash -c "ci/scripts/c_glib_build.sh $(pwd) $(pwd)/build" From fad5a3fa368c150e2b68d31ca9a758be83e0b4a6 Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Tue, 28 May 2024 08:56:38 +1200 Subject: [PATCH 10/11] Remove unnecessary cygpath call --- .github/workflows/ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index cd5364913399..a58a3517c6fa 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -366,7 +366,7 @@ jobs: - name: Install vcpkg shell: bash run: | - ci/scripts/install_vcpkg.sh "$(cygpath --unix "${VCPKG_ROOT}")" + ci/scripts/install_vcpkg.sh "${VCPKG_ROOT}" - name: Install meson run: | python -m pip install meson From fc51bc930bb841a9ccc64db760e82c2afc55f07a Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Tue, 28 May 2024 12:23:30 +1200 Subject: [PATCH 11/11] Apply suggestions from code review Co-authored-by: Sutou Kouhei --- .github/workflows/ruby.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index a58a3517c6fa..35c4460d47bc 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -405,8 +405,7 @@ jobs: $(vcpkg/vcpkg.exe fetch nuget | tail -n 1) \ setapikey "${{ secrets.GITHUB_TOKEN }}" \ -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" - - name: Build C++ VCPKG dependencies - shell: cmd + - name: Build C++ vcpkg dependencies run: | vcpkg\vcpkg.exe install --triplet x64-windows --x-manifest-root cpp --x-install-root build\cpp\vcpkg_installed - name: Build C++