kou commented on code in PR #41599:
URL: https://github.com/apache/arrow/pull/41599#discussion_r1596150100


##########
c_glib/arrow-glib/visibility.h:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+// Windows

Review Comment:
   We can remove this comment because this condition is straightforward.



##########
c_glib/arrow-glib/visibility.h:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+// Windows
+
+#  if defined(__cplusplus) && defined(__GNUC__) && !defined(__clang__)
+// Use C++ attribute syntax where possible to avoid GCC parser bug
+// 
(https://stackoverflow.com/questions/57993818/gcc-how-to-combine-attribute-dllexport-and-nodiscard-in-a-struct-de)

Review Comment:
   Could you use `/* ... */` style here?
   ```suggestion
   /*
    * Use C++ attribute syntax where possible to avoid GCC parser bug
    * 
(https://stackoverflow.com/questions/57993818/gcc-how-to-combine-attribute-dllexport-and-nodiscard-in-a-struct-de)
    */
   ```



##########
.github/workflows/ruby.yml:
##########
@@ -305,3 +305,96 @@ jobs:
           $Env:MAKE = "ridk exec make"
           $ErrorActionPreference = "Continue"
           rake -f ruby\Rakefile
+
+  windows-msvc:
+    name: AMD64 Windows MSVC GLib
+    runs-on: windows-2019
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
+    timeout-minutes: 90
+    strategy:
+      fail-fast: false
+    env:
+      ARROW_BOOST_USE_SHARED: OFF
+      ARROW_BUILD_BENCHMARKS: OFF
+      ARROW_BUILD_SHARED: ON
+      ARROW_BUILD_STATIC: OFF
+      ARROW_BUILD_TESTS: OFF
+      ARROW_DATASET: OFF
+      ARROW_FLIGHT: OFF
+      ARROW_FLIGHT_SQL: OFF
+      ARROW_HDFS: OFF
+      ARROW_HOME: /usr
+      ARROW_JEMALLOC: OFF
+      ARROW_MIMALLOC: ON
+      ARROW_ORC: OFF
+      ARROW_PARQUET: OFF
+      ARROW_SUBSTRAIT: OFF
+      ARROW_USE_GLOG: OFF
+      ARROW_VERBOSE_THIRDPARTY_BUILD: OFF
+      ARROW_WITH_BROTLI: OFF
+      ARROW_WITH_BZ2: OFF
+      ARROW_WITH_LZ4: OFF
+      ARROW_WITH_OPENTELEMETRY: OFF
+      ARROW_WITH_SNAPPY: ON
+      ARROW_WITH_ZLIB: ON
+      ARROW_WITH_ZSTD: ON
+      BOOST_SOURCE: BUNDLED
+      CMAKE_CXX_STANDARD: "17"
+      CMAKE_GENERATOR: Ninja
+      CMAKE_INSTALL_LIBDIR: bin
+      CMAKE_INSTALL_PREFIX: /usr
+      CMAKE_UNITY_BUILD: ON
+    steps:
+      - name: Disable Crash Dialogs
+        run: |
+          reg add `
+            "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
+            /v DontShowUI `
+            /t REG_DWORD `
+            /d 1 `
+            /f
+      - name: Checkout Arrow
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - name: Install vcpkg
+        shell: bash
+        run: |
+          ci/scripts/install_vcpkg.sh ./vcpkg
+      - name: Install ccache
+        shell: bash
+        run: |
+          ci/scripts/install_ccache.sh 4.6.3 /usr
+      - name: Setup ccache
+        shell: bash
+        run: |
+          ci/scripts/ccache_setup.sh
+      - name: ccache info
+        id: ccache-info
+        shell: bash
+        run: |
+          echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
+      - name: Cache ccache
+        uses: actions/cache@v4
+        with:
+          path: ${{ steps.ccache-info.outputs.cache-dir }}
+          key: cglib-ccache-windows-${{ env.CACHE_VERSION }}-${{ 
hashFiles('cpp/**') }}
+          restore-keys: cglib-ccache-windows-${{ env.CACHE_VERSION }}-

Review Comment:
   ```suggestion
             key: glib-ccache-msvc-${{ env.CACHE_VERSION }}-${{ 
hashFiles('cpp/**') }}
             restore-keys: glib-ccache-msvc-${{ env.CACHE_VERSION }}-
   ```



##########
ci/scripts/install_vcpkg.sh:
##########
@@ -25,7 +25,7 @@ if [ "$#" -lt 1 ]; then
 fi
 
 arrow_dir=$(cd -- "$(dirname -- "$0")/../.." && pwd -P)
-default_vcpkg_version=$(cat "${arrow_dir}/.env" | grep "VCPKG" | cut -d "=" 
-f2 | tr -d '"')
+default_vcpkg_version=$(cat "${arrow_dir}/.env" | grep "VCPKG" | cut -d "=" 
-f2 | cut -d "#" -f1 | tr -d '" ')

Review Comment:
   ```suggestion
   default_vcpkg_version=$(source "${arrow_dir}/.env" | echo "$VCPKG")
   ```



##########
ci/scripts/c_glib_build.sh:
##########
@@ -35,8 +36,16 @@ export CXXFLAGS="-DARROW_NO_DEPRECATED_API"
 
 mkdir -p ${build_dir}
 
+if [ "${BUILD_C_GLIB_WITH_VCPKG}" == "ON" ]; then

Review Comment:
   Can we use existing `${VCPKG_ROOT}` instead of new variable?
   
   ```suggestion
   if [ -n "${VCPKG_ROOT:-}" ]; then
   ```



##########
.github/workflows/ruby.yml:
##########
@@ -305,3 +305,96 @@ jobs:
           $Env:MAKE = "ridk exec make"
           $ErrorActionPreference = "Continue"
           rake -f ruby\Rakefile
+
+  windows-msvc:

Review Comment:
   Could you rename existing `windows:` to `windows-mingw:`?



##########
c_glib/arrow-glib/visibility.h:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#pragma once
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+// Windows
+
+#  if defined(__cplusplus) && defined(__GNUC__) && !defined(__clang__)
+// Use C++ attribute syntax where possible to avoid GCC parser bug
+// 
(https://stackoverflow.com/questions/57993818/gcc-how-to-combine-attribute-dllexport-and-nodiscard-in-a-struct-de)
+#    define GARROW_DLLEXPORT [[gnu::dllexport]]
+#    define GARROW_DLLIMPORT [[gnu::dllimport]]
+#  else
+#    define GARROW_DLLEXPORT __declspec(dllexport)
+#    define GARROW_DLLIMPORT __declspec(dllimport)
+#  endif
+
+#  ifdef GARROW_EXPORTING
+#    define GARROW_EXPORT GARROW_DLLEXPORT
+#  else
+#    define GARROW_EXPORT GARROW_DLLIMPORT
+#  endif

Review Comment:
   GLib uses 
`XXX_EXPORT`/`XXX_IMPORT`/`XXX_API`/`XXX_COMPILATION`/`XXX_STATIC_COMPILATION`: 
   
https://gitlab.gnome.org/GNOME/glib/-/blob/main/tools/gen-visibility-macros.py?ref_type=heads#L92-125
   
   How about using the same naming convention?
   
   ```suggestion
   #    define GARROW_EXPORT [[gnu::dllexport]]
   #    define GARROW_IMPORT [[gnu::dllimport]]
   #  else
   #    define GARROW_EXPORT __declspec(dllexport)
   #    define GARROW_IMPORT __declspec(dllimport)
   #  endif
   #  ifdef GARROW_STATIC_COMPILATION
   #    undef GARROW_EXPORT
   #    define GARROW_EXPORT
   #    undef GARROW_IMPORT
   #    define GARROW_IMPORT
   #  endif
   
   #  ifdef GARROW_COMPILATION
   #    define GARROW_API GARROW_EXPORT
   #  else
   #    define GARROW_API GARROW_IMPORT
   #  endif
   
   #  define GARROW_EXTERN GARROW_API extern
   ```



##########
.github/workflows/ruby.yml:
##########
@@ -305,3 +305,96 @@ jobs:
           $Env:MAKE = "ridk exec make"
           $ErrorActionPreference = "Continue"
           rake -f ruby\Rakefile
+
+  windows-msvc:
+    name: AMD64 Windows MSVC GLib
+    runs-on: windows-2019
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
+    timeout-minutes: 90
+    strategy:
+      fail-fast: false
+    env:
+      ARROW_BOOST_USE_SHARED: OFF
+      ARROW_BUILD_BENCHMARKS: OFF
+      ARROW_BUILD_SHARED: ON
+      ARROW_BUILD_STATIC: OFF
+      ARROW_BUILD_TESTS: OFF
+      ARROW_DATASET: OFF
+      ARROW_FLIGHT: OFF
+      ARROW_FLIGHT_SQL: OFF
+      ARROW_HDFS: OFF
+      ARROW_HOME: /usr
+      ARROW_JEMALLOC: OFF
+      ARROW_MIMALLOC: ON
+      ARROW_ORC: OFF
+      ARROW_PARQUET: OFF
+      ARROW_SUBSTRAIT: OFF
+      ARROW_USE_GLOG: OFF
+      ARROW_VERBOSE_THIRDPARTY_BUILD: OFF
+      ARROW_WITH_BROTLI: OFF
+      ARROW_WITH_BZ2: OFF
+      ARROW_WITH_LZ4: OFF
+      ARROW_WITH_OPENTELEMETRY: OFF
+      ARROW_WITH_SNAPPY: ON
+      ARROW_WITH_ZLIB: ON
+      ARROW_WITH_ZSTD: ON
+      BOOST_SOURCE: BUNDLED
+      CMAKE_CXX_STANDARD: "17"
+      CMAKE_GENERATOR: Ninja
+      CMAKE_INSTALL_LIBDIR: bin
+      CMAKE_INSTALL_PREFIX: /usr
+      CMAKE_UNITY_BUILD: ON
+    steps:
+      - name: Disable Crash Dialogs
+        run: |
+          reg add `
+            "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
+            /v DontShowUI `
+            /t REG_DWORD `
+            /d 1 `
+            /f
+      - name: Checkout Arrow
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - name: Install vcpkg
+        shell: bash
+        run: |
+          ci/scripts/install_vcpkg.sh ./vcpkg
+      - name: Install ccache
+        shell: bash
+        run: |
+          ci/scripts/install_ccache.sh 4.6.3 /usr
+      - name: Setup ccache
+        shell: bash
+        run: |
+          ci/scripts/ccache_setup.sh
+      - name: ccache info
+        id: ccache-info
+        shell: bash
+        run: |
+          echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
+      - name: Cache ccache
+        uses: actions/cache@v4
+        with:
+          path: ${{ steps.ccache-info.outputs.cache-dir }}
+          key: cglib-ccache-windows-${{ env.CACHE_VERSION }}-${{ 
hashFiles('cpp/**') }}
+          restore-keys: cglib-ccache-windows-${{ env.CACHE_VERSION }}-
+        env:
+          # We can invalidate the current cache by updating this.
+          CACHE_VERSION: "2024-05-09"
+      - name: Build
+        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"
+      - name: Build GLib
+        shell: cmd
+        # Meson finds the gnu link.exe instead of MSVC link.exe due to using 
bash,
+        # so we need to make sure the MSCV link.exe is first in $PATH
+        run: |
+          call "C:\Program Files (x86)\Microsoft Visual 
Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
+          set CMAKE_BUILD_PARALLEL_LEVEL=%NUMBER_OF_PROCESSORS%

Review Comment:
   Do we need this?
   It seems that we use Ninja and Ninja uses parallel build by default.



##########
.github/workflows/ruby.yml:
##########
@@ -305,3 +305,96 @@ jobs:
           $Env:MAKE = "ridk exec make"
           $ErrorActionPreference = "Continue"
           rake -f ruby\Rakefile
+
+  windows-msvc:
+    name: AMD64 Windows MSVC GLib
+    runs-on: windows-2019
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
+    timeout-minutes: 90
+    strategy:
+      fail-fast: false
+    env:
+      ARROW_BOOST_USE_SHARED: OFF
+      ARROW_BUILD_BENCHMARKS: OFF
+      ARROW_BUILD_SHARED: ON
+      ARROW_BUILD_STATIC: OFF
+      ARROW_BUILD_TESTS: OFF
+      ARROW_DATASET: OFF
+      ARROW_FLIGHT: OFF
+      ARROW_FLIGHT_SQL: OFF
+      ARROW_HDFS: OFF
+      ARROW_HOME: /usr
+      ARROW_JEMALLOC: OFF
+      ARROW_MIMALLOC: ON
+      ARROW_ORC: OFF
+      ARROW_PARQUET: OFF
+      ARROW_SUBSTRAIT: OFF
+      ARROW_USE_GLOG: OFF
+      ARROW_VERBOSE_THIRDPARTY_BUILD: OFF
+      ARROW_WITH_BROTLI: OFF
+      ARROW_WITH_BZ2: OFF
+      ARROW_WITH_LZ4: OFF
+      ARROW_WITH_OPENTELEMETRY: OFF
+      ARROW_WITH_SNAPPY: ON
+      ARROW_WITH_ZLIB: ON
+      ARROW_WITH_ZSTD: ON
+      BOOST_SOURCE: BUNDLED
+      CMAKE_CXX_STANDARD: "17"
+      CMAKE_GENERATOR: Ninja
+      CMAKE_INSTALL_LIBDIR: bin
+      CMAKE_INSTALL_PREFIX: /usr
+      CMAKE_UNITY_BUILD: ON
+    steps:
+      - name: Disable Crash Dialogs
+        run: |
+          reg add `
+            "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
+            /v DontShowUI `
+            /t REG_DWORD `
+            /d 1 `
+            /f
+      - name: Checkout Arrow
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - name: Install vcpkg
+        shell: bash
+        run: |
+          ci/scripts/install_vcpkg.sh ./vcpkg
+      - name: Install ccache
+        shell: bash
+        run: |
+          ci/scripts/install_ccache.sh 4.6.3 /usr
+      - name: Setup ccache
+        shell: bash
+        run: |
+          ci/scripts/ccache_setup.sh
+      - name: ccache info
+        id: ccache-info
+        shell: bash
+        run: |
+          echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
+      - name: Cache ccache
+        uses: actions/cache@v4
+        with:
+          path: ${{ steps.ccache-info.outputs.cache-dir }}
+          key: cglib-ccache-windows-${{ env.CACHE_VERSION }}-${{ 
hashFiles('cpp/**') }}
+          restore-keys: cglib-ccache-windows-${{ env.CACHE_VERSION }}-
+        env:
+          # We can invalidate the current cache by updating this.
+          CACHE_VERSION: "2024-05-09"
+      - name: Build

Review Comment:
   ```suggestion
         - name: Build C++
   ```



##########
c_glib/arrow-glib/array-builder.h:
##########
@@ -22,70 +22,97 @@
 #include <arrow-glib/array.h>
 #include <arrow-glib/decimal.h>
 #include <arrow-glib/interval.h>
+#include <arrow-glib/visibility.h>
 
 G_BEGIN_DECLS
 
 #define GARROW_TYPE_ARRAY_BUILDER (garrow_array_builder_get_type())
+GARROW_EXPORT
 G_DECLARE_DERIVABLE_TYPE(
   GArrowArrayBuilder, garrow_array_builder, GARROW, ARRAY_BUILDER, GObject)
 struct _GArrowArrayBuilderClass
 {
   GObjectClass parent_class;
 };
 
+GARROW_EXPORT
 GArrowDataType *
 garrow_array_builder_get_value_data_type(GArrowArrayBuilder *builder);
+
+GARROW_EXPORT
 GArrowType
 garrow_array_builder_get_value_type(GArrowArrayBuilder *builder);
 
+GARROW_EXPORT
 GArrowArray *
 garrow_array_builder_finish(GArrowArrayBuilder *builder, GError **error);
 
 GARROW_AVAILABLE_IN_2_0
+GARROW_EXPORT

Review Comment:
   Let's add this macro to `GARROW_AVAILABLE_IN_XXX`. GLib does it.



##########
.github/workflows/ruby.yml:
##########
@@ -305,3 +305,96 @@ jobs:
           $Env:MAKE = "ridk exec make"
           $ErrorActionPreference = "Continue"
           rake -f ruby\Rakefile
+
+  windows-msvc:
+    name: AMD64 Windows MSVC GLib
+    runs-on: windows-2019
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
+    timeout-minutes: 90
+    strategy:
+      fail-fast: false
+    env:
+      ARROW_BOOST_USE_SHARED: OFF
+      ARROW_BUILD_BENCHMARKS: OFF
+      ARROW_BUILD_SHARED: ON
+      ARROW_BUILD_STATIC: OFF
+      ARROW_BUILD_TESTS: OFF
+      ARROW_DATASET: OFF
+      ARROW_FLIGHT: OFF
+      ARROW_FLIGHT_SQL: OFF
+      ARROW_HDFS: OFF
+      ARROW_HOME: /usr
+      ARROW_JEMALLOC: OFF
+      ARROW_MIMALLOC: ON
+      ARROW_ORC: OFF
+      ARROW_PARQUET: OFF
+      ARROW_SUBSTRAIT: OFF
+      ARROW_USE_GLOG: OFF
+      ARROW_VERBOSE_THIRDPARTY_BUILD: OFF
+      ARROW_WITH_BROTLI: OFF
+      ARROW_WITH_BZ2: OFF
+      ARROW_WITH_LZ4: OFF
+      ARROW_WITH_OPENTELEMETRY: OFF
+      ARROW_WITH_SNAPPY: ON
+      ARROW_WITH_ZLIB: ON
+      ARROW_WITH_ZSTD: ON
+      BOOST_SOURCE: BUNDLED
+      CMAKE_CXX_STANDARD: "17"
+      CMAKE_GENERATOR: Ninja
+      CMAKE_INSTALL_LIBDIR: bin
+      CMAKE_INSTALL_PREFIX: /usr
+      CMAKE_UNITY_BUILD: ON
+    steps:
+      - name: Disable Crash Dialogs
+        run: |
+          reg add `
+            "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
+            /v DontShowUI `
+            /t REG_DWORD `
+            /d 1 `
+            /f
+      - name: Checkout Arrow
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - name: Install vcpkg
+        shell: bash
+        run: |
+          ci/scripts/install_vcpkg.sh ./vcpkg
+      - name: Install ccache
+        shell: bash
+        run: |
+          ci/scripts/install_ccache.sh 4.6.3 /usr
+      - name: Setup ccache
+        shell: bash
+        run: |
+          ci/scripts/ccache_setup.sh
+      - name: ccache info
+        id: ccache-info
+        shell: bash
+        run: |
+          echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
+      - name: Cache ccache
+        uses: actions/cache@v4
+        with:
+          path: ${{ steps.ccache-info.outputs.cache-dir }}
+          key: cglib-ccache-windows-${{ env.CACHE_VERSION }}-${{ 
hashFiles('cpp/**') }}
+          restore-keys: cglib-ccache-windows-${{ env.CACHE_VERSION }}-
+        env:
+          # We can invalidate the current cache by updating this.
+          CACHE_VERSION: "2024-05-09"
+      - name: Build
+        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"
+      - name: Build GLib
+        shell: cmd
+        # Meson finds the gnu link.exe instead of MSVC link.exe due to using 
bash,
+        # so we need to make sure the MSCV link.exe is first in $PATH

Review Comment:
   Can we move it to `ci/scripts/c_glib_build.sh`?
   



##########
ci/scripts/c_glib_build.sh:
##########
@@ -35,8 +36,16 @@ export CXXFLAGS="-DARROW_NO_DEPRECATED_API"
 
 mkdir -p ${build_dir}
 
+if [ "${BUILD_C_GLIB_WITH_VCPKG}" == "ON" ]; then
+    vcpkg_install_root="${build_root}/vcpkg_installed"
+    $VCPKG_ROOT/vcpkg install --x-manifest-root=${source_dir} 
--x-install-root=${vcpkg_install_root}
+    export 
PKG_CONFIG="${vcpkg_install_root}/x64-windows/tools/pkgconf/pkgconf.exe"
+    export 
PKG_CONFIG_PATH="${vcpkg_install_root}/x64-windows/lib/pkgconfig:${PKG_CONFIG_PATH}"

Review Comment:
   Could you use `meson setup`'s `--pkg-config-path` instead?



##########
.github/workflows/ruby.yml:
##########
@@ -305,3 +305,96 @@ jobs:
           $Env:MAKE = "ridk exec make"
           $ErrorActionPreference = "Continue"
           rake -f ruby\Rakefile
+
+  windows-msvc:
+    name: AMD64 Windows MSVC GLib
+    runs-on: windows-2019
+    if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
+    timeout-minutes: 90
+    strategy:
+      fail-fast: false
+    env:
+      ARROW_BOOST_USE_SHARED: OFF
+      ARROW_BUILD_BENCHMARKS: OFF
+      ARROW_BUILD_SHARED: ON
+      ARROW_BUILD_STATIC: OFF
+      ARROW_BUILD_TESTS: OFF
+      ARROW_DATASET: OFF
+      ARROW_FLIGHT: OFF
+      ARROW_FLIGHT_SQL: OFF
+      ARROW_HDFS: OFF
+      ARROW_HOME: /usr
+      ARROW_JEMALLOC: OFF
+      ARROW_MIMALLOC: ON
+      ARROW_ORC: OFF
+      ARROW_PARQUET: OFF
+      ARROW_SUBSTRAIT: OFF
+      ARROW_USE_GLOG: OFF
+      ARROW_VERBOSE_THIRDPARTY_BUILD: OFF
+      ARROW_WITH_BROTLI: OFF
+      ARROW_WITH_BZ2: OFF
+      ARROW_WITH_LZ4: OFF
+      ARROW_WITH_OPENTELEMETRY: OFF
+      ARROW_WITH_SNAPPY: ON
+      ARROW_WITH_ZLIB: ON
+      ARROW_WITH_ZSTD: ON
+      BOOST_SOURCE: BUNDLED
+      CMAKE_CXX_STANDARD: "17"
+      CMAKE_GENERATOR: Ninja
+      CMAKE_INSTALL_LIBDIR: bin
+      CMAKE_INSTALL_PREFIX: /usr
+      CMAKE_UNITY_BUILD: ON
+    steps:
+      - name: Disable Crash Dialogs
+        run: |
+          reg add `
+            "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
+            /v DontShowUI `
+            /t REG_DWORD `
+            /d 1 `
+            /f
+      - name: Checkout Arrow
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - name: Install vcpkg
+        shell: bash
+        run: |
+          ci/scripts/install_vcpkg.sh ./vcpkg
+      - name: Install ccache
+        shell: bash
+        run: |
+          ci/scripts/install_ccache.sh 4.6.3 /usr
+      - name: Setup ccache
+        shell: bash
+        run: |
+          ci/scripts/ccache_setup.sh
+      - name: ccache info
+        id: ccache-info
+        shell: bash
+        run: |
+          echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
+      - name: Cache ccache
+        uses: actions/cache@v4
+        with:
+          path: ${{ steps.ccache-info.outputs.cache-dir }}
+          key: cglib-ccache-windows-${{ env.CACHE_VERSION }}-${{ 
hashFiles('cpp/**') }}
+          restore-keys: cglib-ccache-windows-${{ env.CACHE_VERSION }}-
+        env:
+          # We can invalidate the current cache by updating this.
+          CACHE_VERSION: "2024-05-09"
+      - name: Build

Review Comment:
   Can we also use vcpkg to install dependencies of C++?



##########
c_glib/arrow-glib/array-builder.cpp:
##########
@@ -231,8 +231,14 @@ garrow_array_builder_append_values(GArrowArrayBuilder 
*builder,
   if (n_remains > 0) {
     ++n_loops;
   }
+#ifdef _MSVC_LANG
+  std::vector<uint8_t> data_vec(value_size * chunk_size);
+  uint8_t *data = data_vec.data();

Review Comment:
   We can always use this style. (We can remove `uint8_t data[value_size * 
chunk_size]` style.)



##########
c_glib/vcpkg.json:
##########
@@ -0,0 +1,8 @@
+{
+  "name": "arrow-glib",
+  "version-string": "",

Review Comment:
   ```suggestion
     "version-string": "17.0.0-SNAPSHOT",
   ```
   
   We can update this automatically in our release process:
   
   ```diff
   diff --git a/dev/release/01-prepare-test.rb b/dev/release/01-prepare-test.rb
   index 8fb23f45f0..11e7561281 100644
   --- a/dev/release/01-prepare-test.rb
   +++ b/dev/release/01-prepare-test.rb
   @@ -108,6 +108,13 @@ class PrepareTest < Test::Unit::TestCase
               "+version = '#{@release_version}'"],
            ],
          },
   +      {
   +        path: "c_glib/vcpkg.json",
   +        hunks: [
   +          ["-  \"version-string\": \"#{@snapshot_version}\",",
   +           "+  \"version-string\": \"#{@release_version}\","],
   +        ],
   +      },
          {
            path: "ci/scripts/PKGBUILD",
            hunks: [
   diff --git a/dev/release/post-11-bump-versions-test.rb 
b/dev/release/post-11-bump-versions-test.rb
   index 78d9320bfb..818a0a4b61 100644
   --- a/dev/release/post-11-bump-versions-test.rb
   +++ b/dev/release/post-11-bump-versions-test.rb
   @@ -86,6 +86,13 @@ class PostBumpVersionsTest < Test::Unit::TestCase
               "+version = '#{@next_snapshot_version}'"],
            ],
          },
   +      {
   +        path: "c_glib/vcpkg.json",
   +        hunks: [
   +          ["-  \"version-string\": \"#{@snapshot_version}\",",
   +           "+  \"version-string\": \"#{@next_snapshot_version}\","],
   +        ],
   +      },
          {
            path: "ci/scripts/PKGBUILD",
            hunks: [
   diff --git a/dev/release/utils-prepare.sh b/dev/release/utils-prepare.sh
   index 5136708722..3de33625d3 100644
   --- a/dev/release/utils-prepare.sh
   +++ b/dev/release/utils-prepare.sh
   @@ -40,6 +40,12 @@ update_versions() {
        meson.build
      rm -f meson.build.bak
      git add meson.build
   +
   +  sed -i.bak -E -e \
   +    "s/\"version-string\": \".+\"/\"version-string\": \"${version}\"/" \
   +    vcpkg.json
   +  rm -f vcpkg.json.bak
   +  git add vcpkg.json
      popd
    
      pushd "${ARROW_DIR}/ci/scripts"
   ```



-- 
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]

Reply via email to