You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "WillAyd (via GitHub)" <gi...@apache.org> on 2025/03/13 19:08:02 UTC

[PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

WillAyd opened a new pull request, #45768:
URL: https://github.com/apache/arrow/pull/45768

   ### Rationale for this change
   
   The recently added support for Meson compilation fails during the compilation step when using a non-system provided version of Boost
   
   ### What changes are included in this PR?
   
   This PR makes it so that the wrapdb version of Boost will compile the project correctly
   
   ### Are these changes tested?
   
   Yes
   
   ### Are there any user-facing changes?
   
   No
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd closed pull request #45768: GH-45767: [C++] Fix Meson compilation issue with non-system Boost
URL: https://github.com/apache/arrow/pull/45768


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994689920


##########
cpp/src/arrow/meson.build:
##########
@@ -371,25 +371,38 @@ install_headers(
 )
 
 if needs_tests
-    filesystem_dep = dependency(
+    boost_dep = dependency(
         'boost',
         modules: ['filesystem'],

Review Comment:
   To clarify the updated code, with Meson a call to:
   
   ```python
   boost_dep = declare_dependency('boost')
   ```
   
   Will return a dependency to the header only library for boost. If you additionally call with a module like:
   
   ```python
   filesystem_dep = dependency('boost', modules: 'filesystem')
   ```
   
   The dependency will then cause linkage against the specified module(s)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1995771866


##########
cpp/src/arrow/meson.build:
##########
@@ -356,38 +356,82 @@ install_headers(
 )
 
 if needs_tests
+    boost_dep = dependency('boost', include_type: 'system', required: false)
+
+    asio_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'asio',
+        required: false,
+    )
+
     filesystem_dep = dependency(
         'boost',
-        modules: ['filesystem'],
+        include_type: 'system',
+        modules: 'filesystem',
         required: false,
     )
-    if not filesystem_dep.found()
+
+    process_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'process',
+        required: false,
+    )
+
+    if not (boost_dep.found()
+and asio_dep.found()
+and filesystem_dep.found()
+and process_dep.found()
+)
         cmake = import('cmake')
         boost_opt = cmake.subproject_options()
         boost_opt.add_cmake_defines(
-            {'BOOST_INCLUDE_LIBRARIES': 'filesystem;system'},
+            {'BOOST_INCLUDE_LIBRARIES': 'asio;filesystem;process'},
         )
         boost_proj = cmake.subproject('boost', options: boost_opt)
-        filesystem_dep = boost_proj.dependency('boost_filesystem')
+        boost_dep = boost_proj.dependency(
+            'boost_headers',
+            include_type: 'system',
+        )
+        asio_dep = boost_proj.dependency('boost_asio', include_type: 'system')
+        filesystem_dep = boost_proj.dependency(
+            'boost_filesystem',
+            include_type: 'system',
+        )
+        process_dep = boost_proj.dependency(
+            'boost_process',
+            include_type: 'system',
+        )
     endif
 
     gtest_main_dep = dependency('gtest_main')
     gmock_dep = dependency('gmock')
 else
+    boost_dep = disabler()
+    asio_dep = disabler()
     filesystem_dep = disabler()
     gtest_main_dep = disabler()
     gmock_dep = disabler()
+    process_dep = disabler()
 endif
 
 arrow_test_lib = static_library(
     'arrow_testing',
     sources: arrow_testing_srcs,
-    dependencies: [arrow_dep, filesystem_dep, gtest_main_dep],
+    dependencies: [
+        arrow_dep,
+        asio_dep,
+        boost_dep,
+        filesystem_dep,
+        gtest_main_dep,

Review Comment:
   I can open a separate issue for this, but if you swap out gtest_main for gtest you will get a linker error
   
   ```
   FAILED: src/arrow/arrow_array_test 
   c++  -o src/arrow/arrow_array_test src/arrow/arrow_array_test.p/array_array_test.cc.o src/arrow/arrow_array_test.p/array_array_binary_test.cc.o src/arrow/arrow_array_test.p/array_array_dict_test.cc.o src/arrow/arrow_array_test.p/array_array_list_test.cc.o src/arrow/arrow_array_test.p/array_array_list_view_test.cc.o src/arrow/arrow_array_test.p/array_array_run_end_test.cc.o src/arrow/arrow_array_test.p/array_array_struct_test.cc.o src/arrow/arrow_array_test.p/array_array_union_test.cc.o src/arrow/arrow_array_test.p/array_array_view_test.cc.o src/arrow/arrow_array_test.p/array_statistics_test.cc.o src/arrow/arrow_array_test.p/.._.._subprojects_googletest-1.15.2_googletest_src_gtest-all.cc.o src/arrow/arrow_array_test.p/.._.._subprojects_googletest-1.15.2_googlemock_src_gmock-all.cc.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/:$ORIGIN/../../subprojects/flatbuffers-24.3.6' -Wl,-rpath-link,/home/willayd/clones/arrow/cpp/builddir/src/arrow -Wl,-rpath-link,/home/willayd/clon
 es/arrow/cpp/builddir/subprojects/flatbuffers-24.3.6 -Wl,--start-group src/arrow/libarrow_testing.a src/arrow/libarrow.so subprojects/boost-1.87.0/libboost_process.a subprojects/boost-1.87.0/libboost_filesystem.a -Wl,--end-group -pthread
   /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
   (.text+0x1b): undefined reference to `main'
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994158973


##########
cpp/subprojects/boost.wrap:
##########
@@ -21,7 +21,3 @@ source_filename = boost-1.87.0-cmake.tar.gz
 source_hash = 78fbf579e3caf0f47517d3fb4d9301852c3154bfecdc5eeebd9b2b0292366f5b
 directory = boost-1.87.0
 method = cmake
-

Review Comment:
   I thought this section was required but it appears superfluous



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994982368


##########
cpp/src/arrow/meson.build:
##########
@@ -356,38 +356,82 @@ install_headers(
 )
 
 if needs_tests
+    boost_dep = dependency('boost', include_type: 'system', required: false)
+
+    asio_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'asio',
+        required: false,
+    )
+
     filesystem_dep = dependency(
         'boost',
-        modules: ['filesystem'],
+        include_type: 'system',
+        modules: 'filesystem',
         required: false,
     )
-    if not filesystem_dep.found()
+
+    process_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'process',
+        required: false,
+    )
+
+    if not (boost_dep.found()
+and asio_dep.found()
+and filesystem_dep.found()
+and process_dep.found()
+)

Review Comment:
   Oh... This is a weird format by `meson format`...



##########
cpp/src/arrow/meson.build:
##########
@@ -356,38 +356,82 @@ install_headers(
 )
 
 if needs_tests
+    boost_dep = dependency('boost', include_type: 'system', required: false)
+
+    asio_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'asio',
+        required: false,
+    )
+
     filesystem_dep = dependency(
         'boost',
-        modules: ['filesystem'],
+        include_type: 'system',
+        modules: 'filesystem',
         required: false,
     )
-    if not filesystem_dep.found()
+
+    process_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'process',
+        required: false,
+    )
+
+    if not (boost_dep.found()
+and asio_dep.found()
+and filesystem_dep.found()
+and process_dep.found()
+)
         cmake = import('cmake')
         boost_opt = cmake.subproject_options()
         boost_opt.add_cmake_defines(
-            {'BOOST_INCLUDE_LIBRARIES': 'filesystem;system'},
+            {'BOOST_INCLUDE_LIBRARIES': 'asio;filesystem;process'},
         )
         boost_proj = cmake.subproject('boost', options: boost_opt)
-        filesystem_dep = boost_proj.dependency('boost_filesystem')
+        boost_dep = boost_proj.dependency(
+            'boost_headers',
+            include_type: 'system',
+        )
+        asio_dep = boost_proj.dependency('boost_asio', include_type: 'system')
+        filesystem_dep = boost_proj.dependency(
+            'boost_filesystem',
+            include_type: 'system',
+        )
+        process_dep = boost_proj.dependency(
+            'boost_process',
+            include_type: 'system',
+        )
     endif
 
     gtest_main_dep = dependency('gtest_main')
     gmock_dep = dependency('gmock')
 else
+    boost_dep = disabler()
+    asio_dep = disabler()
     filesystem_dep = disabler()
     gtest_main_dep = disabler()
     gmock_dep = disabler()
+    process_dep = disabler()
 endif
 
 arrow_test_lib = static_library(
     'arrow_testing',
     sources: arrow_testing_srcs,
-    dependencies: [arrow_dep, filesystem_dep, gtest_main_dep],
+    dependencies: [
+        arrow_dep,
+        asio_dep,
+        boost_dep,
+        filesystem_dep,
+        gtest_main_dep,

Review Comment:
   Do we need to use `gtest_main_dep` here? Can we use `gtest_dep`? (I think `gtest_main_dep` is only needed by test executables.)
   



##########
cpp/src/arrow/util/meson.build:
##########
@@ -59,7 +59,14 @@ conf_data.set('ARROW_GCS', false)
 conf_data.set('ARROW_HDFS', false)
 conf_data.set('ARROW_S3', false)
 conf_data.set('ARROW_USE_GLOG', false)
-conf_data.set('ARROW_USE_NATIVE_INT128', false)
+
+if cpp_compiler.has_define('__SIZEOF_INT128__')
+    use_native_int128 = true
+else
+    use_native_int128 = false
+endif

Review Comment:
   ```suggestion
   use_native_int128 = cpp_compiler.has_define('__SIZEOF_INT128__')
   ```



##########
cpp/src/arrow/meson.build:
##########
@@ -356,38 +356,82 @@ install_headers(
 )
 
 if needs_tests
+    boost_dep = dependency('boost', include_type: 'system', required: false)
+
+    asio_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'asio',
+        required: false,
+    )
+
     filesystem_dep = dependency(
         'boost',
-        modules: ['filesystem'],
+        include_type: 'system',
+        modules: 'filesystem',
         required: false,
     )
-    if not filesystem_dep.found()
+
+    process_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'process',
+        required: false,
+    )
+
+    if not (boost_dep.found()
+and asio_dep.found()
+and filesystem_dep.found()
+and process_dep.found()
+)
         cmake = import('cmake')
         boost_opt = cmake.subproject_options()
         boost_opt.add_cmake_defines(
-            {'BOOST_INCLUDE_LIBRARIES': 'filesystem;system'},
+            {'BOOST_INCLUDE_LIBRARIES': 'asio;filesystem;process'},
         )
         boost_proj = cmake.subproject('boost', options: boost_opt)
-        filesystem_dep = boost_proj.dependency('boost_filesystem')
+        boost_dep = boost_proj.dependency(
+            'boost_headers',
+            include_type: 'system',
+        )
+        asio_dep = boost_proj.dependency('boost_asio', include_type: 'system')
+        filesystem_dep = boost_proj.dependency(
+            'boost_filesystem',
+            include_type: 'system',
+        )
+        process_dep = boost_proj.dependency(
+            'boost_process',
+            include_type: 'system',
+        )
     endif
 
     gtest_main_dep = dependency('gtest_main')
     gmock_dep = dependency('gmock')
 else
+    boost_dep = disabler()
+    asio_dep = disabler()
     filesystem_dep = disabler()
     gtest_main_dep = disabler()
     gmock_dep = disabler()
+    process_dep = disabler()
 endif
 
 arrow_test_lib = static_library(
     'arrow_testing',
     sources: arrow_testing_srcs,
-    dependencies: [arrow_dep, filesystem_dep, gtest_main_dep],
+    dependencies: [
+        arrow_dep,
+        asio_dep,
+        boost_dep,
+        filesystem_dep,
+        gtest_main_dep,
+        process_dep,

Review Comment:
   `dependencies` affects link order, right?
   Could you use `process_dep`, `filesystem_dep`, `asio_dep` order because `process_dep` depends on `filesystem_dep` and `asio_dep`?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1995766482


##########
cpp/src/arrow/meson.build:
##########
@@ -356,38 +356,82 @@ install_headers(
 )
 
 if needs_tests
+    boost_dep = dependency('boost', include_type: 'system', required: false)
+
+    asio_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'asio',
+        required: false,
+    )
+
     filesystem_dep = dependency(
         'boost',
-        modules: ['filesystem'],
+        include_type: 'system',
+        modules: 'filesystem',
         required: false,
     )
-    if not filesystem_dep.found()
+
+    process_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'process',
+        required: false,
+    )
+
+    if not (boost_dep.found()
+and asio_dep.found()
+and filesystem_dep.found()
+and process_dep.found()
+)

Review Comment:
   I agree. I've opened https://github.com/mesonbuild/meson/issues/14364 upstream for now. We could also refactor the code if there isn't much appetite upstream to change



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #45768:
URL: https://github.com/apache/arrow/pull/45768#issuecomment-4267625132

   Thank you for your contribution. Unfortunately, this pull request has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this PR will be closed in 14 days.  Feel free to re-open this if it has been closed in error. If you do not have repository permissions to reopen the PR, please tag a maintainer.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994565643


##########
cpp/src/arrow/meson.build:
##########
@@ -371,25 +371,38 @@ install_headers(
 )
 
 if needs_tests
-    filesystem_dep = dependency(
+    boost_dep = dependency(
         'boost',
         modules: ['filesystem'],
         required: false,
+        include_type: 'system',

Review Comment:
   Could you keep this keyword arguments in alphabetical order?
   
   ```suggestion
           include_type: 'system',
           modules: ['filesystem'],
           required: false,
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994559354


##########
cpp/meson.build:
##########
@@ -46,6 +46,10 @@ cpp_compiler = meson.get_compiler('cpp')
 cpp_args = cpp_compiler.get_supported_arguments(project_args)
 add_project_arguments(cpp_args, language: 'cpp')
 
+if cpp_compiler.has_define('__SIZEOF_INT128__')
+    add_project_arguments(['-DARROW_USE_NATIVE_INT128'], language: 'cpp')

Review Comment:
   Could you use define this macro by `cpp/src/arrow/util/config.h.cmake`?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994651922


##########
cpp/src/arrow/meson.build:
##########
@@ -371,25 +371,38 @@ install_headers(
 )
 
 if needs_tests
-    filesystem_dep = dependency(
+    boost_dep = dependency(
         'boost',
         modules: ['filesystem'],

Review Comment:
   Absolutely. I think what is on main is closer to that, so I'll update this to reflect that. Each CMake target should be wrapped by Meson, so you can have filesystem_dep, process_dep, etc... just like in the else branch



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994158185


##########
cpp/src/arrow/meson.build:
##########
@@ -371,25 +371,38 @@ install_headers(
 )
 
 if needs_tests
-    filesystem_dep = dependency(
+    boost_dep = dependency(
         'boost',
         modules: ['filesystem'],

Review Comment:
   At least on Ubuntu it appears that installation of libboost-filesystem-dev includes the other components needed for building (asio and process). However, adding those to the `modules` here will fail.
   
   I'm not familiar with how Boost is distributed so this may or may not be a bug with Meson



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #45768:
URL: https://github.com/apache/arrow/pull/45768#issuecomment-2793301363

   Revision: c7dd31af8c79e5f3dc3596e6182caa04cf32ba46
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-469ba60e72](https://github.com/ursacomputing/crossbow/branches/all?query=actions-469ba60e72)
   
   |Task|Status|
   |----|------|
   |test-conda-cpp-meson|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-469ba60e72-github-test-conda-cpp-meson)](https://github.com/ursacomputing/crossbow/actions/runs/14382237000/job/40328681124)|


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #45768:
URL: https://github.com/apache/arrow/pull/45768#issuecomment-2726241284

   Revision: 1e11dd50cf05c4789434b785751a0e6cdce15e10
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-2d027b0903](https://github.com/ursacomputing/crossbow/branches/all?query=actions-2d027b0903)
   
   |Task|Status|
   |----|------|
   |test-conda-cpp-meson|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-2d027b0903-github-test-conda-cpp-meson)](https://github.com/ursacomputing/crossbow/actions/runs/13869921288/job/38815242664)|


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994559354


##########
cpp/meson.build:
##########
@@ -46,6 +46,10 @@ cpp_compiler = meson.get_compiler('cpp')
 cpp_args = cpp_compiler.get_supported_arguments(project_args)
 add_project_arguments(cpp_args, language: 'cpp')
 
+if cpp_compiler.has_define('__SIZEOF_INT128__')
+    add_project_arguments(['-DARROW_USE_NATIVE_INT128'], language: 'cpp')

Review Comment:
   Could you define this macro by `cpp/src/arrow/util/config.h.cmake`?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on PR #45768:
URL: https://github.com/apache/arrow/pull/45768#issuecomment-2727250832

   @github-actions crossbow submit *meson


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994565051


##########
cpp/src/arrow/meson.build:
##########
@@ -371,25 +371,38 @@ install_headers(
 )
 
 if needs_tests
-    filesystem_dep = dependency(
+    boost_dep = dependency(
         'boost',
         modules: ['filesystem'],

Review Comment:
   In CMake, we can use separated CMake targets for Boost. For example, `Boost::filesystem` and `Boost::process`. Can we do this with Meson?
   
   Some libraries (e.g. Gandiva) need only `Boost::headers` but other libraries (e.g. `arrow_testing`) need `Boost::headers` and `Boost::process`.
   I don't want to link needless libraries as much as possible. (e.g. I don't want to link `Boost::process` to Gandiva.)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1996599469


##########
cpp/src/arrow/meson.build:
##########
@@ -356,38 +356,82 @@ install_headers(
 )
 
 if needs_tests
+    boost_dep = dependency('boost', include_type: 'system', required: false)
+
+    asio_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'asio',
+        required: false,
+    )
+
     filesystem_dep = dependency(
         'boost',
-        modules: ['filesystem'],
+        include_type: 'system',
+        modules: 'filesystem',
         required: false,
     )
-    if not filesystem_dep.found()
+
+    process_dep = dependency(
+        'boost',
+        include_type: 'system',
+        modules: 'process',
+        required: false,
+    )
+
+    if not (boost_dep.found()
+and asio_dep.found()
+and filesystem_dep.found()
+and process_dep.found()
+)
         cmake = import('cmake')
         boost_opt = cmake.subproject_options()
         boost_opt.add_cmake_defines(
-            {'BOOST_INCLUDE_LIBRARIES': 'filesystem;system'},
+            {'BOOST_INCLUDE_LIBRARIES': 'asio;filesystem;process'},
         )
         boost_proj = cmake.subproject('boost', options: boost_opt)
-        filesystem_dep = boost_proj.dependency('boost_filesystem')
+        boost_dep = boost_proj.dependency(
+            'boost_headers',
+            include_type: 'system',
+        )
+        asio_dep = boost_proj.dependency('boost_asio', include_type: 'system')
+        filesystem_dep = boost_proj.dependency(
+            'boost_filesystem',
+            include_type: 'system',
+        )
+        process_dep = boost_proj.dependency(
+            'boost_process',
+            include_type: 'system',
+        )
     endif
 
     gtest_main_dep = dependency('gtest_main')
     gmock_dep = dependency('gmock')
 else
+    boost_dep = disabler()
+    asio_dep = disabler()
     filesystem_dep = disabler()
     gtest_main_dep = disabler()
     gmock_dep = disabler()
+    process_dep = disabler()
 endif
 
 arrow_test_lib = static_library(
     'arrow_testing',
     sources: arrow_testing_srcs,
-    dependencies: [arrow_dep, filesystem_dep, gtest_main_dep],
+    dependencies: [
+        arrow_dep,
+        asio_dep,
+        boost_dep,
+        filesystem_dep,
+        gtest_main_dep,

Review Comment:
   We can work on this as a separated task.
   
   I think that we need `gtest_main_dep` for each test:
   
   ```diff
   diff --git a/cpp/src/arrow/meson.build b/cpp/src/arrow/meson.build
   index 3a538ca2b2..6e2cc7adb0 100644
   --- a/cpp/src/arrow/meson.build
   +++ b/cpp/src/arrow/meson.build
   @@ -444,7 +444,7 @@ foreach key, val : arrow_tests
        exc = executable(
            key,
            sources: val['sources'],
   -        dependencies: [arrow_test_dep, val.get('dependencies', [])],
   +        dependencies: [val.get('dependencies', []), arrow_test_dep, gtest_main_dep],
        )
        test(key, exc)
    endforeach
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994158185


##########
cpp/src/arrow/meson.build:
##########
@@ -371,25 +371,38 @@ install_headers(
 )
 
 if needs_tests
-    filesystem_dep = dependency(
+    boost_dep = dependency(
         'boost',
         modules: ['filesystem'],

Review Comment:
   At least on Ubuntu it appears that installation of libboost-filesystem-dev includes the other components needed for building (asio and process). However, adding those to the `modules` here will fail to detect the system installation and fall back to the WrapDB entry.
   
   I'm not familiar with how Boost is distributed so this may or may not be a bug with Meson



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #45768:
URL: https://github.com/apache/arrow/pull/45768#issuecomment-2722425581

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


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on code in PR #45768:
URL: https://github.com/apache/arrow/pull/45768#discussion_r1994689920


##########
cpp/src/arrow/meson.build:
##########
@@ -371,25 +371,38 @@ install_headers(
 )
 
 if needs_tests
-    filesystem_dep = dependency(
+    boost_dep = dependency(
         'boost',
         modules: ['filesystem'],

Review Comment:
   To clarify the update code, with Meson a call to:
   
   ```python
   boost_dep = declare_dependency('boost')
   ```
   
   Will return a dependency to the header only library for boost. If you additionally call with a module like:
   
   ```python
   filesystem_dep = dependency('boost', modules: 'filesystem')
   ```
   
   The dependency will then cause linkage against the specified module(s)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #45768:
URL: https://github.com/apache/arrow/pull/45768#issuecomment-2727251692

   Revision: f2a8d232fa6815b37578fae37da5a85952d58165
   
   Submitted crossbow builds: [ursacomputing/crossbow @ actions-15aa60293b](https://github.com/ursacomputing/crossbow/branches/all?query=actions-15aa60293b)
   
   |Task|Status|
   |----|------|
   |test-conda-cpp-meson|[![GitHub Actions](https://github.com/ursacomputing/crossbow/actions/workflows/crossbow.yml/badge.svg?branch=actions-15aa60293b-github-test-conda-cpp-meson)](https://github.com/ursacomputing/crossbow/actions/runs/13881352553/job/38840228383)|


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #45768:
URL: https://github.com/apache/arrow/pull/45768#issuecomment-2726240405

   @github-actions crossbow submit *meson


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-45767: [C++] Fix Meson compilation issue with non-system Boost [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on PR #45768:
URL: https://github.com/apache/arrow/pull/45768#issuecomment-2793266257

   @github-actions crossbow submit *meson


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org