Skip to content

GH-45800: [C++] Implement util configuration in Meson - #45824

Merged
kou merged 3 commits into
apache:mainfrom
WillAyd:meson-implement-util
Apr 10, 2025
Merged

kou merged 3 commits into
apache:mainfrom
WillAyd:meson-implement-util

Conversation

@WillAyd

@WillAyd WillAyd commented Mar 17, 2025 •

Copy link
Copy Markdown
Contributor

Rationale for this change

This continues to add support for Meson in the Arrow C++ codebase

What changes are included in this PR?

The util directory has been added to the Meson configuration

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #45800 has been automatically assigned in GitHub to PR creator.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #45800 has no components, please add labels for components.

@WillAyd

WillAyd commented Mar 17, 2025

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit *meson

@github-actions

Copy link
Copy Markdown

Revision: 67896cb4f75ff786ec3f52efd1640f6b59ec5a49

Submitted crossbow builds: ursacomputing/crossbow @ actions-b05af5f8a2

Task Status
test-conda-cpp-meson GitHub Actions

@WillAyd

WillAyd commented Mar 17, 2025

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit *meson

@github-actions

Copy link
Copy Markdown

Revision: f5cebe7ba0486744271af40b5d93c9d98a62540d

Submitted crossbow builds: ursacomputing/crossbow @ actions-8cfff641da

Task Status
test-conda-cpp-meson GitHub Actions

Comment thread cpp/src/arrow/util/meson.build Outdated
Comment on lines 202 to 212

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if host_machine.system() == 'windows'
# This manifest enables long file paths on Windows 10+
# See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later
if cpp_compiler.get_id() == 'msvc'
io_util_test_sources = ['io_util_test.cc', 'io_util_test.manifest']
else
io_util_test_sources = ['io_util_test.cc', 'io_util_test.rc']
endif
else
io_util_test_sources = ['io_util_test.cc']
endif
io_util_test_sources = ['io_util_test.cc']
if host_machine.system() == 'windows'
# This manifest enables long file paths on Windows 10+
# See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later
if cpp_compiler.get_id() == 'msvc'
io_util_test_sources += ['io_util_test.manifest']
else
io_util_test_sources += ['io_util_test.rc']
endif
endif

Can we use the following?

utility_test_srcs = [
    ...,
    'io_util_test.cc'
    ...
]
if host_machine.system() == 'windows'
    # This manifest enables long file paths on Windows 10+
    # See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later
    if cpp_compiler.get_id() == 'msvc'
        utility_test_srcs += ['io_util_test.manifest']
    else
        utility_test_srcs += ['io_util_test.rc']
    endif
endif

@WillAyd

WillAyd commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit *meson

@github-actions

Copy link
Copy Markdown

Revision: 39031254a0c9f86f641162c0b0c947f49b64fa10

Submitted crossbow builds: ursacomputing/crossbow @ actions-f5d42b5ad9

Task Status
test-conda-cpp-meson GitHub Actions

@WillAyd
WillAyd force-pushed the meson-implement-util branch from 3903125 to d1fcfed Compare March 18, 2025 15:12
@WillAyd

WillAyd commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit *meson

@github-actions

Copy link
Copy Markdown

Revision: d1fcfeda9b26d4c70dad27dbc0c00e90d4b5427a

Submitted crossbow builds: ursacomputing/crossbow @ actions-fbda2d1a9d

Task Status
test-conda-cpp-meson GitHub Actions

Comment thread cpp/src/arrow/util/meson.build Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do. I think there are ways to improve the terminology, but technically the arrow_test_dep becomes a disabler only if needs_testing is false. It is possible for needs_tests to be false while needs_testing is true. Without this extra condition these tests would build when -Dtests=false and -Dtesting=true

I do wonder if it wouldn't be better to have an arrow_test_dep and separately an arrow_testing_dep

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we need this here, we need it for test('arrow-utility-test', exc) too?

It seems that we don't need both arrow_test_dep and arrow_testing_dep. Can we use this instead?

if needs_tests
    arrow_test_dep = declare_dependency(
        link_with: [arrow_test_lib],
        dependencies: [arrow_dep, filesystem_dep, gmock_dep, gtest_main_dep],
    )
else
    arrow_test_dep = disabler()
endif

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on the arrow-utility-test - I can do that.

With respect to the if needs_tests, it depends how much we want to adhere to what CMake has in place. In fact, we used to use that same condition, but I had to change it from if needs_tests to if needs_testing in the benchmarks PR.

https://github.com/apache/arrow/pull/45793/files

Unless I am misreading the CMake configuration (which is certainly possible) it seems like it is possible to disable tests but turn the benchmarks on. In such a case, you would still need the current arrow_test_dep dependency to build benchmarks; the change you are proposing would add a dependency between the test suite and benchmark suite

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use separated dependency for benchmarks something like the following?

if needs_tests
    arrow_test_dep = declare_dependency(
        link_with: [arrow_test_lib],
        dependencies: [arrow_dep, filesystem_dep, gmock_dep, gtest_main_dep],
    )
else
    arrow_test_dep = disabler()
endif

if needs_benchmarks
  arrow_benchmark_dep = declare_dependency(
        dependencies: [benchmark_dep, arrow_test_dep],
    )
else
  arrow_benchmark_dep = disabler()
end

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can. Nice idea!

Comment thread cpp/src/arrow/util/meson.build Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need gtest_main_dep here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrow_test_dep already provides gtest_main_dep transitively

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, arrow_test_dep doesn't link to only libarrow_testing.so.

Then can we remove filesystem_dep from arrow-crc32-test dependencies?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice catch - yea we can do that for now

@WillAyd

WillAyd commented Apr 9, 2025

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit *meson

@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown

Revision: cc1cb9c

Submitted crossbow builds: ursacomputing/crossbow @ actions-16f3047112

Task Status
test-conda-cpp-meson GitHub Actions

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou
kou merged commit 9d9e9a5 into apache:main Apr 10, 2025
@conbench-apache-arrow

Copy link
Copy Markdown

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

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them.

zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Apr 15, 2025
…5824)

### Rationale for this change

This continues to add support for Meson in the Arrow C++ codebase

### What changes are included in this PR?

The util directory has been added to the Meson configuration

### Are these changes tested?

Yes

### Are there any user-facing changes?

No

* GitHub Issue: apache#45800

Authored-by: Will Ayd <william.ayd@icloud.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants