Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

WillAyd
Copy link
Contributor

@WillAyd WillAyd commented Mar 17, 2025

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

Copy link

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

Copy link

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

@WillAyd
Copy link
Contributor Author

WillAyd commented Mar 17, 2025

@github-actions crossbow submit *meson

@github-actions github-actions bot added the awaiting review Awaiting review label Mar 17, 2025
Copy link

Revision: 67896cb

Submitted crossbow builds: ursacomputing/crossbow @ actions-b05af5f8a2

Task Status
test-conda-cpp-meson GitHub Actions

@WillAyd
Copy link
Contributor Author

WillAyd commented Mar 17, 2025

@github-actions crossbow submit *meson

Copy link

Revision: f5cebe7

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

Task Status
test-conda-cpp-meson GitHub Actions

Comment on lines 202 to 212
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
Copy link
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

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Mar 18, 2025
@WillAyd
Copy link
Contributor Author

WillAyd commented Mar 18, 2025

@github-actions crossbow submit *meson

@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Mar 18, 2025
Copy link

Revision: 3903125

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
Copy link
Contributor Author

WillAyd commented Mar 18, 2025

@github-actions crossbow submit *meson

Copy link

Revision: d1fcfed

Submitted crossbow builds: ursacomputing/crossbow @ actions-fbda2d1a9d

Task Status
test-conda-cpp-meson GitHub Actions

},
}

if needs_tests
Copy link
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
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
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

exc = executable(
key,
sources: val['sources'],
dependencies: [arrow_test_dep, val.get('dependencies', [])],
Copy link
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
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
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?

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants