arrow icon indicating copy to clipboard operation
arrow copied to clipboard

GH-46714: [C++] Use hidden symbol visibility in Meson configuration

Open WillAyd opened this issue 6 months ago • 8 comments

Rationale for this change

This will eventually make it easier to support Windows through the Meson configuration, while also providing the documented benefits of hidden symbol visibility

What changes are included in this PR?

Meson libraries have been set to use hidden symbol visibility, and corresponding definitions have been updated to use the ARROW_EXPORT macro

Are these changes tested?

Yes

Are there any user-facing changes?

No

  • GitHub Issue: #46714

WillAyd avatar Jun 04 '25 21:06 WillAyd

:warning: GitHub issue #46714 has been automatically assigned in GitHub to PR creator.

github-actions[bot] avatar Jun 04 '25 21:06 github-actions[bot]

FWIW the hidden symbol visibility appears to shave a couple MB off of the libarrow release size (43MB -> 41 MB locally)

WillAyd avatar Jun 04 '25 22:06 WillAyd

This will eventually make it easier to support Windows through the Meson configuration

Why is that?

pitrou avatar Jun 05 '25 08:06 pitrou

This will eventually make it easier to support Windows through the Meson configuration

Why is that?

The idea is just that Windows has a harder requirement around symbols not being public by default. Of course, there are extra macros that would need to be defined to fully support the Windows linker requirements, but this is at least a sanity check that we are exporting the right symbols. I am also under the assumption that most developers are on *nix platforms, so it helps them detect potential symbol export issues sooner, rather than waiting for them to pop up in Windows CI

WillAyd avatar Jun 05 '25 11:06 WillAyd

It would be nice to try applying those changes on the CMake side as well. I agree that it would be good hygiene to have to mark exported symbols explicitly.

pitrou avatar Jun 05 '25 11:06 pitrou

It would be nice to try applying those changes on the CMake side as well. I agree that it would be good hygiene to have to mark exported symbols explicitly.

Any objection to doing this as a follow up? I did try that previously and ran into issues with some of the downstream crossbow jobs specifically on macOS, so I'm a bit hesitant to be opening a pandora's box with the CMake config in this PR

WillAyd avatar Jun 06 '25 15:06 WillAyd

No, it's fine.

pitrou avatar Jun 09 '25 08:06 pitrou

OK all green with the new compute structure in place. Let me know if any more feedback

WillAyd avatar Jun 25 '25 23:06 WillAyd

Hey @kou no rush on this if you have been busy with pre-release activities, but if you have any time would appreciate another look. Thanks!

WillAyd avatar Jul 01 '25 13:07 WillAyd

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 3b3684bb7d400b1f93d9aa17ff8f6c98641abea4.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.