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


##########
cpp/src/arrow/filesystem/azurefs.h:
##########
@@ -59,7 +60,7 @@ class TestAzureOptions;
 /// - `AZURE_FEDERATED_TOKEN_FILE`
 ///
 /// Functions are provided for explicit configuration of credentials if that 
is preferred.
-struct ARROW_EXPORT AzureOptions {
+struct ARROW_AZURE_EXPORT AzureOptions {

Review Comment:
   The Meson build still compiles `filesystem/azurefs.cc` into `arrow_lib` and 
defines only `ARROW_EXPORTING` (`cpp/src/arrow/meson.build:371-372,575-583`). 
With this new annotation, Windows shared Meson builds instead mark 
`AzureOptions` and `AzureFileSystem` as `__declspec(dllimport)` while compiling 
their definitions, causing DLL-import definition errors such as MSVC C2491. 
Please update the Meson producer/consumer targets for the new Azure export 
macros, or split out the Azure library there too.



##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -964,9 +954,61 @@ if(ARROW_FILESYSTEM)
       filesystem/util_internal.cc)
 
   if(ARROW_AZURE)
-    list(APPEND ARROW_FILESYSTEM_SRCS filesystem/azurefs.cc)
-    set_source_files_properties(filesystem/azurefs.cc
+    set(ARROW_AZURE_STATIC_INSTALL_INTERFACE_LIBS Arrow::arrow_static)
+    if(Azure_SOURCE STREQUAL "SYSTEM")
+      list(APPEND ARROW_AZURE_STATIC_INSTALL_INTERFACE_LIBS 
${AZURE_SDK_LINK_LIBRARIES})
+    elseif(Azure_SOURCE STREQUAL "BUNDLED")
+      if(NOT WIN32)
+        list(APPEND ARROW_AZURE_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl
+             LibXml2::LibXml2)
+      endif()
+    endif()
+    set(ARROW_AZURE_LIB_SRCS filesystem/azurefs_module.cc 
filesystem/azurefs.cc)
+    set_source_files_properties(filesystem/azurefs_module.cc 
filesystem/azurefs.cc
                                 PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+    # If libarrow_azure.a is only built, "pkg-config --cflags --libs
+    # arrow-azure" outputs build flags for static linking not shared
+    # linking. ARROW_AZURE_PC_* except ARROW_AZURE_PC_*_PRIVATE are for the
+    # static linking case.
+    if(NOT ARROW_BUILD_SHARED AND ARROW_BUILD_STATIC)
+      string(APPEND ARROW_AZURE_PC_CFLAGS "${ARROW_AZURE_PC_CFLAGS_PRIVATE}")

Review Comment:
   `ARROW_AZURE_PC_CFLAGS_PRIVATE` is never populated, so neither `pkg-config 
--static arrow-azure` nor the static-only `.pc` file defines 
`ARROW_AZURE_STATIC`. On Windows, the new visibility header therefore marks 
Azure declarations as `dllimport` even when linking the static archive, causing 
unresolved import symbols. Please add `-DARROW_AZURE_STATIC` to the private 
compiler flags whenever static builds are enabled, before promoting them for 
static-only installations.



##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -964,9 +954,61 @@ if(ARROW_FILESYSTEM)
       filesystem/util_internal.cc)
 
   if(ARROW_AZURE)
-    list(APPEND ARROW_FILESYSTEM_SRCS filesystem/azurefs.cc)
-    set_source_files_properties(filesystem/azurefs.cc
+    set(ARROW_AZURE_STATIC_INSTALL_INTERFACE_LIBS Arrow::arrow_static)
+    if(Azure_SOURCE STREQUAL "SYSTEM")
+      list(APPEND ARROW_AZURE_STATIC_INSTALL_INTERFACE_LIBS 
${AZURE_SDK_LINK_LIBRARIES})
+    elseif(Azure_SOURCE STREQUAL "BUNDLED")
+      if(NOT WIN32)
+        list(APPEND ARROW_AZURE_STATIC_INSTALL_INTERFACE_LIBS CURL::libcurl
+             LibXml2::LibXml2)
+      endif()
+    endif()
+    set(ARROW_AZURE_LIB_SRCS filesystem/azurefs_module.cc 
filesystem/azurefs.cc)

Review Comment:
   Moving `azurefs.cc` out of libarrow breaks previously supported 
`abfs`/`abfss` URIs in C GLib: `garrow_file_system_create()` calls 
`FileSystemFromUri()`, but the binding never discovers or loads `arrow_azure`. 
Add optional Azure module discovery for both installed-library and build-tree 
configurations, ensure its registrar runs before URI dispatch, and update the 
corresponding package dependencies.



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