You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@graphar.apache.org by "SYaoJun (via GitHub)" <gi...@apache.org> on 2026/03/04 15:06:34 UTC
[PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
SYaoJun opened a new pull request, #904:
URL: https://github.com/apache/incubator-graphar/pull/904
<!--
Thanks for contributing to GraphAr.
If this is your first pull request you can find detailed information on [CONTRIBUTING.md](https://github.com/apache/graphar/blob/main/CONTRIBUTING.md)
The Apache GraphAr (incubating) community has restrictions on the naming of pr title. You can find instructions in
[CONTRIBUTING.md](https://github.com/apache/graphar/blob/main/CONTRIBUTING.md#title) too.
-->
### Reason for this PR
<!--
Why are you proposing this change? If this is already tracked in an issue, please link to the issue here.
Explaining clearly why this change is beneficial is important for the reviewers to understand the context.
-->
fix: #903
1. add `cmake-format` in pre-commit
2. format all related cmake configuartion files
3. enable `CI` check cmake-format
### What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
### Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
4. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
### Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
-->
<!-- **BREAKING CHANGE: <description>** -->
<!--
Please uncomment the line below (and provide explanation) if the changes fix either
(a) a security vulnerability,
(b) a bug that caused incorrect or invalid data to be produced, or
(c) a bug that causes a crash (even when the API contract is upheld).
We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
-->
<!-- **Critical Fix: <description>** -->
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "SYaoJun (via GitHub)" <gi...@apache.org>.
SYaoJun commented on PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904#issuecomment-4198628851
> This change introduces `cmake-format` checks and also updates CMake-related files outside `cpp/`, such as `python/CMakeLists.txt`, `maven-projects/java/CMakeLists.txt`, `.pre-commit-config.yaml`, and `cmake-format.py`. However, the workflow trigger in `.github/workflows/ci.yml` still only watches `cpp/**` and the workflow file itself.
>
> As a result, future PRs that only modify those non-`cpp/` CMake/config files will not trigger this workflow, so the new `cmake-format` check will not run for them. That means the formatting rule is not fully enforced by CI and can silently drift or break.
>
> I think the workflow `paths` filter should be expanded to include the newly covered files and directories.
Hi @Thespica, I create a new `pre-commit.yml` to check all the format issue, which does not limit to cpp directory.
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "Thespica (via GitHub)" <gi...@apache.org>.
Thespica commented on PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904#issuecomment-4192785138
This change introduces `cmake-format` checks and also updates CMake-related files outside `cpp/`, such as `python/CMakeLists.txt`, `maven-projects/java/CMakeLists.txt`, `.pre-commit-config.yaml`, and `cmake-format.py`. However, the workflow trigger in `.github/workflows/ci.yml` still only watches `cpp/**` and the workflow file itself.
As a result, future PRs that only modify those non-`cpp/` CMake/config files will not trigger this workflow, so the new `cmake-format` check will not run for them. That means the formatting rule is not fully enforced by CI and can silently drift or break.
I think the workflow `paths` filter should be expanded to include the newly covered files and directories.
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "SYaoJun (via GitHub)" <gi...@apache.org>.
SYaoJun commented on code in PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904#discussion_r2911870639
##########
cpp/CMakeLists.txt:
##########
@@ -284,57 +298,62 @@ endfunction()
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
include_directories(src)
-if (BUILD_ARROW_FROM_SOURCE)
- # the necessary dependencies for building arrow from source
- find_package(OpenSSL REQUIRED)
- if(OPENSSL_FOUND)
- if(OPENSSL_VERSION LESS "1.1.0")
- message(ERROR "The OpenSSL must be greater than or equal to 1.1.0, current version is ${OPENSSL_VERSION}")
- endif()
+if(BUILD_ARROW_FROM_SOURCE)
+ # the necessary dependencies for building arrow from source
+ find_package(OpenSSL REQUIRED)
+ if(OPENSSL_FOUND)
+ if(OPENSSL_VERSION LESS "1.1.0")
+ message(ERROR
+ "The OpenSSL must be greater than or equal to 1.1.0, current version is ${OPENSSL_VERSION}"
+ )
Review Comment:
fixed
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "SYaoJun (via GitHub)" <gi...@apache.org>.
SYaoJun commented on code in PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904#discussion_r2911859187
##########
.pre-commit-config.yaml:
##########
@@ -47,6 +47,11 @@ repos:
types_or: [c++]
args: [--style=file, --verbose]
exclude: ^cpp/thirdparty/
+
+ - repo: https://github.com/cheshirekow/cmake-format-precommit
+ rev: v0.6.10
+ hooks:
+ - id: cmake-format
Review Comment:
cmake-format.py also can find it.
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "SYaoJun (via GitHub)" <gi...@apache.org>.
SYaoJun commented on code in PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904#discussion_r2911792378
##########
cpp/cmake/apache-arrow.cmake:
##########
@@ -35,139 +35,162 @@
# This cmake file is referred and derived from
# https://github.com/apache/arrow/blob/master/matlab/CMakeLists.txt
-
# Build the Arrow C++ libraries.
function(build_arrow)
- set(one_value_args)
- set(multi_value_args)
+ set(one_value_args)
+ set(multi_value_args)
+
+ cmake_parse_arguments(ARG
+ "${options}"
+ "${one_value_args}"
+ "${multi_value_args}"
+ ${ARGN})
+ if(ARG_UNPARSED_ARGUMENTS)
+ message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
+ endif()
- cmake_parse_arguments(ARG
- "${options}"
- "${one_value_args}"
- "${multi_value_args}"
- ${ARGN})
- if (ARG_UNPARSED_ARGUMENTS)
- message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
- endif ()
+ # If Arrow needs to be built, the default location will be within the build tree.
+ set(GAR_ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
- # If Arrow needs to be built, the default location will be within the build tree.
- set(GAR_ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
+ set(GAR_ARROW_STATIC_LIBRARY_DIR "${GAR_ARROW_PREFIX}/lib")
- set(GAR_ARROW_STATIC_LIBRARY_DIR "${GAR_ARROW_PREFIX}/lib")
+ set(GAR_ARROW_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_ARROW_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow lib")
+ set(GAR_PARQUET_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_PARQUET_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "parquet lib")
+ set(GAR_DATASET_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_dataset${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_DATASET_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_DATASET_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow dataset lib")
+ set(GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_compute${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_ARROW_COMPUTE_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow compute lib")
+ set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ )
+ set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "bundled deps lib")
- set(GAR_ARROW_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow lib")
- set(GAR_PARQUET_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_PARQUET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}" CACHE INTERNAL "parquet lib")
- set(GAR_DATASET_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_dataset${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_DATASET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_DATASET_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow dataset lib")
- set(GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_compute${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_COMPUTE_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow compute lib")
- set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB
- "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME}" CACHE INTERNAL "bundled deps lib")
+ set(GAR_ARROW_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-build")
+ set(GAR_ARROW_CMAKE_ARGS
+ "-DCMAKE_INSTALL_PREFIX=${GAR_ARROW_PREFIX}"
+ "-DARROW_BUILD_STATIC=ON"
+ "-DARROW_BUILD_SHARED=OFF"
+ "-DARROW_DEPENDENCY_SOURCE=BUNDLED"
+ "-DARROW_DEPENDENCY_USE_SHARED=OFF"
+ "-DCMAKE_INSTALL_LIBDIR=lib"
+ "-Dxsimd_SOURCE=BUNDLED"
+ "-DARROW_PARQUET=ON"
+ "-DARROW_WITH_RE2=OFF"
+ "-DARROW_WITH_UTF8PROC=OFF"
+ "-DARROW_WITH_RE2=OFF"
+ "-DARROW_FILESYSTEM=ON"
Review Comment:
good suggestion!
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "yangxk1 (via GitHub)" <gi...@apache.org>.
yangxk1 merged PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904#issuecomment-3998179175
## [Codecov](https://app.codecov.io/gh/apache/incubator-graphar/pull/904?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 80.60%. Comparing base ([`b4bc86c`](https://app.codecov.io/gh/apache/incubator-graphar/commit/b4bc86cfe93d0ee60cbcdddd1a32272ecb4b7cae?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`b9e155d`](https://app.codecov.io/gh/apache/incubator-graphar/commit/b9e155d99554bcb1bf914e584b1d6e24fd1a1244?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #904 +/- ##
=========================================
Coverage 80.60% 80.60%
Complexity 615 615
=========================================
Files 94 94
Lines 10709 10709
Branches 1055 1055
=========================================
Hits 8632 8632
Misses 1837 1837
Partials 240 240
```
| [Flag](https://app.codecov.io/gh/apache/incubator-graphar/pull/904/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [cpp](https://app.codecov.io/gh/apache/incubator-graphar/pull/904/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.90% <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/incubator-graphar/pull/904?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "SYaoJun (via GitHub)" <gi...@apache.org>.
SYaoJun commented on code in PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904#discussion_r2911789098
##########
cpp/cmake/apache-arrow.cmake:
##########
@@ -35,139 +35,162 @@
# This cmake file is referred and derived from
# https://github.com/apache/arrow/blob/master/matlab/CMakeLists.txt
-
# Build the Arrow C++ libraries.
function(build_arrow)
- set(one_value_args)
- set(multi_value_args)
+ set(one_value_args)
+ set(multi_value_args)
+
+ cmake_parse_arguments(ARG
+ "${options}"
+ "${one_value_args}"
+ "${multi_value_args}"
+ ${ARGN})
+ if(ARG_UNPARSED_ARGUMENTS)
+ message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
+ endif()
- cmake_parse_arguments(ARG
- "${options}"
- "${one_value_args}"
- "${multi_value_args}"
- ${ARGN})
- if (ARG_UNPARSED_ARGUMENTS)
- message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
- endif ()
+ # If Arrow needs to be built, the default location will be within the build tree.
+ set(GAR_ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
- # If Arrow needs to be built, the default location will be within the build tree.
- set(GAR_ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
+ set(GAR_ARROW_STATIC_LIBRARY_DIR "${GAR_ARROW_PREFIX}/lib")
- set(GAR_ARROW_STATIC_LIBRARY_DIR "${GAR_ARROW_PREFIX}/lib")
+ set(GAR_ARROW_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_ARROW_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow lib")
+ set(GAR_PARQUET_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_PARQUET_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "parquet lib")
+ set(GAR_DATASET_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_dataset${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_DATASET_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_DATASET_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow dataset lib")
+ set(GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_compute${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_ARROW_COMPUTE_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow compute lib")
+ set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ )
+ set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "bundled deps lib")
- set(GAR_ARROW_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow lib")
- set(GAR_PARQUET_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_PARQUET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}" CACHE INTERNAL "parquet lib")
- set(GAR_DATASET_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_dataset${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_DATASET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_DATASET_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow dataset lib")
- set(GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_compute${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_COMPUTE_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow compute lib")
- set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB
- "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME}" CACHE INTERNAL "bundled deps lib")
+ set(GAR_ARROW_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-build")
+ set(GAR_ARROW_CMAKE_ARGS
+ "-DCMAKE_INSTALL_PREFIX=${GAR_ARROW_PREFIX}"
+ "-DARROW_BUILD_STATIC=ON"
+ "-DARROW_BUILD_SHARED=OFF"
+ "-DARROW_DEPENDENCY_SOURCE=BUNDLED"
+ "-DARROW_DEPENDENCY_USE_SHARED=OFF"
+ "-DCMAKE_INSTALL_LIBDIR=lib"
+ "-Dxsimd_SOURCE=BUNDLED"
+ "-DARROW_PARQUET=ON"
+ "-DARROW_WITH_RE2=OFF"
+ "-DARROW_WITH_UTF8PROC=OFF"
+ "-DARROW_WITH_RE2=OFF"
+ "-DARROW_FILESYSTEM=ON"
+ "-DARROW_CSV=ON"
+ "-DARROW_JSON=ON"
+ "-DARROW_PYTHON=OFF"
+ "-DARROW_BUILD_BENCHMAKRS=OFF"
+ "-DARROW_BUILD_TESTS=OFF"
Review Comment:
accepted
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org
Re: [PR] refactor(cmake): CMake configuration files for improved readability [incubator-graphar]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #904:
URL: https://github.com/apache/incubator-graphar/pull/904#discussion_r2911484503
##########
cpp/CMakeLists.txt:
##########
@@ -284,57 +298,62 @@ endfunction()
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
include_directories(src)
-if (BUILD_ARROW_FROM_SOURCE)
- # the necessary dependencies for building arrow from source
- find_package(OpenSSL REQUIRED)
- if(OPENSSL_FOUND)
- if(OPENSSL_VERSION LESS "1.1.0")
- message(ERROR "The OpenSSL must be greater than or equal to 1.1.0, current version is ${OPENSSL_VERSION}")
- endif()
+if(BUILD_ARROW_FROM_SOURCE)
+ # the necessary dependencies for building arrow from source
+ find_package(OpenSSL REQUIRED)
+ if(OPENSSL_FOUND)
+ if(OPENSSL_VERSION LESS "1.1.0")
+ message(ERROR
+ "The OpenSSL must be greater than or equal to 1.1.0, current version is ${OPENSSL_VERSION}"
+ )
Review Comment:
`message(ERROR ...)` isn't a valid CMake message mode and will itself error when this branch is hit. If the intent is to stop configuration when OpenSSL < 1.1.0 is detected, use `message(FATAL_ERROR ...)` (or `SEND_ERROR` if you want to continue processing).
##########
.pre-commit-config.yaml:
##########
@@ -47,6 +47,11 @@ repos:
types_or: [c++]
args: [--style=file, --verbose]
exclude: ^cpp/thirdparty/
+
+ - repo: https://github.com/cheshirekow/cmake-format-precommit
+ rev: v0.6.10
+ hooks:
+ - id: cmake-format
Review Comment:
The cmake-format hook is added, but the repository config file is named `cmake-format.py` and isn't referenced here. `cmake-format` typically auto-discovers `.cmake-format.py`/`.cmake-format.yaml`, so this setup may run with default formatting settings in CI and on contributors' machines. Rename the config to `.cmake-format.py` or pass the config explicitly via hook `args` (e.g., `--config-files cmake-format.py`).
##########
cpp/cmake/apache-arrow.cmake:
##########
@@ -35,139 +35,162 @@
# This cmake file is referred and derived from
# https://github.com/apache/arrow/blob/master/matlab/CMakeLists.txt
-
# Build the Arrow C++ libraries.
function(build_arrow)
- set(one_value_args)
- set(multi_value_args)
+ set(one_value_args)
+ set(multi_value_args)
+
+ cmake_parse_arguments(ARG
+ "${options}"
+ "${one_value_args}"
+ "${multi_value_args}"
+ ${ARGN})
+ if(ARG_UNPARSED_ARGUMENTS)
+ message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
+ endif()
- cmake_parse_arguments(ARG
- "${options}"
- "${one_value_args}"
- "${multi_value_args}"
- ${ARGN})
- if (ARG_UNPARSED_ARGUMENTS)
- message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
- endif ()
+ # If Arrow needs to be built, the default location will be within the build tree.
+ set(GAR_ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
- # If Arrow needs to be built, the default location will be within the build tree.
- set(GAR_ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
+ set(GAR_ARROW_STATIC_LIBRARY_DIR "${GAR_ARROW_PREFIX}/lib")
- set(GAR_ARROW_STATIC_LIBRARY_DIR "${GAR_ARROW_PREFIX}/lib")
+ set(GAR_ARROW_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_ARROW_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow lib")
+ set(GAR_PARQUET_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_PARQUET_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "parquet lib")
+ set(GAR_DATASET_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_dataset${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_DATASET_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_DATASET_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow dataset lib")
+ set(GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_compute${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_ARROW_COMPUTE_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow compute lib")
+ set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ )
+ set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "bundled deps lib")
- set(GAR_ARROW_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow lib")
- set(GAR_PARQUET_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_PARQUET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}" CACHE INTERNAL "parquet lib")
- set(GAR_DATASET_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_dataset${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_DATASET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_DATASET_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow dataset lib")
- set(GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_compute${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_COMPUTE_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow compute lib")
- set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB
- "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME}" CACHE INTERNAL "bundled deps lib")
+ set(GAR_ARROW_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-build")
+ set(GAR_ARROW_CMAKE_ARGS
+ "-DCMAKE_INSTALL_PREFIX=${GAR_ARROW_PREFIX}"
+ "-DARROW_BUILD_STATIC=ON"
+ "-DARROW_BUILD_SHARED=OFF"
+ "-DARROW_DEPENDENCY_SOURCE=BUNDLED"
+ "-DARROW_DEPENDENCY_USE_SHARED=OFF"
+ "-DCMAKE_INSTALL_LIBDIR=lib"
+ "-Dxsimd_SOURCE=BUNDLED"
+ "-DARROW_PARQUET=ON"
+ "-DARROW_WITH_RE2=OFF"
+ "-DARROW_WITH_UTF8PROC=OFF"
+ "-DARROW_WITH_RE2=OFF"
+ "-DARROW_FILESYSTEM=ON"
+ "-DARROW_CSV=ON"
+ "-DARROW_JSON=ON"
+ "-DARROW_PYTHON=OFF"
+ "-DARROW_BUILD_BENCHMAKRS=OFF"
+ "-DARROW_BUILD_TESTS=OFF"
Review Comment:
The Arrow CMake option name is misspelled as `ARROW_BUILD_BENCHMAKRS` (missing "R"). This will be ignored by Arrow and may accidentally build benchmarks. Use the correct `ARROW_BUILD_BENCHMARKS` option name in the CMake args list.
##########
cpp/cmake/apache-arrow.cmake:
##########
@@ -35,139 +35,162 @@
# This cmake file is referred and derived from
# https://github.com/apache/arrow/blob/master/matlab/CMakeLists.txt
-
# Build the Arrow C++ libraries.
function(build_arrow)
- set(one_value_args)
- set(multi_value_args)
+ set(one_value_args)
+ set(multi_value_args)
+
+ cmake_parse_arguments(ARG
+ "${options}"
+ "${one_value_args}"
+ "${multi_value_args}"
+ ${ARGN})
+ if(ARG_UNPARSED_ARGUMENTS)
+ message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
+ endif()
- cmake_parse_arguments(ARG
- "${options}"
- "${one_value_args}"
- "${multi_value_args}"
- ${ARGN})
- if (ARG_UNPARSED_ARGUMENTS)
- message(SEND_ERROR "Error: unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
- endif ()
+ # If Arrow needs to be built, the default location will be within the build tree.
+ set(GAR_ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
- # If Arrow needs to be built, the default location will be within the build tree.
- set(GAR_ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
+ set(GAR_ARROW_STATIC_LIBRARY_DIR "${GAR_ARROW_PREFIX}/lib")
- set(GAR_ARROW_STATIC_LIBRARY_DIR "${GAR_ARROW_PREFIX}/lib")
+ set(GAR_ARROW_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_ARROW_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow lib")
+ set(GAR_PARQUET_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_PARQUET_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "parquet lib")
+ set(GAR_DATASET_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_dataset${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_DATASET_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_DATASET_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow dataset lib")
+ set(GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_compute${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(GAR_ARROW_COMPUTE_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "arrow compute lib")
+ set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME
+ "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ )
+ set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB
+ "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME}"
+ CACHE INTERNAL "bundled deps lib")
- set(GAR_ARROW_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow lib")
- set(GAR_PARQUET_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}parquet${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_PARQUET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_PARQUET_STATIC_LIB_FILENAME}" CACHE INTERNAL "parquet lib")
- set(GAR_DATASET_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_dataset${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_DATASET_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_DATASET_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow dataset lib")
- set(GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_compute${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_COMPUTE_STATIC_LIB "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_COMPUTE_STATIC_LIB_FILENAME}" CACHE INTERNAL "arrow compute lib")
- set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME
- "${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}")
- set(GAR_ARROW_BUNDLED_DEPS_STATIC_LIB
- "${GAR_ARROW_STATIC_LIBRARY_DIR}/${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB_FILENAME}" CACHE INTERNAL "bundled deps lib")
+ set(GAR_ARROW_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-build")
+ set(GAR_ARROW_CMAKE_ARGS
+ "-DCMAKE_INSTALL_PREFIX=${GAR_ARROW_PREFIX}"
+ "-DARROW_BUILD_STATIC=ON"
+ "-DARROW_BUILD_SHARED=OFF"
+ "-DARROW_DEPENDENCY_SOURCE=BUNDLED"
+ "-DARROW_DEPENDENCY_USE_SHARED=OFF"
+ "-DCMAKE_INSTALL_LIBDIR=lib"
+ "-Dxsimd_SOURCE=BUNDLED"
+ "-DARROW_PARQUET=ON"
+ "-DARROW_WITH_RE2=OFF"
+ "-DARROW_WITH_UTF8PROC=OFF"
+ "-DARROW_WITH_RE2=OFF"
+ "-DARROW_FILESYSTEM=ON"
Review Comment:
`GAR_ARROW_CMAKE_ARGS` includes `-DARROW_WITH_RE2=OFF` twice. This duplication is redundant and can make it harder to audit the Arrow build configuration; remove the duplicate entry to keep the option list unambiguous.
--
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: commits-unsubscribe@graphar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@graphar.apache.org
For additional commands, e-mail: commits-help@graphar.apache.org