Copilot commented on code in PR #54905:
URL: https://github.com/apache/arrow/pull/54905#discussion_r4375156372


##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -992,8 +969,31 @@ if(ARROW_FILESYSTEM)
                                 PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
   endif()
   if(ARROW_GCS)
-    list(APPEND ARROW_FILESYSTEM_SRCS filesystem/gcsfs.cc 
filesystem/gcsfs_internal.cc)
-    set_source_files_properties(filesystem/gcsfs.cc 
filesystem/gcsfs_internal.cc
+    set(ARROW_GCS_STATIC_INSTALL_INTERFACE_LIBS Arrow::arrow_static)
+    if(google_cloud_cpp_storage_SOURCE STREQUAL "SYSTEM")
+      list(APPEND ARROW_GCS_STATIC_INSTALL_INTERFACE_LIBS 
google-cloud-cpp::storage)
+    elseif(google_cloud_cpp_storage_SOURCE STREQUAL "BUNDLED")
+      list(APPEND ARROW_GCS_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl)
+      if(absl_SOURCE STREQUAL "SYSTEM")
+        # Bundled google-cloud-cpp with system Abseil needs these for static 
consumers.
+        list(APPEND
+             ARROW_GCS_STATIC_INSTALL_INTERFACE_LIBS
+             absl::base
+             absl::cord
+             absl::crc32c
+             absl::memory
+             absl::optional
+             absl::span
+             absl::str_format
+             absl::strings
+             absl::time
+             absl::variant)
+      endif()
+    endif()
+    set(ARROW_GCS_LIB_SRCS filesystem/gcsfs_module.cc filesystem/gcsfs.cc
+                           filesystem/gcsfs_internal.cc)

Review Comment:
   Moving GCS out of `libarrow` leaves C GLib without its filesystem 
registration: `garrow_file_system_create()` still calls `FileSystemFromUri()`, 
but GLib neither links nor loads `arrow_gcs`. Consequently, `gs://` and 
`gcs://` URIs fail even when Arrow was built with GCS enabled. Add GCS 
dependency discovery for both installed-library and build-directory 
configurations in `c_glib/meson.build`, and ensure the binding loads the module 
so its registrar runs.



##########
cpp/src/arrow/filesystem/gcs_visibility.h:
##########
@@ -0,0 +1,49 @@
+// 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__)
+#  if defined(_MSC_VER)
+#    pragma warning(push)
+#    pragma warning(disable : 4251)
+#  else
+#    pragma GCC diagnostic ignored "-Wattributes"
+#  endif
+
+#  ifdef ARROW_GCS_STATIC
+#    define ARROW_GCS_EXPORT
+#  elif defined(ARROW_GCS_EXPORTING)
+#    define ARROW_GCS_EXPORT __declspec(dllexport)
+#  else
+#    define ARROW_GCS_EXPORT __declspec(dllimport)

Review Comment:
   Meson still compiles `gcsfs.cc` and `gcsfs_internal.cc` into `arrow` with 
only `ARROW_EXPORTING` (`cpp/src/arrow/meson.build:451–455,575–582`). On 
Windows/Cygwin, the new macro therefore marks GCS definitions as `dllimport`, 
breaking GCS-enabled shared builds. Update the Meson producer/consumer 
definitions, or move GCS into its own Meson target with the corresponding 
export/static flags.



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