-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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-41333: [C++][CMake] Prefer protobuf-config.cmake to FindProtobuf.cmake #41360
Conversation
@github-actions crossbow submit -g cpp -g python -g r |
|
This comment was marked as outdated.
This comment was marked as outdated.
17ecdd1
to
53157c0
Compare
@github-actions crossbow submit -g cpp -g python -g r |
Revision: 53157c0 Submitted crossbow builds: ursacomputing/crossbow @ actions-6323df8a9c |
Thanks @kou I was trying something similar on Conda: diff --git a/cpp/cmake_modules/FindProtobufAlt.cmake b/cpp/cmake_modules/FindProtobufAlt.cmake
index 15fe1b4..71a4a1c 100644
--- a/cpp/cmake_modules/FindProtobufAlt.cmake
+++ b/cpp/cmake_modules/FindProtobufAlt.cmake
@@ -28,9 +28,19 @@ endif()
if(ProtobufAlt_FIND_QUIETLY)
list(APPEND find_package_args QUIET)
endif()
-find_package(Protobuf ${find_package_args})
-set(ProtobufAlt_FOUND ${Protobuf_FOUND})
-if(ProtobufAlt_FOUND)
+find_package(protobuf CONFIG ${find_package_args})
+set(ProtobufAlt_FOUND ${protobuf_FOUND})
+if(NOT ProtobufAlt_FOUND)
+ find_package(Protobuf ${find_package_args})
+ set(ProtobufAlt_FOUND ${Protobuf_FOUND})
+endif()
+if(protobuf_FOUND)
+ set(ProtobufAlt_VERSION ${protobuf_VERSION})
+ set(ProtobufAlt_VERSION_MAJOR ${protobuf_VERSION_MAJOR})
+ set(ProtobufAlt_VERSION_MINOR ${protobuf_VERSION_MINOR})
+ set(ProtobufAlt_VERSION_PATCH ${protobuf_VERSION_PATCH})
+ set(ProtobufAlt_VERSION_TWEEK ${protobuf_VERSION_TWEEK})
+elseif(Protobuf_FOUND)
set(ProtobufAlt_VERSION ${Protobuf_VERSION})
set(ProtobufAlt_VERSION_MAJOR ${Protobuf_VERSION_MAJOR})
set(ProtobufAlt_VERSION_MINOR ${Protobuf_VERSION_MINOR}) edit with correct patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error seems unrelated and I arrived to a really similar patch from the initial pointers.
@github-actions crossbow submit verify-rc-source-cpp-macos-arm64 |
Revision: 53157c0 Submitted crossbow builds: ursacomputing/crossbow @ actions-5614ccecdd
|
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 64be7a2. There were 5 benchmark results indicating a performance regression:
The full Conbench report has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…make (#41360) ### Rationale for this change `protobuf::libprotobuf` provided by `FindProtobuf.cmake` (provided by CMake) may not provide needed dependencies such as Abseil. ### What changes are included in this PR? Try `protobuf-config.cmake` provided by Protobuf before `FindProtobuf.cmake`. `protobuf::libprotobuf` provided by `protobuf-config.cmake` must have needed dependencies. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: #41333 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
…obuf.cmake (apache#41360) ### Rationale for this change `protobuf::libprotobuf` provided by `FindProtobuf.cmake` (provided by CMake) may not provide needed dependencies such as Abseil. ### What changes are included in this PR? Try `protobuf-config.cmake` provided by Protobuf before `FindProtobuf.cmake`. `protobuf::libprotobuf` provided by `protobuf-config.cmake` must have needed dependencies. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: apache#41333 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
…obuf.cmake (apache#41360) ### Rationale for this change `protobuf::libprotobuf` provided by `FindProtobuf.cmake` (provided by CMake) may not provide needed dependencies such as Abseil. ### What changes are included in this PR? Try `protobuf-config.cmake` provided by Protobuf before `FindProtobuf.cmake`. `protobuf::libprotobuf` provided by `protobuf-config.cmake` must have needed dependencies. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: apache#41333 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
…obuf.cmake (apache#41360) ### Rationale for this change `protobuf::libprotobuf` provided by `FindProtobuf.cmake` (provided by CMake) may not provide needed dependencies such as Abseil. ### What changes are included in this PR? Try `protobuf-config.cmake` provided by Protobuf before `FindProtobuf.cmake`. `protobuf::libprotobuf` provided by `protobuf-config.cmake` must have needed dependencies. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: apache#41333 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Rationale for this change
protobuf::libprotobuf
provided byFindProtobuf.cmake
(provided by CMake) may not provide needed dependencies such as Abseil.What changes are included in this PR?
Try
protobuf-config.cmake
provided by Protobuf beforeFindProtobuf.cmake
.protobuf::libprotobuf
provided byprotobuf-config.cmake
must have needed dependencies.Are these changes tested?
Yes.
Are there any user-facing changes?
Yes.