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

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 44070eb99f GH-41806: [GLib][CI] Use vcpkg for C++ dependencies when 
building GLib libraries with MSVC (#41839)
44070eb99f is described below

commit 44070eb99f0db907e1cf7a445bf7c6fea78e17fe
Author: Adam Reeve <[email protected]>
AuthorDate: Mon Jun 3 08:53:34 2024 +1200

    GH-41806: [GLib][CI] Use vcpkg for C++ dependencies when building GLib 
libraries with MSVC (#41839)
    
    ### Rationale for this change
    
    This is more consistent as vcpkg is now used for both the Arrow C++ 
dependencies and GLib library dependencies, and also fixes building 
arrow-flight-glib and arrow-flight-sql-glib which previously failed due to a 
missing zlib dependency.
    
    ### What changes are included in this PR?
    
    * Configure the MSVC GLib build to use VCPKG as the dependency source for 
the C++ build
    * Configure GitHub packages based vcpkg caching (see 
https://learn.microsoft.com/en-us/vcpkg/users/binarycaching#quickstart-github)
    * Enable building Flight and Flight SQL
    
    ### Are these changes tested?
    
    NA
    
    ### Are there any user-facing changes?
    
    No
    
    Because GitHub packages is being used for caching, this will start creating 
GitHub packages that are visible in the main page of the Arrow GitHub 
repository by default. Eg. you can see them in the right panel on the crossbow 
repo which also runs tasks that use GitHub packages for vcpkg caching: 
https://github.com/ursacomputing/crossbow.
    
    The Arrow repository doesn't currently publish any packages, so it would 
probably be best to hide these by default to avoid confusing users and adding 
unnecessary noise. Someone with admin privileges on the Arrow GitHub repository 
would need to click the cog on the home page and hide this section:
    
![hide_packages](https://github.com/apache/arrow/assets/626438/69e1be77-65e7-4a17-8e9e-6d7cf90834b5)
    
    If this isn't desirable I could look into other ways of caching instead, 
eg. using a file based cache combined with GitHub actions cache action, or the 
experimental GitHub actions cache in vcpkg.
    
    * GitHub Issue: #41806
    
    Lead-authored-by: Adam Reeve <[email protected]>
    Co-authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 .github/workflows/ruby.yml       | 35 ++++++++++++++++++++++++++++-------
 ci/scripts/cpp_build.sh          |  1 +
 cpp/cmake_modules/Usevcpkg.cmake |  3 +++
 3 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index 04f944f56c..35c4460d47 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -313,15 +313,17 @@ jobs:
     strategy:
       fail-fast: false
     env:
+      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_FLIGHT: OFF
-      ARROW_FLIGHT_SQL: OFF
+      ARROW_DEPENDENCY_SOURCE: VCPKG
+      ARROW_DEPENDENCY_USE_SHARED: OFF
+      ARROW_FLIGHT: ON
+      ARROW_FLIGHT_SQL: ON
       ARROW_GANDIVA: OFF
       ARROW_HDFS: OFF
       ARROW_HOME: "${{ github.workspace }}/dist"
@@ -337,13 +339,16 @@ 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"
       CMAKE_GENERATOR: Ninja
       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:
       - name: Disable Crash Dialogs
         run: |
@@ -361,7 +366,7 @@ jobs:
       - name: Install vcpkg
         shell: bash
         run: |
-          ci/scripts/install_vcpkg.sh ./vcpkg
+          ci/scripts/install_vcpkg.sh "${VCPKG_ROOT}"
       - name: Install meson
         run: |
           python -m pip install meson
@@ -387,6 +392,22 @@ 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
+        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: |
@@ -396,4 +417,4 @@ 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/c_glib_build.sh 
$(pwd) $(pwd)/build"
+          bash -c "ci/scripts/c_glib_build.sh $(pwd) $(pwd)/build"
diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh
index 6a3a53f253..3ee7fbd9d1 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} \
diff --git a/cpp/cmake_modules/Usevcpkg.cmake b/cpp/cmake_modules/Usevcpkg.cmake
index b6192468da..37a732f4b8 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 "")

Reply via email to