You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a look into this and from what I can tell, gobject-introspection is only needed if building the Vala bindings, which I didn't test, but the GLib in vcpkg seems to work. There are some minor code changes needed to get the c_glib code compiling with MSVC, but the big problem I ran into is that MSVC does not export any symbols by default, so the dll fails to build. The problem is the same as what was reported in mesonbuild/meson#8716.
There's a Meson issue for allowing all symbols to be exported (mesonbuild/meson#2132) and this functionality exists in CMake, but unless that is added it looks like we either need to create a .def file with all of the symbols to export, or add __declspec(dllexport)/__declspec(dllimport) attributes to all of the methods that need to be exported. It seems like extending the GARROW_AVAILABLE_IN_* macros to add these might make sense, although there is also a need to add these attributes to some of the methods in the .hpp header files too, which aren't part of the GLib APIs but are used for sharing code across the different GLib library implementations.
I have managed to build the arrow-glib library with MSVC and get the tests from #37544 passing with some hackily put together changes (main...adamreeve:arrow:windows_glib). If this general approach looks reasonable I could tidy this up and make a PR?
Activity
adamreeve commentedon May 7, 2024
I had a look into this and from what I can tell, gobject-introspection is only needed if building the Vala bindings, which I didn't test, but the GLib in vcpkg seems to work. There are some minor code changes needed to get the c_glib code compiling with MSVC, but the big problem I ran into is that MSVC does not export any symbols by default, so the dll fails to build. The problem is the same as what was reported in mesonbuild/meson#8716.
There's a Meson issue for allowing all symbols to be exported (mesonbuild/meson#2132) and this functionality exists in CMake, but unless that is added it looks like we either need to create a
.deffile with all of the symbols to export, or add__declspec(dllexport)/__declspec(dllimport)attributes to all of the methods that need to be exported. It seems like extending theGARROW_AVAILABLE_IN_*macros to add these might make sense, although there is also a need to add these attributes to some of the methods in the.hppheader files too, which aren't part of the GLib APIs but are used for sharing code across the different GLib library implementations.I have managed to build the arrow-glib library with MSVC and get the tests from #37544 passing with some hackily put together changes (main...adamreeve:arrow:windows_glib). If this general approach looks reasonable I could tidy this up and make a PR?
kou commentedon May 7, 2024
Thanks! Could you open a PR?
GH-41681: [GLib] Generate separate version macros for each GLib libra…
GH-41134: [GLib] Support building arrow-glib with MSVC (#41599)
kou commentedon May 24, 2024
Issue resolved by pull request 41599
#41599
apacheGH-41681: [GLib] Generate separate version macros for each GLib…
apacheGH-41134: [GLib] Support building arrow-glib with MSVC (apache#…